-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
104 lines (94 loc) · 3.43 KB
/
init.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
call plug#begin('~/.local/share/nvim/plugged')
Plug 'machakann/vim-highlightedyank'
Plug 'jiangmiao/auto-pairs'
Plug 'sbdchd/neoformat'
"Plug 'github/copilot.vim'
Plug 'davidhalter/jedi-vim'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-jedi'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'morhetz/gruvbox'
Plug 'scrooloose/nerdtree'
Plug 'neomake/neomake'
Plug 'machakann/vim-highlightedyank'
Plug 'christoomey/vim-tmux-navigator'
Plug 'scrooloose/nerdcommenter'
Plug 'pearofducks/ansible-vim', { 'do': './UltiSnips/generate.sh' }
call plug#end()
"neomake basic config, need to customize
call neomake#configure#automake('nrwi', 500)
let g:deoplete#enable_at_startup = 1
" Enable alignment
let g:neoformat_basic_format_align = 1
" Enable tab to space conversion
let g:neoformat_basic_format_retab = 1
" Enable trimmming of trailing whitespace
let g:neoformat_basic_format_trim = 1
" disable autocompletion, because we use deoplete for completion
let g:jedi#completions_enabled = 0
" open the go-to function in split, not another buffer
let g:jedi#use_splits_not_buffers = "right"
let g:neomake_python_enabled_makers = ['pylint']
" Custom tmux mapping for seemless movment through windows
let g:tmux_navigator_no_mappings = 1
"Nerdtree Opens to right side.
let g:NERDTreeWinPos = "right"
"Tmux navigation seemless and directional movement between
"vim windows and tmux windows
nnoremap <silent> <c-h> :TmuxNavigateLeft<cr>
nnoremap <silent> <c-j> :TmuxNavigateDown<cr>
nnoremap <silent> <c-k> :TmuxNavigateUp<cr>
nnoremap <silent> <c-l> :TmuxNavigateRight<cr>
nnoremap <silent> <c-0> :TmuxNavigatePrevious<cr>
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
imap jj <Esc>
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
colorscheme gruvbox
set background=dark
set number
set relativenumber
set mouse=a
set so=999
" setting basic airline theme
"let g:airline_theme=simple
let g:neomake_python_enabled_makers = ['pylint']
call neomake#configure#automake('nrwi', 500)
let g:highlightedyank_highlight_duration = 1000
hi HighlightedyankRegion cterm=reverse gui=reverse
hi HighlightedyankRegion cterm=reverse gui=reverse
" set highlight duration time to 1000 ms, i.e., 1 second
let g:highlightedyank_highlight_duration = 1000
let mapleader = "," " map leader to comma
set timeoutlen=500 " Set timeout length to 500 ms
" Custom function
function! ToggleLineNumber()
if v:version > 703
set norelativenumber!
endif
set nonumber!
endfunction
" Custom shortcuts
map <leader>h :noh<CR>
map <leader>r :call ToggleLineNumber()<CR>
map <leader>t :NERDTreeToggle<CR>
map <leader>n :set number<CR>
map <leader>nn :set nonumber<CR>
map <leader>mm :set mouse=<CR>
map <leader>m :set mouse=a<CR>
" Alternative leader and shortcut
let mapleader="-"
" Open nerdtree window on opening Vim and have cursor default to open file and
autocmd VimEnter * if argc() == 1 | NERDTree | wincmd p | else | NERDTree | endif
" not nerdtree
" Refresh the current folder if any changes
autocmd BufEnter NERD_tree_* | execute 'normal R'
au CursorHold * if exists("t:NerdTreeBufName") | call <SNR>15_refreshRoot() | endif
au FocusLost * !silent update
"Reload the window if directory is changed
augroup DIRCHANGE
au!
autocmd DirChanged global :NERDTreeCWD
augroup END
"Close nerdtree automatically if it is theonly window open
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif