-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
111 lines (91 loc) · 2.25 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
" Theme
colo pablo
" Encoding
scriptencoding utf-8
set enc=utf-8
set fenc=utf-8
" Display tabs and spaces
highlight Tab ctermbg=darkgray guibg=darkgray
highlight Space ctermbg=darkgray guibg=darkgray
au BufWinEnter * let w:m2=matchadd('Tab', '\t', -1)
au BufWinEnter * let w:m3=matchadd('Space', '\s\+$\| \+\ze\t', -1)
set list listchars=tab:» ,trail:·,nbsp:×
" Display line numbers
set number
" Enable syntax
if has("syntax")
syntax on
endif
" Indent
set autoindent
set smartindent
" Swap files
set noswapfile
" Display status line
set laststatus=2
" Status line content
" File path, modified flag, type, readonly, encoding, line:column, progression
set statusline=
set statusline+=\ %f
set statusline+=\ %#CursorColumn#
set statusline+=%m
set statusline+=%y
set statusline+=%r
set statusline+=%=
set statusline+=\ %{&fileencoding?&fileencoding:&encoding}
set statusline+=\ %l/%L:%c
set statusline+=\ %p%%
set statusline+=\
" Deactivate wrapping
set nowrap
" Enable mouse
set mouse=a
" Increase display by telling to vim that TTY is fast
set ttyfast
" Netrw settings
let g:netrw_banner = 1
let g:netrw_browse_split = 3
let g:netrw_winsize = 25
let g:netrw_altv = 1
let g:netrw_liststyle = 3
" Toggle Netrw
let g:netrw_open = 0
function! ToggleNetrw()
if g:netrw_open
let g:netrw_open = 0
silent Lexplore
else
let g:netrw_open = 1
silent Lexplore
wincmd p
endif
endfunction
" Shortcut Tabs
map <tab> :tabnext<cr>
map <S-tab> :tabprevious<cr>
" Shortcut Select all
map <C-a> ggVG
imap <C-a> <Esc><C-a>
vmap <C-a> <Esc><C-a>
" Shortcut Duplicate lines
map <silent> <C-k> :.copy .<cr>
imap <C-k> <Esc><C-k>:startinsert<cr>
vmap <silent> <C-i> :copy '><cr>gv
vmap <silent> <C-k> :copy '<-1<cr>gv
" Shortcut Move lines
map <silent> <C-u> :.move .-2<cr>
imap <C-u> <Esc><C-u>:startinsert<cr>
map <silent> <C-j> :.move .+1<cr>
imap <C-j> <Esc><C-j>:startinsert<cr>
vmap <silent> <C-u> :move '<-2<cr>gv
vmap <silent> <C-j> :move '>+1<cr>gv
" Shortcut Delete lines
map <silent> <C-d> :delete<cr>
imap <C-d> <Esc><C-d>:startinsert<cr>
" Shortcut Move cursor
imap <C-w> <Esc><right>wi
imap <C-b> <Esc>bi
" Shortcut Toggle explorer
map <C-e> :call ToggleNetrw() <CR>
imap <C-e> :call ToggleNetrw() <CR>
vmap <C-e> :call ToggleNetrw() <CR>