Chris 5 سال پیش
والد
کامیت
4075f40f45
9فایلهای تغییر یافته به همراه75 افزوده شده و 165 حذف شده
  1. 1 1
      coc-settings.json
  2. 2 2
      init.vim
  3. 0 2
      modules/ctrlp.vim
  4. 0 125
      modules/denite.vim
  5. 63 0
      modules/fzf.vim
  6. 5 14
      modules/plugins.vim
  7. 1 0
      modules/relativenums.vim
  8. 0 19
      modules/test.vim
  9. 3 2
      modules/vim-which-key.vim

+ 1 - 1
coc-settings.json

@@ -1,3 +1,3 @@
 {
-  "coc.preferences.formatOnSaveFiletypes": ["css", "markdown", "javascript"]
+  "coc.preferences.formatOnSaveFiletypes": ["css", "markdown", "javascript", "graphql", "html", "yaml"]
 }

+ 2 - 2
init.vim

@@ -2,7 +2,7 @@
 source $HOME/.config/nvim/modules/pythonpath.vim " Eventually move to pyenv/virtualenv
 source $HOME/.config/nvim/modules/nodepath.vim " Make sure to set version here
 source $HOME/.config/nvim/modules/plugins.vim
-"source $HOME/.config/nvim/modules/denite.vim
+source $HOME/.config/nvim/modules/fzf.vim
 source $HOME/.config/nvim/modules/general.vim
 source $HOME/.config/nvim/modules/theme.vim
 source $HOME/.config/nvim/modules/airline.vim
@@ -24,4 +24,4 @@ source $HOME/.config/nvim/modules/rainbow.vim
 source $HOME/.config/nvim/modules/vim-which-key.vim
 source $HOME/.config/nvim/modules/echodoc.vim
 " Special test file "
-source $HOME/.config/nvim/modules/test.vim
+"source $HOME/.config/nvim/modules/test.vim

+ 0 - 2
modules/ctrlp.vim

@@ -1,2 +0,0 @@
-let g:ctrlp_map = '<c-p>'
-let g:ctrlp_cmd = 'CtrlP'

+ 0 - 125
modules/denite.vim

@@ -1,125 +0,0 @@
-" === Denite setup ==="
-" Use ripgrep for searching current directory for files
-" By default, ripgrep will respect rules in .gitignore
-"   --files: Print each file that would be searched (but don't search)
-"   --glob:  Include or exclues files for searching that match the given glob
-"            (aka ignore .git files)
-"
-call denite#custom#var('file/rec', 'command', ['rg', '--files', '--glob', '!.git'])
-
-" Use ripgrep in place of "grep"
-call denite#custom#var('grep', 'command', ['rg'])
-
-" Custom options for ripgrep
-"   --vimgrep:  Show results with every match on it's own line
-"   --hidden:   Search hidden directories and files
-"   --heading:  Show the file name above clusters of matches from each file
-"   --S:        Search case insensitively if the pattern is all lowercase
-call denite#custom#var('grep', 'default_opts', ['--hidden', '--vimgrep', '--heading', '-S'])
-
-" Recommended defaults for ripgrep via Denite docs
-call denite#custom#var('grep', 'recursive_opts', [])
-call denite#custom#var('grep', 'pattern_opt', ['--regexp'])
-call denite#custom#var('grep', 'separator', ['--'])
-call denite#custom#var('grep', 'final_opts', [])
-
-" Remove date from buffer list
-call denite#custom#var('buffer', 'date_format', '')
-
-" Custom options for Denite
-"   auto_resize             - Auto resize the Denite window height automatically.
-"   prompt                  - Customize denite prompt
-"   direction               - Specify Denite window direction as directly below current pane
-"   winminheight            - Specify min height for Denite window
-"   highlight_mode_insert   - Specify h1-CursorLine in insert mode
-"   prompt_highlight        - Specify color of prompt
-"   highlight_matched_char  - Matched characters highlight
-"   highlight_matched_range - matched range highlight
-let s:denite_options = {'default' : {
-\ 'split': 'floating',
-\ 'start_filter': 1,
-\ 'auto_resize': 1,
-\ 'source_names': 'short',
-\ 'prompt': 'λ ',
-\ 'highlight_matched_char': 'QuickFixLine',
-\ 'highlight_matched_range': 'Visual',
-\ 'highlight_window_background': 'Visual',
-\ 'highlight_filter_background': 'DiffAdd',
-\ 'winrow': 1,
-\ 'vertical_preview': 1
-\ }}
-
-" Loop through denite options and enable them
-function! s:profile(opts) abort
-  for l:fname in keys(a:opts)
-    for l:dopt in keys(a:opts[l:fname])
-      call denite#custom#option(l:fname, l:dopt, a:opts[l:fname][l:dopt])
-    endfor
-  endfor
-endfunction
-
-call s:profile(s:denite_options)
-  echo 'Denite not installed. It should work after running :PlugInstall'
-
-nmap ; :Denite buffer<CR>
-nmap <leader>t :DeniteProjectDir file/rec<CR>
-nnoremap <leader>g :<C-u>Denite grep:. -no-empty<CR>
-nnoremap <leader>j :<C-u>DeniteCursorWord grep:.<CR>
-
-" Define mappings while in 'filter' mode
-"   <C-o>         - Switch to normal mode inside of search results
-"   <Esc>         - Exit denite window in any mode
-"   <CR>          - Open currently selected file in any mode
-"   <C-t>         - Open currently selected file in a new tab
-"   <C-v>         - Open currently selected file a vertical split
-"   <C-h>         - Open currently selected file in a horizontal split
-autocmd FileType denite-filter call s:denite_filter_my_settings()
-function! s:denite_filter_my_settings() abort
-  imap <silent><buffer> <C-o>
-  \ <Plug>(denite_filter_quit)
-  inoremap <silent><buffer><expr> <Esc>
-  \ denite#do_map('quit')
-  nnoremap <silent><buffer><expr> <Esc>
-  \ denite#do_map('quit')
-  inoremap <silent><buffer><expr> <CR>
-  \ denite#do_map('do_action')
-  inoremap <silent><buffer><expr> <C-t>
-  \ denite#do_map('do_action', 'tabopen')
-  inoremap <silent><buffer><expr> <C-v>
-  \ denite#do_map('do_action', 'vsplit')
-  inoremap <silent><buffer><expr> <C-h>
-  \ denite#do_map('do_action', 'split')
-endfunction
-
-" Define mappings while in denite window
-"   <CR>        - Opens currently selected file
-"   q or <Esc>  - Quit Denite window
-"   d           - Delete currenly selected file
-"   p           - Preview currently selected file
-"   <C-o> or i  - Switch to insert mode inside of filter prompt
-"   <C-t>       - Open currently selected file in a new tab
-"   <C-v>       - Open currently selected file a vertical split
-"   <C-h>       - Open currently selected file in a horizontal split
-autocmd FileType denite call s:denite_my_settings()
-function! s:denite_my_settings() abort
-  nnoremap <silent><buffer><expr> <CR>
-  \ denite#do_map('do_action')
-  nnoremap <silent><buffer><expr> q
-  \ denite#do_map('quit')
-  nnoremap <silent><buffer><expr> <Esc>
-  \ denite#do_map('quit')
-  nnoremap <silent><buffer><expr> d
-  \ denite#do_map('do_action', 'delete')
-  nnoremap <silent><buffer><expr> p
-  \ denite#do_map('do_action', 'preview')
-  nnoremap <silent><buffer><expr> i
-  \ denite#do_map('open_filter_buffer')
-  nnoremap <silent><buffer><expr> <C-o>
-  \ denite#do_map('open_filter_buffer')
-  nnoremap <silent><buffer><expr> <C-t>
-  \ denite#do_map('do_action', 'tabopen')
-  nnoremap <silent><buffer><expr> <C-v>
-  \ denite#do_map('do_action', 'vsplit')
-  nnoremap <silent><buffer><expr> <C-h>
-  \ denite#do_map('do_action', 'split')
-endfunction

+ 63 - 0
modules/fzf.vim

@@ -0,0 +1,63 @@
+" This is the default extra key bindings
+let g:fzf_action = {
+  \ 'ctrl-t': 'tab split',
+  \ 'ctrl-x': 'split',
+  \ 'ctrl-v': 'vsplit' }
+
+" An action can be a reference to a function that processes selected lines
+function! s:build_quickfix_list(lines)
+  call setqflist(map(copy(a:lines), '{ "filename": v:val }'))
+  copen
+  cc
+endfunction
+
+let g:fzf_action = {
+  \ 'ctrl-q': function('s:build_quickfix_list'),
+  \ 'ctrl-t': 'tab split',
+  \ 'ctrl-x': 'split',
+  \ 'ctrl-v': 'vsplit' }
+
+" Default fzf layout
+" - down / up / left / right
+let g:fzf_layout = { 'down': '~40%' }
+
+" You can set up fzf window using a Vim command (Neovim or latest Vim 8 required)
+let g:fzf_layout = { 'window': 'enew' }
+let g:fzf_layout = { 'window': '-tabnew' }
+let g:fzf_layout = { 'window': '10new' }
+
+" Customize fzf colors to match your color scheme
+" - fzf#wrap translates this to a set of `--color` options
+let g:fzf_colors =
+\ { 'fg':      ['fg', 'Normal'],
+  \ 'bg':      ['bg', 'Normal'],
+  \ 'hl':      ['fg', 'Comment'],
+  \ 'fg+':     ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
+  \ 'bg+':     ['bg', 'CursorLine', 'CursorColumn'],
+  \ 'hl+':     ['fg', 'Statement'],
+  \ 'info':    ['fg', 'PreProc'],
+  \ 'border':  ['fg', 'Ignore'],
+  \ 'prompt':  ['fg', 'Conditional'],
+  \ 'pointer': ['fg', 'Exception'],
+  \ 'marker':  ['fg', 'Keyword'],
+  \ 'spinner': ['fg', 'Label'],
+  \ 'header':  ['fg', 'Comment'] }
+
+" Enable per-command history
+" - History files will be stored in the specified directory
+" - When set, CTRL-N and CTRL-P will be bound to 'next-history' and
+"   'previous-history' instead of 'down' and 'up'.
+"let g:fzf_history_dir = '~/.local/share/fzf-history'
+
+if has('nvim') && !exists('g:fzf_layout')
+  autocmd! FileType fzf
+  autocmd  FileType fzf set laststatus=0 noshowmode noruler
+    \| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
+endif
+
+if has("nvim")
+  au TermOpen * tnoremap <Esc> <c-\><c-n>
+  au FileType fzf tunmap <Esc>
+endif
+
+nnoremap <C-p> :FZF<CR>

+ 5 - 14
modules/plugins.vim

@@ -12,14 +12,15 @@ if dein#load_state('~/.config/nvim/dein')
   "call dein#add('kevinhwang91/rnvimr', {'do': 'make sync'})
   call dein#add('francoiscabrol/ranger.vim')
   call dein#add('rbgrouleff/bclose.vim')
+  " Fuzzy finder
+  call dein#add('junegunn/fzf')
   " Language support
   call dein#add('neoclide/coc.nvim', {'merged':0, 'rev': 'release'})
   " All the Themes
   call dein#add('joshdick/onedark.vim')
+  call dein#add('HerringtonDarkholme/yats.vim')
   " key menu popup "
   call dein#add('liuchengxu/vim-which-key')
-  "Interface"
-  call dein#add('Shougo/denite.nvim')
   "  Neoterm
   call dein#add('kassio/neoterm')
   " Running tests in vim "
@@ -47,19 +48,9 @@ if dein#load_state('~/.config/nvim/dein')
   call dein#add('majutsushi/tagbar')
   " Auto Pairs
   call dein#add('jiangmiao/auto-pairs')
-  " Buffergator use \b
-""  call dein#add('jeetsukumaran/vim-buffergator')
-  " Ctrlp 
-  "call dein#add('ctrlpvim/ctrlp.vim')
+  call dein#add('christoomey/vim-tmux-navigator')
   "Linting 
-  call dein#add('w0rp/ale') 
-  call dein#add('autozimu/LanguageClient-neovim', {
-    \ 'rev': 'next',
-    \ 'build': 'bash install.sh',
-    \ })
-  " Fuzzy finder
-  "call dein#add('junegunn/fzf.vim',  { 'dir': '~/.fzf', 'do': './install --all' })
-  "call dein#add('junegunn/fzf')
+  "call dein#add('w0rp/ale') 
   " Sneak mode "
   call dein#add('justinmk/vim-sneak')
   ""Git

+ 1 - 0
modules/relativenums.vim

@@ -1,3 +1,4 @@
+set relativenumber
 function! NumberToggle()
   if(&relativenumber == 1)
     set number

+ 0 - 19
modules/test.vim

@@ -1,19 +0,0 @@
-"Place for me to test things"
-
-let s:menus = {}
-let s:menus.denite = { 'description': 'denite commands' }
-let s:menus.denite.command_candidates = [
-\ ['> file_rec',          'Denite file_rec'],
-\ ['> file_mru',          'Denite file_mru'],
-\ ]
-
-call denite#custom#var('menu', 'menus', s:menus)
-
-function Command ()
-    set wrap
-    set nobuflisted
-    :pedit ~/.config/nvim/commands/leadercommands.txt
-    
-endfunction
- 
-nmap <silent>  <C-B>  :call SaveBackup()<CR>

+ 3 - 2
modules/vim-which-key.vim

@@ -30,12 +30,13 @@ nnoremap <silent> <leader>bashrc :call OpenConfigFile('~/.bashrc')<cr>
 nnoremap <silent> <leader>code :call OpenConfigFile('~/Library/Application Support/Code/User/settings.json')<cr>
 
 let g:which_key_map['/'] = [ '<Plug>NERDCommenterToggle','commenter' ]
+let g:which_key_map['e'] = [ 'NERDTreeToggle', 'file-explorer' ]           
 let g:which_key_map['p'] = [ 'pclose','close-preview' ]
 let g:which_key_map['q'] = [ 'q','quit' ]
 let g:which_key_map['d'] = [ 'bd','delete-buffer' ]
 let g:which_key_map['s'] = [ 'w','save' ]
-"let g:which_key_map['f'] = [ 'Denite file','files' ]
-let g:which_key_map['f'] = [ 'Ranger','Ranger' ]
+let g:which_key_map['r'] = [ 'Ranger','ranger' ]
+let g:which_key_map['f'] = [ 'FZF','fzf' ]
 
 let g:which_key_map.t = {
       \ 'name' : '+toggle' ,