Przeglądaj źródła

added new plugins

Chris 5 lat temu
rodzic
commit
793766232b

+ 9 - 3
README.md

@@ -124,23 +124,29 @@ Example:
   }
   ```
 
+## TabNine
+
+To use tabnine enter the following in a buffer:
+
+```
+TabNine::config
+```
+
 ## TODO
 
 - async task/run
 - vimspector
-- markdown preview
-- neomake
 - ale
 - multiple cursors
 - git messenger
 - markdown table
 - spaceline (add colorscheme for mach 2)
-- add better whitespace plugin and a toggle
 - People asked about vimwiki I kinda hate it but maybe I'll add it
 - neovide
 - move coc to coc.old in install script
 - later manually link pylance
 - lazynpm for floaterm
+- tpope/vim-dadbod
 
 ## coc additions to check out
 

+ 3 - 0
init.vim

@@ -44,6 +44,9 @@ else
   source $HOME/.config/nvim/plug-config/tagalong.vim
   source $HOME/.config/nvim/plug-config/illuminate.vim
   source $HOME/.config/nvim/plug-config/bracey.vim
+  source $HOME/.config/nvim/plug-config/asynctask.vim
+  source $HOME/.config/nvim/plug-config/window-swap.vim
+  source $HOME/.config/nvim/plug-config/markdown-preview.vim
   luafile $HOME/.config/nvim/lua/plug-colorizer.lua
 endif
 

+ 22 - 18
keys/which-key.vim

@@ -25,23 +25,24 @@ autocmd  FileType which_key set laststatus=0 noshowmode noruler
 
 
 " Single mappings
-let g:which_key_map['/'] = [ ':call Comment()'            , 'comment' ]
-let g:which_key_map['.'] = [ ':e $MYVIMRC'                , 'open init' ]
-let g:which_key_map[';'] = [ ':Commands'                  , 'commands' ]
-let g:which_key_map['='] = [ '<C-W>='                     , 'balance windows' ]
-let g:which_key_map[','] = [ 'Startify'                   , 'start screen' ]
-let g:which_key_map['d'] = [ ':bd'                        , 'delete buffer']
-let g:which_key_map['e'] = [ ':CocCommand explorer'       , 'explorer' ]
-let g:which_key_map['f'] = [ ':Farr'                      , 'find and replace' ]
-let g:which_key_map['h'] = [ '<C-W>s'                     , 'split below']
-let g:which_key_map['p'] = [ ':Files'                     , 'search files' ]
-let g:which_key_map['q'] = [ 'q'                          , 'quit' ]
-let g:which_key_map['r'] = [ ':RnvimrToggle'              , 'ranger' ]
-let g:which_key_map['S'] = [ ':SSave'                     , 'save session' ]
-let g:which_key_map['u'] = [ ':UndotreeToggle'            , 'undo tree']
-let g:which_key_map['v'] = [ '<C-W>v'                     , 'split right']
-let g:which_key_map['W'] = [ 'w'                          , 'write' ]
-let g:which_key_map['z'] = [ 'Goyo'                       , 'zen' ]
+let g:which_key_map['/'] = [ ':call Comment()'                    , 'comment' ]
+let g:which_key_map['.'] = [ ':e $MYVIMRC'                        , 'open init' ]
+let g:which_key_map[';'] = [ ':Commands'                          , 'commands' ]
+let g:which_key_map['='] = [ '<C-W>='                             , 'balance windows' ]
+let g:which_key_map[','] = [ 'Startify'                           , 'start screen' ]
+let g:which_key_map['d'] = [ ':bd'                                , 'delete buffer']
+let g:which_key_map['e'] = [ ':CocCommand explorer'               , 'explorer' ]
+let g:which_key_map['f'] = [ ':Farr'                              , 'find and replace' ]
+let g:which_key_map['h'] = [ '<C-W>s'                             , 'split below']
+let g:which_key_map['m'] = [ ':call WindowSwap#EasyWindowSwap()'  , 'move window' ]
+let g:which_key_map['p'] = [ ':Files'                             , 'search files' ]
+let g:which_key_map['q'] = [ 'q'                                  , 'quit' ]
+let g:which_key_map['r'] = [ ':RnvimrToggle'                      , 'ranger' ]
+let g:which_key_map['S'] = [ ':SSave'                             , 'save session' ]
+let g:which_key_map['u'] = [ ':UndotreeToggle'                    , 'undo tree']
+let g:which_key_map['v'] = [ '<C-W>v'                             , 'split right']
+let g:which_key_map['W'] = [ 'w'                                  , 'write' ]
+let g:which_key_map['z'] = [ 'Goyo'                               , 'zen' ]
 
 " Group mappings
 
@@ -52,12 +53,15 @@ let g:which_key_map.a = {
       \ 'e' : [':CocCommand explorer'    , 'explorer'],
       \ 'l' : [':Bracey'                 , 'start live server'],
       \ 'L' : [':BraceyStop'             , 'stop live server'],
+      \ 'm' : [':MarkdownPreview'        , 'markdown preview'],
+      \ 'M' : [':MarkdownPreviewStop'    , 'markdown preview stop'],
       \ 'n' : [':set nonumber!'          , 'line-numbers'],
       \ 'r' : [':set norelativenumber!'  , 'relative line nums'],
       \ 's' : [':let @/ = ""'            , 'remove search highlight'],
       \ 't' : [':FloatermToggle'         , 'terminal'],
       \ 'v' : [':Codi'                   , 'virtual repl on'],
       \ 'V' : [':Codi!'                  , 'virtual repl off'],
+      \ 'w' : [':StripWhitespace'        , 'strip whitespace'],
       \ }
 
 " b is for buffer
@@ -125,7 +129,7 @@ let g:which_key_map.g = {
       \ 'P' : [':Git pull'                         , 'pull'],
       \ 'r' : [':GRemove'                          , 'remove'],
       \ 's' : ['<Plug>(GitGutterStageHunk)'        , 'stage hunk'],
-      \ 'S' : [':!git status'                       , 'status'],
+      \ 'S' : [':!git status'                      , 'status'],
       \ 't' : [':GitGutterSignsToggle'             , 'toggle signs'],
       \ 'u' : ['<Plug>(GitGutterUndoHunk)'         , 'undo hunk'],
       \ 'v' : [':GV'                               , 'view commits'],

+ 1 - 0
plug-config/asynctask.vim

@@ -0,0 +1 @@
+let g:asyncrun_open = 6

+ 1 - 0
plug-config/coc.vim

@@ -21,6 +21,7 @@
     \ 'coc-yank',
     \ 'coc-json',
     \ 'coc-marketplace',
+    \ 'coc-tabnine',
     \ ]
 
 " Use tab for trigger completion with characters ahead and navigate.

+ 84 - 0
plug-config/markdown-preview.vim

@@ -0,0 +1,84 @@
+" set to 1, nvim will open the preview window after entering the markdown buffer
+" default: 0
+let g:mkdp_auto_start = 0
+
+" set to 1, the nvim will auto close current preview window when change
+" from markdown buffer to another buffer
+" default: 1
+let g:mkdp_auto_close = 0
+
+" set to 1, the vim will refresh markdown when save the buffer or
+" leave from insert mode, default 0 is auto refresh markdown as you edit or
+" move the cursor
+" default: 0
+let g:mkdp_refresh_slow = 0
+
+" set to 1, the MarkdownPreview command can be use for all files,
+" by default it can be use in markdown file
+" default: 0
+let g:mkdp_command_for_global = 0
+
+" set to 1, preview server available to others in your network
+" by default, the server listens on localhost (127.0.0.1)
+" default: 0
+let g:mkdp_open_to_the_world = 1
+
+" use custom IP to open preview page
+" useful when you work in remote vim and preview on local browser
+" more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9
+" default empty
+let g:mkdp_open_ip = ''
+
+" specify browser to open preview page
+" default: ''
+let g:mkdp_browser = ''
+
+" set to 1, echo preview page url in command line when open preview page
+" default is 0
+let g:mkdp_echo_preview_url = 0
+
+" a custom vim function name to open preview page
+" this function will receive url as param
+" default is empty
+let g:mkdp_browserfunc = ''
+
+" options for markdown render
+" mkit: markdown-it options for render
+" katex: katex options for math
+" uml: markdown-it-plantuml options
+" maid: mermaid options
+" disable_sync_scroll: if disable sync scroll, default 0
+" sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle'
+"   middle: mean the cursor position alway show at the middle of the preview page
+"   top: mean the vim top viewport alway show at the top of the preview page
+"   relative: mean the cursor position alway show at the relative positon of the preview page
+" hide_yaml_meta: if hide yaml metadata, default is 1
+" sequence_diagrams: js-sequence-diagrams options
+" content_editable: if enable content editable for preview page, default: v:false
+let g:mkdp_preview_options = {
+    \ 'mkit': {},
+    \ 'katex': {},
+    \ 'uml': {},
+    \ 'maid': {},
+    \ 'disable_sync_scroll': 0,
+    \ 'sync_scroll_type': 'middle',
+    \ 'hide_yaml_meta': 1,
+    \ 'sequence_diagrams': {},
+    \ 'flowchart_diagrams': {},
+    \ 'content_editable': v:false
+    \ }
+
+" use a custom markdown style must be absolute path
+" like '/Users/username/markdown.css' or expand('~/markdown.css')
+let g:mkdp_markdown_css = ''
+
+" use a custom highlight style must absolute path
+" like '/Users/username/highlight.css' or expand('~/highlight.css')
+let g:mkdp_highlight_css = ''
+
+" use a custom port to start server or random for empty
+let g:mkdp_port = ''
+
+" preview page title
+" ${name} will be replace with the file name
+let g:mkdp_page_title = '「${name}」'

+ 1 - 0
plug-config/window-swap.vim

@@ -0,0 +1 @@
+let g:windowswap_map_keys = 0 "prevent default bindings

+ 30 - 20
vim-plug/plugins.vim

@@ -38,11 +38,8 @@ call plug#begin('~/.config/nvim/autoload/plugged')
     " Text Navigation
     Plug 'justinmk/vim-sneak'
     Plug 'unblevable/quick-scope'
-    " Plug 'easymotion/vim-easymotion'
     " Add some color
     Plug 'norcalli/nvim-colorizer.lua'
-    " Plug 'junegunn/rainbow_parentheses.vim'
-
     Plug 'luochen1990/rainbow'
     " Better Syntax Support
     Plug 'sheerun/vim-polyglot'
@@ -54,24 +51,15 @@ call plug#begin('~/.config/nvim/autoload/plugged')
     Plug 'alvan/vim-closetag'
     " Themes
     Plug 'christianchiarulli/onedark.vim'
-    " Plug 'kaicataldo/material.vim'
-    " Plug 'NLKNguyen/papercolor-theme'
-    " Plug 'tomasiser/vim-code-dark'
     " Intellisense
     Plug 'neoclide/coc.nvim', {'branch': 'release'}
     " Status Line
     Plug 'vim-airline/vim-airline'
-    " Plug 'hardcoreplayers/spaceline.vim'
-    " Plug 'vim-airline/vim-airline-themes'
-    " Ranger
-    " Plug 'francoiscabrol/ranger.vim'
-    " Plug 'rbgrouleff/bclose.vim'
     Plug 'kevinhwang91/rnvimr', {'do': 'make sync'}
     " FZF
     Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
     Plug 'junegunn/fzf.vim'
     " Git
-    " Plug 'mhinz/vim-signify'
     Plug 'airblade/vim-gitgutter'
     Plug 'tpope/vim-fugitive'
     Plug 'tpope/vim-rhubarb'
@@ -86,19 +74,11 @@ call plug#begin('~/.config/nvim/autoload/plugged')
     Plug 'liuchengxu/vim-which-key'
     " Zen mode
     Plug 'junegunn/goyo.vim'
-    " Making stuff
-    Plug 'neomake/neomake'
     " Snippets
     Plug 'honza/vim-snippets'
     Plug 'mattn/emmet-vim'
-    " Better Comments
-    " Plug 'jbgutierrez/vim-better-comments'
-    " Echo doc
-    " Plug 'Shougo/echodoc.vim'
     " Interactive code
     Plug 'metakirby5/codi.vim'
-    " Vim Wiki
-    " Plug 'https://github.com/vimwiki/vimwiki.git'
     " Debugging
     Plug 'puremourning/vimspector'
     " Better tabline
@@ -115,6 +95,36 @@ call plug#begin('~/.config/nvim/autoload/plugged')
     Plug 'turbio/bracey.vim'
     " Typescript syntax
     Plug 'HerringtonDarkholme/yats.vim'
+    " Smooth scroll
+    Plug 'psliwka/vim-smoothie'
+    " asynt tasks
+    Plug 'skywind3000/asynctasks.vim'
+    Plug 'skywind3000/asyncrun.vim'
+    " Swap windows
+    Plug 'wesQ3/vim-windowswap'
+    " Markdown Preview
+    Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & npm install'  }
+    " Better Whitespace
+    Plug 'ntpeters/vim-better-whitespace'
+    " Plugin Graveyard
+    " Plug 'kaicataldo/material.vim'
+    " Plug 'NLKNguyen/papercolor-theme'
+    " Plug 'tomasiser/vim-code-dark'
+    " Vim Wiki
+    " Plug 'https://github.com/vimwiki/vimwiki.git'
+    " Better Comments
+    " Plug 'jbgutierrez/vim-better-comments'
+    " Echo doc
+    " Plug 'Shougo/echodoc.vim'
+    " Plug 'hardcoreplayers/spaceline.vim'
+    " Plug 'vim-airline/vim-airline-themes'
+    " Ranger
+    " Plug 'francoiscabrol/ranger.vim'
+    " Plug 'rbgrouleff/bclose.vim'
+    " Making stuff
+    " Plug 'neomake/neomake'
+    " Plug 'mhinz/vim-signify'
+    " Plug 'easymotion/vim-easymotion'
   endif