commit 836fc224824365367bcafca949982c21bae57679
parent 009bf4beb816c73cc7f592ea086c2c521a021486
Author: bharatvaj.ph <bharatvaj@yahoo.com>
Date: Tue, 31 Aug 2021 04:07:14 +0530
Cleaned up vim files
Diffstat:
7 files changed, 76 insertions(+), 36 deletions(-)
diff --git a/.config/.gitignore b/.config/.gitignore
@@ -3,13 +3,13 @@
!.gitignore
!alacritty/
-!alacritty/*
+!alacritty/**
!bash/
-!bash/*
+!bash/**
!i3
!nvim
!vim/
-!vim/*
+!vim/**
!X11
!wgetrc
!user-dirs.dirs
diff --git a/.config/vim/keybindings/keybindings.vim b/.config/vim/keybindings/keybindings.vim
@@ -0,0 +1,7 @@
+" General keybindings
+nnoremap <leader>t :tabnew<cr>
+nnoremap <leader>p :Rg<cr>
+
+" Plugin keybindings
+source $XDG_CONFIG_HOME/vim/keybindings/vimspector.vim
+source $XDG_CONFIG_HOME/vim/keybindings/markdown.vim
diff --git a/.config/vim/keybindings/markdown.vim b/.config/vim/keybindings/markdown.vim
@@ -0,0 +1,4 @@
+autocmd FileType markdown set cursorline
+
+" Hide and format markdown elements like **bold**
+autocmd FileType markdown set conceallevel=2
diff --git a/.config/vim/keybindings/vimspector.vim b/.config/vim/keybindings/vimspector.vim
@@ -0,0 +1,25 @@
+fun! GotoWindow(id)
+ call win_gotoid(a:id)
+endfun
+
+" Debugger remaps
+nnoremap <leader>dd :call vimspector#Launch()<CR>
+nnoremap <leader>dc :call GotoWindow(g:vimspector_session_windows.code)<CR>
+nnoremap <leader>dt :call GotoWindow(g:vimspector_session_windows.tagpage)<CR>
+nnoremap <leader>dv :call GotoWindow(g:vimspector_session_windows.variables)<CR>
+nnoremap <leader>dw :call GotoWindow(g:vimspector_session_windows.watches)<CR>
+nnoremap <leader>ds :call GotoWindow(g:vimspector_session_windows.stack_trace)<CR>
+nnoremap <leader>do :call GotoWindow(g:vimspector_session_windows.output)<CR>
+nnoremap <leader>de :call vimspector#Reset()<CR>
+
+nnoremap <leader>dtcb :call vimspector#CleanLineBreakpoint()<CR>
+
+nmap <leader>dl <Plug>VimspectorStepInto
+nmap <leader>dj <Plug>VimspectorStepOver
+nmap <leader>dk <Plug>VimspectorStepOut
+nmap <leader>d_ <Plug>VimspectorRestart
+nnoremap <leader>d<space> :call vimspector#Continue()<CR>
+
+nmap <leader>drc <Plug>VimspectorRunToCursor
+nmap <leader>dbp <Plug>VimspectorToggleBreakpoint
+nmap <leader>dcbp <Plug>VimspectorToggleConditionalBreakpoint
diff --git a/.config/vim/plugin/development.vim b/.config/vim/plugin/development.vim
@@ -0,0 +1,5 @@
+Plug 'editorconfig/editorconfig-vim'
+Plug 'cdelledonne/vim-cmake'
+Plug 'puremourning/vimspector'
+Plug 'vim-syntastic/syntastic'
+Plug 'rust-lang/rust.vim'
diff --git a/.config/vim/plugin/plugin.vim b/.config/vim/plugin/plugin.vim
@@ -0,0 +1,24 @@
+" Plugin Management
+let data_dir = has('nvim') ? stdpath('data') . '/site' : "${XDG_DATA_HOME}/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'
+ autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
+endif
+
+call plug#begin($XDG_DATA_HOME."/vim/plugged")
+ Plug 'tpope/vim-commentary'
+ Plug 'tpope/vim-surround'
+ Plug 'itchyny/lightline.vim'
+ Plug 'tpope/vim-fugitive'
+ Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
+ Plug 'junegunn/fzf.vim'
+ source $XDG_CONFIG_HOME/vim/plugin/development.vim
+call plug#end()
+
+" Plugin Keybindings
+
+" fzf
+nmap <leader>F :GFAll<cr>
+nmap <leader>f :Files<cr>
+
+nnoremap <leader>cc :ChecklistToggleCheckbox<cr>
diff --git a/.config/vim/vimrc b/.config/vim/vimrc
@@ -61,36 +61,11 @@ for key in ['<Up>', '<Down>', '<Left>', '<Right>']
exec 'cnoremap' key '<Nop>'
endfor
-" Plugin Management
-"let data_dir = has('nvim') ? stdpath('data') . '/site' : "${XDG_DATA_HOME}/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'
-" autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
-"endif
-call plug#begin($XDG_DATA_HOME."/vim/plugged")
- Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
- Plug 'junegunn/fzf.vim'
- Plug 'cdelledonne/vim-cmake'
- Plug 'editorconfig/editorconfig-vim'
- Plug 'tpope/vim-fugitive'
- Plug 'tpope/vim-surround'
- Plug 'tpope/vim-commentary'
- Plug 'itchyny/lightline.vim'
-call plug#end()
-
-" Plugin customizations
-" fzf
-" BUG remove bashism
-" TODO - Files are repeated twice in some cases
-command! GFAll call fzf#run(fzf#wrap({'source': "comm <(git ls-files --exclude-standard --cached --cached --recurse-submodules) <(git ls-files --exclude-standard --cached --others) | awk '{$1=$1;print}'"}))
-
-" Plugin Keybindings
-nmap <leader>f :GFAll<cr>
-nmap <leader>F :Files<cr>
-nnoremap <leader>t :tabnew<cr>
-nnoremap <leader>p :Rg<cr>
-nnoremap <leader>s :source ~/.config/vim/vimrc<cr>
-nnoremap <leader>cc :ChecklistToggleCheckbox<cr>
-
-" Theming Begin
-" Theming End
+
+
+" Plugins
+source $XDG_CONFIG_HOME/vim/plugin/plugin.vim
+
+" Keybindings
+source $XDG_CONFIG_HOME/vim/keybindings/keybindings.vim
+