Преглед изворни кода

added more vscode integration

Chris пре 5 година
родитељ
комит
c9800a667d
6 измењених фајлова са 56 додато и 46 уклоњено
  1. 4 1
      general/settings.vim
  2. 14 13
      init.vim
  3. 11 4
      keys/mappings.vim
  4. 2 1
      plug-config/coc.vim
  5. 4 9
      plug-config/easymotion.vim
  6. 21 18
      vim-plug/plugins.vim

+ 4 - 1
general/settings.vim

@@ -1,5 +1,8 @@
 " set leader key
 " set leader key
-map <Space> <Leader>
+"map <Space> <Leader>
+"nmap <space> <leader>
+let mapleader=" "
+nnoremap <Space> <Nop>
 set iskeyword+=-                      	" treat dash separated words as a word text object"
 set iskeyword+=-                      	" treat dash separated words as a word text object"
 
 
 if !exists('g:vscode')
 if !exists('g:vscode')

+ 14 - 13
init.vim

@@ -10,22 +10,23 @@ source $HOME/.config/nvim/vim-plug/plugins.vim
 source $HOME/.config/nvim/general/settings.vim
 source $HOME/.config/nvim/general/settings.vim
 source $HOME/.config/nvim/keys/mappings.vim
 source $HOME/.config/nvim/keys/mappings.vim
 source $HOME/.config/nvim/general/paths.vim
 source $HOME/.config/nvim/general/paths.vim
-source $HOME/.config/nvim/plug-config/easymotion.vim
-source $HOME/.config/nvim/plug-config/quickscope.vim
 
 
 " Source depending on if VSCode is our client
 " Source depending on if VSCode is our client
 if exists('g:vscode')
 if exists('g:vscode')
     " VSCode extension
     " VSCode extension
-    source $HOME/.config/nvim/vscode/windows.vim
+  source $HOME/.config/nvim/vscode/windows.vim
+  source $HOME/.config/nvim/plug-config/easymotion.vim
 else
 else
-    " ordinary neovim
-    source $HOME/.config/nvim/themes/syntax.vim
-    source $HOME/.config/nvim/themes/onedark.vim
-    source $HOME/.config/nvim/themes/airline.vim
-    source $HOME/.config/nvim/plug-config/rnvimr.vim
-    source $HOME/.config/nvim/plug-config/fzf.vim
-    source $HOME/.config/nvim/plug-config/commentary.vim
-    source $HOME/.config/nvim/plug-config/rainbow.vim
-    lua require'plug-colorizer'
-    source $HOME/.config/nvim/plug-config/coc.vim
+  " ordinary neovim
+  source $HOME/.config/nvim/themes/syntax.vim
+  source $HOME/.config/nvim/themes/onedark.vim
+  source $HOME/.config/nvim/themes/airline.vim
+  source $HOME/.config/nvim/plug-config/rnvimr.vim
+  source $HOME/.config/nvim/plug-config/fzf.vim
+  source $HOME/.config/nvim/plug-config/commentary.vim
+  source $HOME/.config/nvim/plug-config/rainbow.vim
+  lua require'plug-colorizer'
+  source $HOME/.config/nvim/plug-config/coc.vim
+  source $HOME/.config/nvim/plug-config/sneak.vim
+  source $HOME/.config/nvim/plug-config/quickscope.vim
 endif
 endif

+ 11 - 4
keys/mappings.vim

@@ -1,5 +1,15 @@
 
 
-if !exists('g:vscode')
+" Better indenting
+vnoremap < <gv
+vnoremap > >gv
+
+if exists('g:vscode')
+
+" Simulate same TAB behavior in VSCode
+nmap <Tab> :Tabnext<CR>
+nmap <S-Tab> :Tabprev<CR>
+
+else
   " Better nav for omnicomplete
   " Better nav for omnicomplete
   inoremap <expr> <c-j> ("\<C-n>")
   inoremap <expr> <c-j> ("\<C-n>")
   inoremap <expr> <c-k> ("\<C-p>")
   inoremap <expr> <c-k> ("\<C-p>")
@@ -40,6 +50,3 @@ if !exists('g:vscode')
   nnoremap <M-l>    :vertical resize +2<CR>
   nnoremap <M-l>    :vertical resize +2<CR>
 endif
 endif
 
 
-" Better tabbing
-vnoremap < <gv
-vnoremap > >gv

+ 2 - 1
plug-config/coc.vim

@@ -135,6 +135,7 @@ let g:coc_explorer_global_presets = {
 \     'file.child.template': '[selection | clip | 1] [indent][icon | 1] [filename omitCenter 1]'
 \     'file.child.template': '[selection | clip | 1] [indent][icon | 1] [filename omitCenter 1]'
 \   }
 \   }
 \ }
 \ }
-nmap <silent> <space>e :CocCommand explorer<CR>
+"nmap <silent> <space>e :CocCommand explorer<CR>
+nnoremap <leader>e :CocCommand explorer<CR>
 nmap <space>f :CocCommand explorer --preset floatingRightside<CR>
 nmap <space>f :CocCommand explorer --preset floatingRightside<CR>
 autocmd BufEnter * if (winnr("$") == 1 && &filetype == 'coc-explorer') | q | endif
 autocmd BufEnter * if (winnr("$") == 1 && &filetype == 'coc-explorer') | q | endif

+ 4 - 9
plug-config/easymotion.vim

@@ -1,16 +1,11 @@
 let g:EasyMotion_do_mapping = 0 " Disable default mappings
 let g:EasyMotion_do_mapping = 0 " Disable default mappings
-
-" Jump to anywhere you want with minimal keystrokes, with just one key binding.
-" `s{char}{label}`
-nmap s <Plug>(easymotion-overwin-f)
-" or
-" `s{char}{char}{label}`
-" Need one more keystroke, but on average, it may be more comfortable.
-nmap s <Plug>(easymotion-overwin-f2)
-
 " Turn on case-insensitive feature
 " Turn on case-insensitive feature
 let g:EasyMotion_smartcase = 1
 let g:EasyMotion_smartcase = 1
 
 
 " JK motions: Line motions
 " JK motions: Line motions
 map <Leader>j <Plug>(easymotion-j)
 map <Leader>j <Plug>(easymotion-j)
 map <Leader>k <Plug>(easymotion-k)
 map <Leader>k <Plug>(easymotion-k)
+
+nmap s <Plug>(easymotion-s2)
+nmap t <Plug>(easymotion-t2)
+

+ 21 - 18
vim-plug/plugins.vim

@@ -8,14 +8,27 @@ endif
 
 
 call plug#begin('~/.config/nvim/autoload/plugged')
 call plug#begin('~/.config/nvim/autoload/plugged')
 
 
-  " Text Navigation
-  " Plug 'justinmk/vim-sneak'
-  Plug 'unblevable/quick-scope'
   " Change dates fast
   " Change dates fast
   Plug 'tpope/vim-speeddating'
   Plug 'tpope/vim-speeddating'
-  Plug 'asvetliakov/vim-easymotion'
+  " Convert binary, hex, etc..
+  Plug 'glts/vim-radical'
+  " Files
+  Plug 'tpope/vim-eunuch'
+  " Repeat stuff
+  Plug 'tpope/vim-repeat'
+  " Surround
+  Plug 'tpope/vim-surround'
+  " Better Comments
+  Plug 'tpope/vim-commentary'
 
 
-  if !exists('g:vscode')
+  if exists('g:vscode')
+    " Easy motion for VSCode
+    Plug 'asvetliakov/vim-easymotion'
+
+  else
+    " Add some color
+    Plug 'norcalli/nvim-colorizer.lua'
+    Plug 'junegunn/rainbow_parentheses.vim'
     " Better Syntax Support
     " Better Syntax Support
     Plug 'sheerun/vim-polyglot'
     Plug 'sheerun/vim-polyglot'
     " Auto pairs for '(' '[' '{' 
     " Auto pairs for '(' '[' '{' 
@@ -34,11 +47,6 @@ call plug#begin('~/.config/nvim/autoload/plugged')
     Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
     Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
     Plug 'junegunn/fzf.vim'
     Plug 'junegunn/fzf.vim'
     Plug 'airblade/vim-rooter'
     Plug 'airblade/vim-rooter'
-    " Better Comments
-    Plug 'tpope/vim-commentary'
-    " Add some color
-    Plug 'norcalli/nvim-colorizer.lua'
-    Plug 'junegunn/rainbow_parentheses.vim'
     " Git
     " Git
     Plug 'airblade/vim-gitgutter'
     Plug 'airblade/vim-gitgutter'
     Plug 'tpope/vim-fugitive'
     Plug 'tpope/vim-fugitive'
@@ -47,26 +55,21 @@ call plug#begin('~/.config/nvim/autoload/plugged')
     Plug 'voldikss/vim-floaterm'
     Plug 'voldikss/vim-floaterm'
     " Start Screen
     " Start Screen
     Plug 'mhinz/vim-startify'
     Plug 'mhinz/vim-startify'
-    " Surround
-    Plug 'tpope/vim-surround'
     " Vista
     " Vista
     Plug 'liuchengxu/vista.vim'
     Plug 'liuchengxu/vista.vim'
-    " Files
-    Plug 'tpope/vim-eunuch'
     " Help
     " Help
     Plug 'liuchengxu/vim-which-key'
     Plug 'liuchengxu/vim-which-key'
     " Zen mode
     " Zen mode
     Plug 'junegunn/goyo.vim'
     Plug 'junegunn/goyo.vim'
-    " Repeat stuff
-    Plug 'tpope/vim-repeat'
-    " Convert binary, hex, etc..
-    Plug 'glts/vim-radical'
     " Making stuff
     " Making stuff
     Plug 'neomake/neomake'
     Plug 'neomake/neomake'
     " Snippets TODO fix TAB hijack
     " Snippets TODO fix TAB hijack
     " Plug 'SirVer/ultisnips'
     " Plug 'SirVer/ultisnips'
     " Better Comments
     " Better Comments
     Plug 'jbgutierrez/vim-better-comments'
     Plug 'jbgutierrez/vim-better-comments'
+    " Text Navigation
+    Plug 'justinmk/vim-sneak'
+    Plug 'unblevable/quick-scope'
   endif
   endif