Added folds to vimrc

main
zoomiti 3 years ago
parent 01e14b8689
commit 9256687b64

@ -1,3 +1,4 @@
" Plugged setup {{{
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.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' 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 endif
call plug#end() call plug#end()
" }}}
nnoremap <Space> <nop>
let mapleader=" "
let maplocalleader=" "
" Colors " Colors {{{
if has('termguicolors') if has('termguicolors')
if &term =~ 'alacritty' if &term =~ 'alacritty'
set t_8f=[38;2;%lu;%lu;%lum set t_8f=[38;2;%lu;%lu;%lum
@ -92,12 +91,7 @@ if has('nvim')
endif endif
colorscheme fire colorscheme fire
" Conceal options " LightLine config {{{
hi clear Conceal
set conceallevel=2
set concealcursor=n
" LightLine config
set noshowmode set noshowmode
let g:lightline = { let g:lightline = {
\ 'enable': { \ 'enable': {
@ -113,25 +107,31 @@ let g:lightline = {
\ 'gitbranch': 'FugitiveHead' \ '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="<tab>" let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>" let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>" let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
" }}}
" Fugitive Config " Fugitive Config {{{
nnoremap <leader>gs :G<CR> nnoremap <leader>gs :G<CR>
set updatetime=100 set updatetime=100
" }}}
nnoremap <Enter> :nohl<CR><C-l><Enter> " VIFM {{{
nnoremap <leader>b :ls<CR>:b<Space>
nnoremap <leader>s :ls<CR>:sb<Space>
set encoding=utf-8
set completeopt=menu,menuone,noselect,noinsert
" VIFM
let g:loaded_netrw = 1 let g:loaded_netrw = 1
let g:loaded_netrwPlugin = 1 let g:loaded_netrwPlugin = 1
let g:vifm_replace_netrw = 1 let g:vifm_replace_netrw = 1
@ -140,22 +140,31 @@ let g:vifm_exec = "vifmrun"
command Vex vertical VsplitVifm command Vex vertical VsplitVifm
command Sex SplitVifm command Sex SplitVifm
command Ex Vifm 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 " Make
" set makeprg=make\ --silent\ 2>&1\ \\\|\ grep\ -E\ \"^([^:\\S]+):\\S+:.+\" " set makeprg=make\ --silent\ 2>&1\ \\\|\ grep\ -E\ \"^([^:\\S]+):\\S+:.+\"
" Vim Config {{{
set encoding=utf-8
set completeopt=menu,menuone,noselect,noinsert
syntax on syntax on
" Uncomment the following to have Vim jump to the last position when " Uncomment the following to have Vim jump to the last position when
" reopening a file " reopening a file
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif 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 " Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype. " according to the detected filetype.
@ -183,6 +192,14 @@ set relativenumber " Enable relative line numbers
set title " Changes terminal title when started set title " Changes terminal title when started
set scrolloff=15 set scrolloff=15
" Vim remaps {{{
nnoremap <Space> <nop>
let mapleader=" "
let maplocalleader=" "
nnoremap <Enter> :nohl<CR><C-l><Enter>
nnoremap <leader>b :ls<CR>:b<Space>
nnoremap <leader>s :ls<CR>:sb<Space>
noremap ; l noremap ; l
noremap l k noremap l k
noremap k j noremap k j
@ -218,12 +235,16 @@ if has("nvim")
tnoremap <C-W><right> <C-\><C-N><C-W><right> tnoremap <C-W><right> <C-\><C-N><C-W><right>
endif endif
" }}}
" }}}
" Source a global configuration file if available " Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local") if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local source /etc/vim/vimrc.local
endif endif
" LSP Setup " LSP Setup {{{
if has("nvim") if has("nvim")
lua << EOF lua << EOF
@ -408,3 +429,5 @@ if has("nvim")
} }
EOF EOF
endif endif
" }}}

Loading…