summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.vim1
-rw-r--r--modules/airline.vim2
-rw-r--r--modules/general.vim65
-rw-r--r--modules/language_server.vim3
-rw-r--r--modules/plugins.vim15
-rw-r--r--modules/pydocstring.vim2
-rw-r--r--modules/startify.vim22
-rw-r--r--modules/theme.vim2
-rw-r--r--modules/vim-which-key.vim106
9 files changed, 141 insertions, 77 deletions
diff --git a/init.vim b/init.vim
index 9ab83d4c..e5447785 100644
--- a/init.vim
+++ b/init.vim
@@ -18,6 +18,7 @@ source $HOME/.config/nvim/modules/neosnippets.vim
source $HOME/.config/nvim/modules/emmet.vim
source $HOME/.config/nvim/modules/colorizer.vim
source $HOME/.config/nvim/modules/rainbow.vim
+source $HOME/.config/nvim/modules/vim-which-key.vim
" Special test file "
source $HOME/.config/nvim/modules/test.vim
diff --git a/modules/airline.vim b/modules/airline.vim
index bf99c2eb..6d2aae4c 100644
--- a/modules/airline.vim
+++ b/modules/airline.vim
@@ -3,7 +3,7 @@ let g:airline#extensions#tabline#enabled = 1
" enable powerline fonts
let g:airline_powerline_fonts = 1
" Switch to your current theme
-let g:airline_theme = 'tender'
+let g:airline_theme = 'codedark'
" Always show tabs
set showtabline=2
" We don't need to see things like -- INSERT -- anymore
diff --git a/modules/general.vim b/modules/general.vim
index 6a6f9b0d..2b27b8fc 100644
--- a/modules/general.vim
+++ b/modules/general.vim
@@ -13,6 +13,7 @@ syntax enable " Enables syntax highlighing
set hidden " Required for specific actions that require multiple buffers
set nowrap " display long lines as just one line
set encoding=utf-8 " The encoding displayed
+set pumheight=10 " Makes popup menu smaller
set fileencoding=utf-8 " The encoding written to file
set ruler " show the cursor position all the time
set iskeyword+=- " treat dash separated words as a word text object"
@@ -35,7 +36,8 @@ set background=dark " tell vim what the background color loo
let g:python_highlight_all = 0 " Get rid of annoying red highlights"
let g:elite_mode=1 " Disable arrows"
-
+filetype plugin indent on " Gives vim abilty to recognize filetypes
+
" Disable arrow movement, resize splits instead.
if get(g:, 'elite_mode')
nnoremap <Up> :resize -2<CR>
@@ -44,8 +46,6 @@ if get(g:, 'elite_mode')
nnoremap <Right> :vertical resize +2<CR>
endif
-" Gives vim abilty to recognize filetypes
-filetype plugin indent on
" Alternate way to save
nnoremap <C-s> :w<CR>
" Alternate way to quit
@@ -57,66 +57,7 @@ inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" Open terminal with F1
nnoremap <silent> <F1> :10split term://bash<CR>
nnoremap <silent> <F2> :bdelete! term://*<return>
-" insert mode for terminal
-""autocmd BufWinEnter,WinEnter term://* startinsert
-""autocmd BufLeave term://* stopinsert
-" Toggle tagbar
-"nnoremap <silent> <F2> :TagbarToggle<CR>
-" Toggle Line numbers
-"nnoremap <silent> <F4> :set nonumber!<CR>
-" Toggle NERDTree
-"nnoremap <silent> <F5> :NERDTreeToggle<CR>
-" Startify
-"nnoremap <silent> <F6> :Startify<CR>
-" Get rid of highlights after search
-"nnoremap <silent> <F7> :nohlsearch<CR><F7>
-" Toggle open buffers
-" nnoremap <silent> <F8> :BuffergatorToggle<CR>
-" For fuzzy finder
-""nnoremap <silent> <F9> :Files<CR>
-" F10 split vertical
-"nnoremap <silent> <F9> :vsplit<CR>
-" F11 split horizontal
-"nnoremap <silent> <F10> :split<CR>
-" Make current buffer only buffer
-"nnoremap <silent> <F12> :only<CR>
-" Remap window switch
-" Switch to rename for LSP to do add leader
-""nnoremap <F4> :SearchTasks *<CR>
-
-nnoremap <silent> <leader>q :q<return>
-nnoremap <silent> <leader>n :NERDTreeToggle<return>
-nnoremap <silent> <leader>m :TagbarToggle<return>
-nnoremap <silent> <leader>l :set nonumber!<return>
-nnoremap <silent> <leader>o :only<return>
-nnoremap <silent> <leader>s :Startify<return>
-nnoremap <silent> <leader>w :w<return>
-nnoremap <silent> <leader>p :pclose<return>
-nnoremap <silent> <leader>b :BuffergatorToggle<return>
-nnoremap <silent> <leader>ch :ColorToggle<return>
-nnoremap <silent> <leader>gy :Goyo<return>
-nnoremap <silent> <leader>hi :nohlsearch<return>
-nnoremap <silent> <leader>hs :split<return>
-nnoremap <silent> <leader>vs :vsplit<return>
-nnoremap <silent> <leader>gh :call LanguageClient_textDocument_hover()<CR>
-nnoremap <silent> <leader>gd :call LanguageClient_textDocument_definition()<CR>
-nnoremap <silent> <leader>gr :call LanguageClient_textDocument_rename()<CR>
-nnoremap <silent> <leader>gc :call LanguageClient_contextMenu()<CR>
-nnoremap <silent> <leader>fr :call LanguageClient_textDocument_references()<CR>
-nnoremap <silent> <leader>fix :ALEFix<CR>
-nnoremap <silent> <leader>gi :ALEInfo<CR>
-" This is a funtion to open any file with <leader>(key sequence)
- fun! OpenConfigFile(file)
- if (&filetype ==? 'startify')
- execute 'e ' . a:file
- else
- execute 'tabe ' . a:file
- endif
- endfun
-nnoremap <silent> <leader>in :call OpenConfigFile('~/.config/nvim/init.vim')<cr>
-nnoremap <silent> <leader>bashrc :call OpenConfigFile('~/.bashrc')<cr>
-nnoremap <silent> <leader>code :call OpenConfigFile('~/Library/Application Support/Code/User/settings.json')<cr>
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
diff --git a/modules/language_server.vim b/modules/language_server.vim
index d3b06011..70c010cb 100644
--- a/modules/language_server.vim
+++ b/modules/language_server.vim
@@ -1,6 +1,7 @@
" Required for operations modifying multiple buffers like rename.
set hidden
-
+" always show signcolumns
+set signcolumn=yes
let g:LanguageClient_autoStart = 1
let g:LanguageClient_serverCommands = {
diff --git a/modules/plugins.vim b/modules/plugins.vim
index debf33d1..7882e2d0 100644
--- a/modules/plugins.vim
+++ b/modules/plugins.vim
@@ -10,12 +10,15 @@ if dein#load_state('~/.config/nvim/dein')
" All the Themes
- call dein#add('flazz/vim-colorschemes')
- " call dein#add('liuchengxu/space-vim-dark')
- " call dein#add('joshdick/onedark.vim')
- " call dein#add('morhetz/gruvbox')
+ ""call dein#add('flazz/vim-colorschemes')
+ call dein#add('liuchengxu/space-vim-dark')
+ call dein#add('tomasiser/vim-code-dark')
+ call dein#add('joshdick/onedark.vim')
+ call dein#add('morhetz/gruvbox')
call dein#add('jacoborus/tender.vim')
call dein#add('luochen1990/rainbow')
+ " key menu popup "
+ call dein#add('liuchengxu/vim-which-key')
"Interface"
call dein#add('Shougo/denite.nvim')
" Neoterm
@@ -39,12 +42,14 @@ if dein#load_state('~/.config/nvim/dein')
" For ctags
call dein#add('ludovicchabant/vim-gutentags')
call dein#add('skywind3000/gutentags_plus')
+ " Better Previews "
+ call dein#add('skywind3000/vim-preview')
" Tagbar
call dein#add('majutsushi/tagbar')
" Auto Pairs
call dein#add('jiangmiao/auto-pairs')
" Buffergator use \b
- call dein#add('jeetsukumaran/vim-buffergator')
+"" call dein#add('jeetsukumaran/vim-buffergator')
" Ctrlp
call dein#add('ctrlpvim/ctrlp.vim')
"Linting
diff --git a/modules/pydocstring.vim b/modules/pydocstring.vim
index 34ce0e64..c0200b76 100644
--- a/modules/pydocstring.vim
+++ b/modules/pydocstring.vim
@@ -1,2 +1,2 @@
-nmap <silent> <leader>doc <Plug>(pydocstring)
+"nmap <silent> <leader>doc <Plug>(pydocstring)
diff --git a/modules/startify.vim b/modules/startify.vim
index 46731681..8cdaf8b8 100644
--- a/modules/startify.vim
+++ b/modules/startify.vim
@@ -1,6 +1,16 @@
-let g:startify_custom_header = [
- \ ' _ __ _ ',
- \ ' / | / /__ ____ _ __(_)___ ___ ',
- \ ' / |/ / _ \/ __ \ | / / / __ `__ \',
- \ ' / /| / __/ /_/ / |/ / / / / / / /',
- \ ' /_/ |_/\___/\____/|___/_/_/ /_/ /_/ ']
+
+let g:startify_custom_header = [
+\ ' __ _________ __ ____ ____.__ ',
+\ ' / / / _____/__________ ____ ____ \ \ \ \ / /|__| _____ ',
+\ '/ / \_____ \\____ \__ \ _/ ___\/ __ \ \ \ \ Y / | |/ \ ',
+\ '\ \ / \ |_> > __ \\ \__\ ___/ / / \ / | | Y Y \ ',
+\ ' \_\ /_______ / __(____ /\___ >___ > /_/ \___/ |__|__|_| / ',
+\ ' \/|__| \/ \/ \/ \/ ']
+
+
+"let g:startify_custom_header = [
+ "\ ' _ __ _ ',
+ "\ ' / | / /__ ____ _ __(_)___ ___ ',
+ "\ ' / |/ / _ \/ __ \ | / / / __ `__ \',
+ "\ ' / /| / __/ /_/ / |/ / / / / / / /',
+ "\ ' /_/ |_/\___/\____/|___/_/_/ /_/ /_/ ']
diff --git a/modules/theme.vim b/modules/theme.vim
index 38226b61..e302aee9 100644
--- a/modules/theme.vim
+++ b/modules/theme.vim
@@ -2,7 +2,7 @@
" Switch to whatever colorscheme you like
"colorscheme onedark
""colorscheme gruvbox
-colorscheme tender
+colorscheme codedark
" This chunk is just for spacevim theme
"colorscheme space-vim-dark
diff --git a/modules/vim-which-key.vim b/modules/vim-which-key.vim
new file mode 100644
index 00000000..0bfb55cf
--- /dev/null
+++ b/modules/vim-which-key.vim
@@ -0,0 +1,106 @@
+" set which key
+"
+" Any keymapping that involves <leader is here>
+nnoremap <silent> <leader> :WhichKey '<Space>'<CR>
+let g:which_key_sep = '→'
+
+" By default timeoutlen is 1000 ms
+set timeoutlen=100
+
+let g:mapleader = "\<Space>"
+let g:maplocalleader = ','
+
+let g:which_key_map = {}
+"let g:which_key_default_group_name = ''
+"let g:which_key_map.f = { 'name' : '+file' }
+"nnoremap <silent> <leader>fs :update<CR>
+"let g:which_key_map.f.s = ['update', 'save-file']
+
+" This is a funtion to open any file with <leader>(key sequence)
+fun! OpenConfigFile(file)
+ if (&filetype ==? 'startify')
+ execute 'e ' . a:file
+ else
+ execute 'tabe ' . a:file
+ endif
+endfun
+
+nnoremap <silent> <leader>in :call OpenConfigFile('~/.config/nvim/init.vim')<cr>
+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['p'] = [ 'pclose','close-preview' ]
+let g:which_key_map['q'] = [ 'q','quit' ]
+let g:which_key_map['s'] = [ 'w','save' ]
+
+let g:which_key_map.t = {
+ \ 'name' : '+toggle' ,
+ \ 'f' : ['NERDTreeToggle' , 'file-explorer'] ,
+ \ 'b' : ['TagbarToggle' , 'tagbar'] ,
+ \ 'l' : ['set nonumber!' , 'line-numbers'] ,
+ \ 's' : ['nohlsearch' , 'remove-search-highlight'] ,
+ \ 'c' : ['ColorToggle' , 'remove-color'] ,
+ \ }
+
+let g:which_key_map.h = {
+ \ 'name' : '+highlights' ,
+ \ 's' : ['nohlsearch' , 'remove-search-highlight'] ,
+ \ 'c' : ['ColorToggle' , 'remove-color'] ,
+ \ }
+
+ "\ 'f' : ['LanguageClient#textDocument_formatting()' , 'formatting'] ,
+let g:which_key_map.l = {
+ \ 'name' : '+lsp' ,
+ \ 'c' : ['LanguageClient_contextMenu()' , 'context_menu'] ,
+ \ 'f' : ['ALEFix' , 'formatting'] ,
+ \ 'i' : ['ALEInfo' , 'info'] ,
+ \ 'h' : ['LanguageClient#textDocument_hover()' , 'hover'] ,
+ \ 'r' : ['LanguageClient#textDocument_references()' , 'references'] ,
+ \ 'R' : ['LanguageClient#textDocument_rename()' , 'rename'] ,
+ \ 's' : ['LanguageClient#textDocument_documentSymbol()' , 'document-symbol'] ,
+ \ 'S' : ['LanguageClient#workspace_symbol()' , 'workspace-symbol'] ,
+ \ 'g' : {
+ \ 'name': '+goto',
+ \ 'd' : ['LanguageClient#textDocument_definition()' , 'definition'] ,
+ \ 't' : ['LanguageClient#textDocument_typeDefinition()' , 'type-definition'] ,
+ \ 'i' : ['LanguageClient#textDocument_implementation()' , 'implementation'] ,
+ \ },
+ \ 'p' : {
+ \ 'name': '+python',
+ \ 'd' : ['<Plug>(pydocstring)' , 'python-docstring'] ,
+ \ },
+ \ }
+
+let g:which_key_map.w = {
+ \ 'name' : '+windows' ,
+ \ 'v' : ['<C-W>v' , 'split-window-right'] ,
+ \ 'h' : ['<C-W>s' , 'split-window-below'] ,
+ \ 'w' : ['<C-W>w' , 'other-window'] ,
+ \ 'o' : ['only' , 'close-all-other-windows'] ,
+ \ 'd' : ['<C-W>c' , 'delete-window'] ,
+ \ '2' : ['<C-W>v' , 'layout-double-columns'] ,
+ \ '=' : ['<C-W>=' , 'balance-window'] ,
+ \ '?' : ['Windows' , 'fzf-window'] ,
+ \ }
+
+let g:which_key_map.b = {
+ \ 'name' : '+buffer' ,
+ \ '1' : ['b1' , 'buffer 1'] ,
+ \ '2' : ['b2' , 'buffer 2'] ,
+ \ 'd' : ['bd' , 'delete-buffer'] ,
+ \ 'f' : ['bfirst' , 'first-buffer'] ,
+ \ 'l' : ['blast' , 'last-buffer'] ,
+ \ 'n' : ['bnext' , 'next-buffer'] ,
+ \ 'p' : ['bprevious' , 'previous-buffer'] ,
+ \ '?' : ['Buffers' , 'fzf-buffer'] ,
+ \ 's' : ['Startify' , 'Startify'] ,
+ \ 'g' : ['Goyo' , 'Goyo'] ,
+ \ }
+
+call which_key#register('<Space>', "g:which_key_map")
+nnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>
+vnoremap <silent> <leader> :<c-u>WhichKeyVisual '<Space>'<CR>
+
+""nnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>
+""nnoremap <silent> <localleader> :<c-u>WhichKey ','<CR>