-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
executable file
·145 lines (126 loc) · 3.39 KB
/
.vimrc
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
set nocompatible
if has('nvim')
let &runtimepath.=',' . $HOME . '/.vim'
set winhighlight=Normal:ActiveWindow,NormalNC:InactiveWindow
set guicursor=
set statusline=-
set fillchars=stl:-,stlnc:-,vert:\|
set laststatus=0
endif
source ~/.rcvim/plugins
source ~/.rcvim/scripts.vim
source ~/.rcvim/autocommands
colorscheme lotus
syntax on
source ~/.rcvim/custom_highlighting
source $VIMRUNTIME/macros/matchit.vim
" #-----------------maps------------------
" nerdcommenter binding
map <C-h> <Leader>c<space>
" #----------------nmaps---------------
nmap <CR> O<Esc>
nmap <Space> a<Space><Esc>
nmap <F6>u :UndotreeToggle<CR>
nmap <F6>nt :NERDTreeToggle<CR>
nmap <F6>nf :NERDTreeFind<CR>
nmap <F6>dt :filetype detect<cr>
nmap <F6>j i<CR><ESC>
nmap <F6>hs :set hlsearch!<cr>
nmap <F6>hc /fuubar42<cr>
nmap <F6>sb :set scrollbind!<cr>
nmap <F6>e :edit!<cr>
nmap <F6>w :wa<CR>
nmap <F6>rv :Eview<Space>
nmap <F6>rm :Emodel<Space>
nmap <F6>rc :Econtroller<Space>
nmap < <l
nmap > >l
nmap <C-z> <nop>
nmap K <nop>
nmap <C-W>z <Plug>(zoom-toggle)
nnoremap ]q :cnext<CR>
nnoremap [q :cprevious<CR>
nnoremap / /\v
nnoremap ? ?\v
" Scrolldown terminal output.
nnoremap <F6>g <C-w>wG<C-w>p
" Avoid Ex mode
nmap Q <nop>
nnoremap <F6>cd :lcd %:h<CR>:pwd<CR>
nnoremap <F6>p :CtrlPMRUFiles<CR>
" ` is harder to reach than '
nnoremap ` '
nnoremap ' `
nnoremap H :e #<CR>
" #---------------- vmaps --------------------------
vmap K <nop>
" #---------------- imaps --------------------------
" remap ctrl space to just space
imap <Nul> <Space>
" Backward kills should be available in undo/redo stack
inoremap <C-u> <C-g>u<C-u>
inoremap <C-w> <C-g>u<C-w>
imap <F6>w <Esc>:wa<CR>
imap <F6> <Esc>
" #----------------- cmaps --------------------------------
cmap <c-k> <Up>
cmap <c-j> <Down>
cmap <Nul> <Space>
cmap <C-o> <S-Tab>
" Converts Emodel to Tmodel.
cmap <C-t> <Home><Right><Backspace>T<CR>
cmap <C-v> <Home><Right><Backspace>V<CR>
cabbrev hv vertical belowright help
cabbrev fn vertical topleft help function-list
cabbrev vb vertical sbuffer
cabbrev rc RuboCop
cabbrev tt tabmove
cabbrev cpcc CtrlPClearCache
cabbrev cs source ~/.vimrc
" #----------- nvim terminal mappings --------------------
if has('nvim')
tnoremap <F6>n <C-\><C-n>
tnoremap <F6>w <C-\><C-n><C-w>w
endif
" ------------------set------------------------------
set t_Co=256
set modelines=1
set cursorline
set autoindent
set nobackup
set ignorecase
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set hidden
set smartcase
set nowritebackup
set noswapfile
set incsearch
set ttimeoutlen=50
set wildignorecase " case insensitive file name completion in command mode.
set cedit=<C-s> " since <C-f> has to be cmapped to emulate emacs mode
" add hyphen to keyword list
set iskeyword+=-
set iskeyword+=?
set wildmenu " Show list of commands for completion.
set showcmd " Show typed keys.
set nomodeline " Disable vim settings defined inside file.
set confirm " Confirm to save file instead of errors.
set tags+=.git/tags
set scrolloff=999
set backspace=indent,eol,start
" w -> content in non buffer files(like help files) in the same tab. b -> other loaded buffers.
set complete=.,w,b
" exec "set listchars=tab:\uBB\uBB,trail:\uB7,nbsp:~"
" set list
" #-----------emacs mode
imap <c-a> <Home>
imap <C-e> <End>
imap <c-f> <Right>
imap <c-b> <Left>
cmap <c-a> <home>
" <C-e> cmapped to <End> by default
cmap <c-f> <Right>
cmap <c-b> <Left>