diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 1cab7e1..ecb2d10 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,3 +1,4 @@ +" Plugged setup {{{ let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' if empty(glob(data_dir . '/autoload/plug.vim')) silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' @@ -73,12 +74,10 @@ Plug 'github/copilot.vim' endif call plug#end() +" }}} -nnoremap -let mapleader=" " -let maplocalleader=" " -" Colors +" Colors {{{ if has('termguicolors') if &term =~ 'alacritty' set t_8f=[38;2;%lu;%lu;%lum @@ -92,12 +91,7 @@ if has('nvim') endif colorscheme fire -" Conceal options -hi clear Conceal -set conceallevel=2 -set concealcursor=n - -" LightLine config +" LightLine config {{{ set noshowmode let g:lightline = { \ 'enable': { @@ -113,25 +107,31 @@ let g:lightline = { \ 'gitbranch': 'FugitiveHead' \ }, \ } +" }}} +" }}} + +" Conceal options {{{ +hi clear Conceal +set conceallevel=2 +set concealcursor=n +augroup filetype_vim + autocmd! + autocmd FileType vim setlocal foldmethod=marker +augroup END +" }}} -" UltiSnips Config +" UltiSnips Config {{{ let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" +" }}} -" Fugitive Config +" Fugitive Config {{{ nnoremap gs :G set updatetime=100 +" }}} -nnoremap :nohl -nnoremap b :ls:b -nnoremap s :ls:sb - -set encoding=utf-8 - -set completeopt=menu,menuone,noselect,noinsert - -" VIFM +" VIFM {{{ let g:loaded_netrw = 1 let g:loaded_netrwPlugin = 1 let g:vifm_replace_netrw = 1 @@ -140,22 +140,31 @@ let g:vifm_exec = "vifmrun" command Vex vertical VsplitVifm command Sex SplitVifm command Ex Vifm +" }}} + +" Autocompile dwmblocks {{{ +if has("nvim") + autocmd BufWritePost ~/desktop/dwmblocks/blocks.h :term cd ~/desktop/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid -f dwmblocks > /dev/null 2> /dev/null ; } +else + autocmd BufWritePost ~/desktop/dwmblocks/blocks.h !cd ~/desktop/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid dwmblocks > /dev/null 2> /dev/null & } +endif +" }}} " Make " set makeprg=make\ --silent\ 2>&1\ \\\|\ grep\ -E\ \"^([^:\\S]+):\\S+:.+\" +" Vim Config {{{ + +set encoding=utf-8 + +set completeopt=menu,menuone,noselect,noinsert + syntax on " Uncomment the following to have Vim jump to the last position when " reopening a file au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif -" Autocompile dwmblocks -if has("nvim") - autocmd BufWritePost ~/desktop/dwmblocks/blocks.h :term cd ~/desktop/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid -f dwmblocks > /dev/null 2> /dev/null ; } -else - autocmd BufWritePost ~/desktop/dwmblocks/blocks.h !cd ~/desktop/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid dwmblocks > /dev/null 2> /dev/null & } -endif " Uncomment the following to have Vim load indentation rules and plugins " according to the detected filetype. @@ -183,6 +192,14 @@ set relativenumber " Enable relative line numbers set title " Changes terminal title when started set scrolloff=15 +" Vim remaps {{{ +nnoremap +let mapleader=" " +let maplocalleader=" " +nnoremap :nohl +nnoremap b :ls:b +nnoremap s :ls:sb + noremap ; l noremap l k noremap k j @@ -218,12 +235,16 @@ if has("nvim") tnoremap endif +" }}} + +" }}} + " Source a global configuration file if available if filereadable("/etc/vim/vimrc.local") source /etc/vim/vimrc.local endif -" LSP Setup +" LSP Setup {{{ if has("nvim") lua << EOF @@ -408,3 +429,5 @@ if has("nvim") } EOF endif + +" }}}