aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/nvim/init.vim49
-rw-r--r--.tmux.conf18
2 files changed, 54 insertions, 13 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index 2042b4d..7998e15 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -36,6 +36,8 @@ call plug#begin('~/.config/nvim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" rust lang
Plug 'rust-lang/rust.vim'
+" go
+Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
" syntastic
Plug 'vim-syntastic/syntastic'
"C++ Highlighting
@@ -71,6 +73,8 @@ function! HasPaste()
return ''
endfunction
+let mapleader = " " " map leader to Space
+
" Applying codeAction to the selected region.
" Example: \`<leader>aap\` for current paragraph
@@ -78,6 +82,31 @@ endfunction
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
+"
+" GoTo code navigation.
+nmap <silent> gd <Plug>(coc-definition)
+nmap <silent> gy <Plug>(coc-type-definition)
+nmap <silent> gi <Plug>(coc-implementation)
+nmap <silent> gr <Plug>(coc-references)
+
+" Use K to show documentation in preview window.
+nnoremap <silent> K :call <SID>show_documentation()<CR>
+
+function! s:show_documentation()
+ if (index(['vim','help'], &filetype) >= 0)
+ execute 'h '.expand('<cword>')
+ elseif (coc#rpc#ready())
+ call CocActionAsync('doHover')
+ else
+ execute '!' . &keywordprg . " " . expand('<cword>')
+ endif
+endfunction
+
+" Highlight the symbol and its references when holding the cursor.
+autocmd CursorHold * silent call CocActionAsync('highlight')
+
+" Symbol renaming.
+nmap <leader>rn <Plug>(coc-rename)
" My config
@@ -125,6 +154,9 @@ inoremap <silent><expr> <Tab>
\ <SID>check_back_space() ? "\<Tab>" :
\ coc#refresh()
+" use <c-space>for trigger completion
+inoremap <silent><expr> <c-space> coc#refresh()
+
set laststatus=2
"set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c
@@ -198,12 +230,21 @@ hi User5 ctermfg=238 ctermbg=233
"------------Start Python PEP 8 stuff----------------
" Number of spaces that a pre-existing tab is equal to.
-au BufRead,BufNewFile *.html,*py,*pyw,*.c,*.h,*.js,*.tex,*.glsl,*.java,*.ts,*.tsx,*.c,*.cpp,*.h,*.hpp set tabstop=4
+"au BufRead,BufNewFile *.go,*.html,*py,*pyw,*.c,*.h,*.js,*.tex,*.glsl,*.java,*.ts,*.tsx,*.c,*.cpp,*.h,*.hpp set tabstop=4
"spaces for indents
-au BufRead,BufNewFile *.html,*.py,*.pyw,*.js,*.tex,*.glsl,*.java,*.ts,*.tsx,*.c,*.cpp,*.h,*.hpp set shiftwidth=4
-au BufRead,BufNewFile *.html,*.py,*.pyw,*.js,*.tex,*.glsl,*.java,*.ts,*.tsx,*.c,*.cpp,*.h,*.hpp set expandtab
-au BufRead,BufNewFile *.html,*.py,*.js,*.tex,*.glsl,*.java,*.ts,*.tsx,*.c,*.cpp,*.h,*.hpp set softtabstop=4
+"au BufRead,BufNewFile *.go,*.html,*.py,*.pyw,*.js,*.tex,*.glsl,*.java,*.ts,*.tsx,*.c,*.cpp,*.h,*.hpp set shiftwidth=4
+"au BufRead,BufNewFile *.go,*.html,*.py,*.pyw,*.js,*.tex,*.glsl,*.java,*.ts,*.tsx,*.c,*.cpp,*.h,*.hpp set expandtab
+"au BufRead,BufNewFile *.go,*.html,*.py,*.js,*.tex,*.glsl,*.java,*.ts,*.tsx,*.c,*.cpp,*.h,*.hpp set softtabstop=4
+
+au BufRead,BufNewFile * set tabstop=4
+au BufRead,BufNewFile * set shiftwidth=4
+au BufRead,BufNewFile * set expandtab
+au BufRead,BufNewFile * set softtabstop=4
+
+au BufRead,BufNewFile *.yaml set tabstop=2
+au BufRead,BufNewFile *.yaml set shiftwidth=2
+au BufRead,BufNewFile *.yaml set softtabstop=2
" Use the below highlight group when displaying bad whitespace is desired.
highlight BadWhitespace ctermbg=red guibg=red
diff --git a/.tmux.conf b/.tmux.conf
index f324976..8ebd2ba 100644
--- a/.tmux.conf
+++ b/.tmux.conf
@@ -35,27 +35,27 @@ setw -g monitor-activity off
set -g bell-action none
# modes
-setw -g clock-mode-colour colour5
+setw -g clock-mode-colour colour6
setw -g mode-style 'fg=colour1 bg=colour18 bold'
# panes
-set -g pane-border-style 'fg=colour19 bg=colour0'
-set -g pane-active-border-style 'bg=colour0 fg=colour9'
+set -g pane-border-style 'fg=colour8 bg=colour0'
+set -g pane-active-border-style 'bg=colour0 fg=colour208'
# statusbar
set -g status-position bottom
set -g status-justify left
-set -g status-style 'bg=colour18 fg=colour137 dim'
+set -g status-style 'bg=colour215 fg=colour15 dim'
set -g status-left ''
-set -g status-right '#[fg=colour233,bg=colour19] %d/%m #[fg=colour233,bg=colour8] %H:%M:%S '
+set -g status-right '#[fg=colour233,bg=colour208] %d/%m #[fg=colour15,bg=colour8] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20
-setw -g window-status-current-style 'fg=colour1 bg=colour19 bold'
-setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F '
+setw -g window-status-current-style 'fg=colour234 bg=colour208 bold'
+setw -g window-status-current-format ' #I#[fg=colour235]:#[fg=colour232]#W#[fg=colour232]#F '
-setw -g window-status-style 'fg=colour9 bg=colour18'
-setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
+setw -g window-status-style 'fg=colour232 bg=colour245'
+setw -g window-status-format ' #I#[fg=colour235]:#[fg=colour232]#W#[fg=colour232]#F '
setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'