-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
95 lines (80 loc) · 3.36 KB
/
init.vim
File metadata and controls
95 lines (80 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
" import vim settings
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath=&runtimepath
" Source the .vimrc file
if filereadable(expand('~/.vimrc'))
source ~/.vimrc
echo 'Sourced .vimrc'
endif
" disable NetRW
let loaded_netrw = 1
let loaded_netrwPlugin = 1
" Check if vim-plug is installed and install it if necessary
function! CheckAndInstallVimPlug()
" Define the path to the vim-plug autoload directory for Neovim
let plug_install_dir = expand('~/.local/share/nvim/site/autoload/plug.vim')
" Check if the plug.vim file exists
if !filereadable(plug_install_dir)
" Print a message to inform the user
echo "vim-plug not found. Installing vim-plug..."
" Use system() to run the shell command to download vim-plug
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" Print a message to inform the user that vim-plug has been installed
echo "vim-plug installed successfully."
endif
endfunction
" Call the function to check and install vim-plug
call CheckAndInstallVimPlug()
" PLUGINS """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
call plug#begin('~/.local/share/nvim/plugged')
" call plug#begin('~/.vim/plugged')
" the pope is the man
" Plug 'tpope/vim-sensible'
" Plug 'tpope/vim-fugitive'
" Plug 'tpope/vim-surround'
" Plug 'tpope/vim-commentary'
" Plug 'tomasiser/vim-code-dark'
" Plug 'jiangmiao/auto-pairs' " auto-close '', (), {}...
" Plug 'christoomey/vim-tmux-navigator'
" lit web components
" Plug 'jonsmithers/vim-html-template-literals'
" Plug 'pangloss/vim-javascript'
" Plug 'ap/vim-css-color'
Plug 'nvim-tree/nvim-web-devicons' " icons for nvim-tree
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " syntax highlighting
Plug 'windwp/nvim-ts-autotag' " auto-close/-rename tags with Treesitter
Plug 'nvim-lua/plenary.nvim' " lua libs. required by many plugins
Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' }
Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release' }
Plug 'nvim-tree/nvim-tree.lua' " file browser. NOT nvim-neo-tree!
Plug 'nvim-lualine/lualine.nvim' " vim-airline in lua
Plug 'akinsho/bufferline.nvim', { 'tag': '*' } " buffers on top
call plug#end()
" Ensure all plugins are installed
" autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
" OPTIONS """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set inccommand=split " show replacements in split screen
" KEY BINDINGS """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" files: find
nnoremap <leader>ff <cmd>Telescope find_files<CR>
" files: grep
nnoremap <leader>fg <cmd>Telescope live_grep<CR>
" files: browse
nnoremap <leader>fb <cmd>NvimTreeToggle<CR>
" EVERYTHING LUA """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
lua << EOF
require('nvim-ts-autotag').setup()
require('nvim-tree').setup()
require('lualine').setup()
require('bufferline').setup({
options = {
numbers = true
}
})
require('nvim-treesitter.configs').setup({
highlight = {
enable = true,
}
})
EOF