modular custom vim
This commit is contained in:
parent
c846ada816
commit
150492bcb2
20 changed files with 221 additions and 79 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -252,3 +252,4 @@ ParaView/
|
||||||
VirtualBox/
|
VirtualBox/
|
||||||
knfsshare
|
knfsshare
|
||||||
lazygit/
|
lazygit/
|
||||||
|
glow/
|
||||||
|
|
1
X11/.gitignore
vendored
Normal file
1
X11/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
xinitrc.*
|
|
@ -26,11 +26,14 @@ dwmblocks &
|
||||||
clipmenud &
|
clipmenud &
|
||||||
dunst &
|
dunst &
|
||||||
picom --experimental-backends --animation-for-open-window=zoom &
|
picom --experimental-backends --animation-for-open-window=zoom &
|
||||||
clear &
|
|
||||||
#xrandr --output DVI-D-0 --right-of HDMI-0
|
|
||||||
hsetroot -cover /home/tavo/Pictures/Backgrounds/default.jpg &
|
|
||||||
emacs --daemon &
|
emacs --daemon &
|
||||||
dropbox &
|
dropbox &
|
||||||
|
clear &
|
||||||
|
|
||||||
|
# Multiple displays, add this into xinitrc.displays:
|
||||||
|
# xrandr --output DVI-D-0 --right-of HDMI-0
|
||||||
|
[ -f "$HOME/.config/X11/xinitrc.displays" ] && . /home/tavo/.config/X11/xinitrc.displays
|
||||||
|
hsetroot -cover "$HOME/Pictures/Backgrounds/default.jpg" &
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
|
0
vim/.gitignore → cvim/.gitignore
vendored
0
vim/.gitignore → cvim/.gitignore
vendored
0
vim/spell/.gitignore → cvim/spell/.gitignore
vendored
0
vim/spell/.gitignore → cvim/spell/.gitignore
vendored
0
vim/swap/.gitignore → cvim/swap/.gitignore
vendored
0
vim/swap/.gitignore → cvim/swap/.gitignore
vendored
0
vim/undo/.gitignore → cvim/undo/.gitignore
vendored
0
vim/undo/.gitignore → cvim/undo/.gitignore
vendored
0
vim/view/.gitignore → cvim/view/.gitignore
vendored
0
vim/view/.gitignore → cvim/view/.gitignore
vendored
213
cvim/vimrc
Normal file
213
cvim/vimrc
Normal file
|
@ -0,0 +1,213 @@
|
||||||
|
" XDG Specifications
|
||||||
|
let rtp=&runtimepath
|
||||||
|
set runtimepath=~/.config/cvim
|
||||||
|
let &runtimepath.=','.rtp.',~/.config/cvim/after'
|
||||||
|
set directory=~/.config/cvim/swap//,.,~/tmp,/var/tmp,/tmp
|
||||||
|
set backupdir=~/.config/cvim/backup//,.,~/tmp,~/
|
||||||
|
set spellfile=~/.config/cvim/spell/en.utf-8.add
|
||||||
|
set viminfo+=n~/.config/cvim/viminfo
|
||||||
|
set viewdir=~/.config/cvim/view/
|
||||||
|
set undodir=~/.config/cvim/undo//,.
|
||||||
|
|
||||||
|
" Preferences
|
||||||
|
let mapleader = "\<Space>"
|
||||||
|
set list listchars=tab:⎸\ ,trail:~
|
||||||
|
set clipboard=unnamedplus
|
||||||
|
set gp=git\ grep\ -n
|
||||||
|
set shellcmdflag=-c
|
||||||
|
set encoding=utf-8
|
||||||
|
set relativenumber
|
||||||
|
filetype plugin on
|
||||||
|
set shiftwidth=4
|
||||||
|
set nocompatible
|
||||||
|
set cursorline
|
||||||
|
set ignorecase
|
||||||
|
set smartcase
|
||||||
|
set expandtab
|
||||||
|
set autoread
|
||||||
|
set wildmenu
|
||||||
|
set hlsearch
|
||||||
|
set swapfile
|
||||||
|
set undofile
|
||||||
|
set mouse=a
|
||||||
|
set showcmd
|
||||||
|
set number
|
||||||
|
syntax on
|
||||||
|
|
||||||
|
if (empty($TMUX) && getenv('TERM_PROGRAM') != 'Apple_Terminal')
|
||||||
|
if (has("nvim"))
|
||||||
|
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
|
||||||
|
endif
|
||||||
|
if (has("termguicolors"))
|
||||||
|
set termguicolors
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Keybinds
|
||||||
|
noremap <F5> :setlocal spell! spelllang=en<CR>
|
||||||
|
noremap <F6> :setlocal spell! spelllang=es<CR>
|
||||||
|
noremap <F8> :TagbarToggle<CR>
|
||||||
|
noremap <C-e> !!$SHELL<CR>
|
||||||
|
noremap <tab> :bn<CR>
|
||||||
|
noremap <C-c> :bd<CR>
|
||||||
|
noremap <C-s> :w<CR>
|
||||||
|
noremap <A-h> 5<C-w><
|
||||||
|
noremap <A-j> 5<C-w>-
|
||||||
|
noremap <A-k> 5<C-w>+
|
||||||
|
noremap <A-l> 5<C-w>>
|
||||||
|
noremap H :nohl<CR>
|
||||||
|
noremap <leader><Space> za
|
||||||
|
|
||||||
|
autocmd BufWinLeave *.* mkview
|
||||||
|
|
||||||
|
" QuickFix
|
||||||
|
autocmd QuickFixCmdPost [^l]* nested cwindow
|
||||||
|
autocmd QuickFixCmdPost l* nested lwindow
|
||||||
|
autocmd QuickFixCmdPost * if &ft ==# 'qf' | wincmd J | endif
|
||||||
|
|
||||||
|
function! WrapQuickfixNext()
|
||||||
|
try
|
||||||
|
execute 'cnext'
|
||||||
|
catch /^Vim\%((\a\+)\)\=:E553/
|
||||||
|
cfirst
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
function! WrapQuickfixPrev()
|
||||||
|
try
|
||||||
|
execute 'cprevious'
|
||||||
|
catch /^Vim\%((\a\+)\)\=:E553/
|
||||||
|
clast
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
nnoremap <silent> <Leader>n :call WrapQuickfixNext()<CR>
|
||||||
|
nnoremap <silent> <Leader>p :call WrapQuickfixPrev()<CR>
|
||||||
|
nnoremap <leader>m :make<CR><CR>
|
||||||
|
nnoremap <F9> :make<CR><CR>
|
||||||
|
|
||||||
|
" c/c++
|
||||||
|
autocmd FileType c :compiler gcc | setlocal makeprg=gcc\ -Wall\ -c\ %
|
||||||
|
autocmd FileType cpp :compiler gcc | setlocal makeprg=g++\ -Wall\ -c\ %
|
||||||
|
|
||||||
|
" groff
|
||||||
|
autocmd FileType troff noremap <buffer> <silent> <F9> :!zathura --fork %:r.pdf<CR> & disown
|
||||||
|
autocmd FileType troff noremap <buffer> <C-s> :w<CR> :!grofftex %<CR><CR>
|
||||||
|
|
||||||
|
" Python
|
||||||
|
autocmd FileType python noremap <buffer> <F9> :!python %<CR>
|
||||||
|
|
||||||
|
function! SetMakeprg()
|
||||||
|
if filereadable('Makefile')
|
||||||
|
set makeprg=make
|
||||||
|
else
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
autocmd VimEnter * call SetMakeprg()
|
||||||
|
|
||||||
|
" Functions
|
||||||
|
|
||||||
|
"Open a shell on a vertical split
|
||||||
|
set splitright
|
||||||
|
function OpenTerminal()
|
||||||
|
execute "normal \<C-l>"
|
||||||
|
execute "normal \<C-l>"
|
||||||
|
execute "normal \<C-l>"
|
||||||
|
execute "normal \<C-l>"
|
||||||
|
|
||||||
|
let bufNum = bufnr("%")
|
||||||
|
let bufType = getbufvar(bufNum, "&buftype", "not found")
|
||||||
|
|
||||||
|
if bufType == "terminal"
|
||||||
|
execute "q"
|
||||||
|
else
|
||||||
|
execute "bot sp term://bash"
|
||||||
|
execute "resize -8"
|
||||||
|
execute "set nonu"
|
||||||
|
execute "set nornu"
|
||||||
|
silent au BufLeave <buffer> stopinsert!
|
||||||
|
silent au BufWinEnter,WinEnter <buffer> startinsert!
|
||||||
|
execute "tnoremap <buffer> <C-h> <C-\\><C-n><C-w><C-h>"
|
||||||
|
execute "tnoremap <buffer> <C-t> <C-\\><C-n>:q<CR>"
|
||||||
|
execute "tnoremap <buffer> <C-\\><C-\\> <C-\\><C-n>"
|
||||||
|
execute "IndentLinesDisable"
|
||||||
|
|
||||||
|
startinsert!
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
nnoremap <C-t> :call OpenTerminal()<CR>
|
||||||
|
|
||||||
|
" Plugins
|
||||||
|
if empty(glob('~/.config/cvim/autoload/plug.vim'))
|
||||||
|
silent !curl -fLo ~/.config/cvim/autoload/plug.vim --create-dirs
|
||||||
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
|
autocmd VimEnter * PlugInstall --sync | source '~/.config/cvim/vimrc'
|
||||||
|
endif
|
||||||
|
|
||||||
|
call plug#begin()
|
||||||
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
|
Plug 'norcalli/nvim-colorizer.lua'
|
||||||
|
Plug 'vim-scripts/AutoComplPop'
|
||||||
|
Plug 'vim-airline/vim-airline'
|
||||||
|
Plug 'ryanoasis/vim-devicons'
|
||||||
|
Plug 'airblade/vim-gitgutter'
|
||||||
|
Plug 'rhysd/vim-clang-format'
|
||||||
|
Plug 'jiangmiao/auto-pairs'
|
||||||
|
Plug 'tpope/vim-commentary'
|
||||||
|
Plug 'Yggdroot/indentLine'
|
||||||
|
Plug 'preservim/nerdtree'
|
||||||
|
Plug 'godlygeek/tabular'
|
||||||
|
Plug 'Gavinok/vim-troff'
|
||||||
|
Plug 'ibhagwan/fzf-lua'
|
||||||
|
Plug 'preservim/tagbar'
|
||||||
|
" Plug 'morhetz/gruvbox'
|
||||||
|
Plug 'sainnhe/gruvbox-material'
|
||||||
|
Plug 'jceb/vim-orgmode'
|
||||||
|
Plug 'mikelue/vim-maven-plugin'
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
" gruvbox-material
|
||||||
|
set background=dark
|
||||||
|
let g:gruvbox_material_background = 'hard'
|
||||||
|
colorscheme gruvbox-material
|
||||||
|
|
||||||
|
" AutoComplPop
|
||||||
|
inoremap <expr> <Tab> pumvisible() ? "<C-y>" : "<Tab>"
|
||||||
|
set completeopt=menuone,longest
|
||||||
|
set complete+=kspell
|
||||||
|
|
||||||
|
" Airline
|
||||||
|
let g:airline#extensions#tabline#buffer_min_count = 1
|
||||||
|
let g:airline#extensions#tabline#enabled = 1
|
||||||
|
let g:airline_powerline_fonts = 1
|
||||||
|
set ttimeout ttimeoutlen=0
|
||||||
|
set laststatus=2
|
||||||
|
set noshowmode
|
||||||
|
|
||||||
|
" NERDTree
|
||||||
|
nnoremap <C-f> :NERDTreeToggle<CR>
|
||||||
|
|
||||||
|
" IndentLine
|
||||||
|
let g:indentLine_enabled = 1
|
||||||
|
let g:indentLine_char = '⎸'
|
||||||
|
|
||||||
|
" fzf-lua
|
||||||
|
noremap <A-b> :FzfLua git_branches<CR>
|
||||||
|
noremap <A-c> :FzfLua git_commits<CR>
|
||||||
|
noremap <A-s> :FzfLua git_status<CR>
|
||||||
|
noremap <A-f> :FzfLua files<CR>
|
||||||
|
noremap gb :FzfLua git_branches<CR>
|
||||||
|
noremap gs :FzfLua git_status<CR>
|
||||||
|
noremap gf :FzfLua files<CR>
|
||||||
|
|
||||||
|
" git-gutter
|
||||||
|
highlight GitGutterChange guifg=#7daea3 ctermfg=3
|
||||||
|
highlight GitGutterDelete guifg=#ea6962 ctermfg=1
|
||||||
|
highlight GitGutterAdd guifg=#a9b665 ctermfg=2
|
||||||
|
highlight SignColumn guibg=NONE ctermbg=NONE
|
||||||
|
let g:gitgutter_set_sign_backgrounds = 1
|
||||||
|
noremap gd :GitGutterToggle<CR>
|
||||||
|
set signcolumn=yes
|
||||||
|
set updatetime=100
|
||||||
|
|
||||||
|
" vim-clang-format
|
||||||
|
let g:clang_format#code_style = 'llvm'
|
76
vim/vimrc
76
vim/vimrc
|
@ -135,79 +135,3 @@ function OpenTerminal()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
nnoremap <C-t> :call OpenTerminal()<CR>
|
nnoremap <C-t> :call OpenTerminal()<CR>
|
||||||
|
|
||||||
" Plugins
|
|
||||||
if empty(glob('~/.config/vim/autoload/plug.vim'))
|
|
||||||
silent !curl -fLo ~/.config/vim/autoload/plug.vim --create-dirs
|
|
||||||
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
||||||
autocmd VimEnter * PlugInstall --sync | source '~/.config/vim/vimrc'
|
|
||||||
endif
|
|
||||||
|
|
||||||
call plug#begin()
|
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
|
||||||
Plug 'norcalli/nvim-colorizer.lua'
|
|
||||||
Plug 'vim-scripts/AutoComplPop'
|
|
||||||
Plug 'vim-airline/vim-airline'
|
|
||||||
Plug 'ryanoasis/vim-devicons'
|
|
||||||
Plug 'airblade/vim-gitgutter'
|
|
||||||
Plug 'rhysd/vim-clang-format'
|
|
||||||
Plug 'jiangmiao/auto-pairs'
|
|
||||||
Plug 'tpope/vim-commentary'
|
|
||||||
Plug 'Yggdroot/indentLine'
|
|
||||||
Plug 'preservim/nerdtree'
|
|
||||||
Plug 'godlygeek/tabular'
|
|
||||||
Plug 'Gavinok/vim-troff'
|
|
||||||
Plug 'ibhagwan/fzf-lua'
|
|
||||||
Plug 'preservim/tagbar'
|
|
||||||
" Plug 'morhetz/gruvbox'
|
|
||||||
Plug 'sainnhe/gruvbox-material'
|
|
||||||
Plug 'jceb/vim-orgmode'
|
|
||||||
Plug 'mikelue/vim-maven-plugin'
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
" gruvbox-material
|
|
||||||
set background=dark
|
|
||||||
let g:gruvbox_material_background = 'hard'
|
|
||||||
colorscheme gruvbox-material
|
|
||||||
|
|
||||||
" AutoComplPop
|
|
||||||
inoremap <expr> <Tab> pumvisible() ? "<C-y>" : "<Tab>"
|
|
||||||
set completeopt=menuone,longest
|
|
||||||
set complete+=kspell
|
|
||||||
|
|
||||||
" Airline
|
|
||||||
let g:airline#extensions#tabline#buffer_min_count = 1
|
|
||||||
let g:airline#extensions#tabline#enabled = 1
|
|
||||||
let g:airline_powerline_fonts = 1
|
|
||||||
set ttimeout ttimeoutlen=0
|
|
||||||
set laststatus=2
|
|
||||||
set noshowmode
|
|
||||||
|
|
||||||
" NERDTree
|
|
||||||
nnoremap <C-f> :NERDTreeToggle<CR>
|
|
||||||
|
|
||||||
" IndentLine
|
|
||||||
let g:indentLine_enabled = 1
|
|
||||||
let g:indentLine_char = '⎸'
|
|
||||||
|
|
||||||
" fzf-lua
|
|
||||||
noremap <A-b> :FzfLua git_branches<CR>
|
|
||||||
noremap <A-c> :FzfLua git_commits<CR>
|
|
||||||
noremap <A-s> :FzfLua git_status<CR>
|
|
||||||
noremap <A-f> :FzfLua files<CR>
|
|
||||||
noremap gb :FzfLua git_branches<CR>
|
|
||||||
noremap gs :FzfLua git_status<CR>
|
|
||||||
noremap gf :FzfLua files<CR>
|
|
||||||
|
|
||||||
" git-gutter
|
|
||||||
highlight GitGutterChange guifg=#7daea3 ctermfg=3
|
|
||||||
highlight GitGutterDelete guifg=#ea6962 ctermfg=1
|
|
||||||
highlight GitGutterAdd guifg=#a9b665 ctermfg=2
|
|
||||||
highlight SignColumn guibg=NONE ctermbg=NONE
|
|
||||||
let g:gitgutter_set_sign_backgrounds = 1
|
|
||||||
noremap gd :GitGutterToggle<CR>
|
|
||||||
set signcolumn=yes
|
|
||||||
set updatetime=100
|
|
||||||
|
|
||||||
" vim-clang-format
|
|
||||||
let g:clang_format#code_style = 'llvm'
|
|
||||||
|
|
Loading…
Reference in a new issue