-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy_configs.vim
160 lines (139 loc) · 4.31 KB
/
my_configs.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Customized key mappings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"disable recording
nmap q <Nop>
"map enter with :
nnoremap <Enter> :
"set H to vertical help
cnoreabbrev H vert h
"set H to vertical help
cnoreabbrev H vert h
nnoremap <tab> %
vnoremap <tab> %
noremap - $
"automaticially open my_configs file
"nnoremap <leader>ev <C-W><C-V><C-L>:e $HOME/.vim_runtime/my_configs.vim<cr>
nnoremap <leader>ev :e $HOME/.vim_runtime/my_configs.vim<cr>
"auto load my_configs.vim when save
autocmd! bufwritepost ~/.vim_runtime/my_configs.vim source ~/.vimrc
"map last edited buffer
nmap <leader><tab> :b#<cr>
" <leader>+" surround a word with parethesis
nnoremap <leader>" viw<esc>a"<esc>bi"<esc>lel
"awesome git mappings
noremap <leader>st :Gstatus<cr>
noremap <leader>ci :Gcommit<cr>
"open lazygit
map <leader>g :!lazygit<cr>
"some ideas
"f key case insensive settings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Normal Mode Navigations
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nnoremap <leader>. <c-t>
nnoremap <leader>/ <c-]>
"map U to redo
nnoremap U <c-r>
"Disable join lines , map it to move down visually
nmap J <c-d>
nmap K <C-U>
"Disable join lines , map it to move down visually
nmap <c-j> <c-d>
nmap <c-k> <c-u>
nmap <leader>j <c-d>
nmap <leader>k <c-u>
"Disable arror key for training Vim key bindings
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
"remap jump in and jump out: ctrl-t and ctrl-]
nnoremap <c-a> <c-t>
nnoremap <c-space> <c-]>
nnoremap <leader>. <c-t>
nnoremap <leader>/ <c-]>
nnoremap <leader>[ <c-t>
nnoremap <leader>] <c-]>
"jump in and out
nnoremap <leader>' <c-I>
nnoremap <leader>; <c-O>
nmap cp :let @" = expand("%:p")<cr>
"Using shift and a direction to change tabs
noremap <S-l> gt
noremap <S-h> gT
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Personal Extra Settings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"set color scheme
"set background=dark
let g:dracula_italic = 0
colorscheme dracula
" enable mouse scroll
set mouse=a
"change default behaviour of tab complete, act like as Bash
set wildmode=longest,list,full
set wildmenu
" Make the nerdtree change to the directory when opens a bookmark
let NERDTreeChDirMode = 2
" ingore the go_version update settings
let g:go_version_warning = 0
"disable automatic syntasic
let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': [],'passive_filetypes': [] }
nnoremap <C-w>E :SyntasticCheck<CR> :SyntasticToggleMode<CR>
"disable fold
set nofoldenable
"remove the status line at bottom
set laststatus=2
"status line (top) settings
set stal=1
"show line number
set relativenumber
set number
"disable comment continuation
autocmd BufNewFile,BufRead * setlocal formatoptions-=ro
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Insert mode
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
inoremap <c-f> <c-r>=expand("%:p")<cr>
inoremap II <Esc>I
inoremap AA <Esc>A
inoremap OO <Esc>O
inoremap CC <Esc>C
inoremap SS <Esc>S
inoremap DD <Esc>dd
inoremap UU <Esc>u
inoremap qq <ESC>
inoremap jk <ESC>
inoremap jj <ESC>
inoremap oo <c-o>
inoremap ,, <c-o>
" In insert or command mode, move normally by using Ctrl
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-l> <Right>
let g:AutoPairsMapCh = 0 " disable imap <c-h> <BS> in autopairs.plugin
inoremap <C-h> <Left>
cnoremap <C-h> <Left>
cnoremap <C-j> <Down>
cnoremap <C-k> <Up>
cnoremap <C-l> <Right>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Plugins option
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => NERDTREE Related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"let NERDTREE show hidden files
let NERDTreeShowHidden=1
" set NERDTREE up directory with 'h'
autocmd FileType nerdtree nmap<buffer> h u
autocmd FileType nerdtree nmap<buffer> l o
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => EasyMotion related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" easymotion highlight colors
hi link EasyMotionTarget Search
hi link EasyMotionTarget2First Search
hi link EasyMotionTarget2Second Search
hi link EasyMotionShade Comment