-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
157 lines (117 loc) · 3.93 KB
/
Copy path.vimrc
File metadata and controls
157 lines (117 loc) · 3.93 KB
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
" *** Geoffrey's vim configuration file based on 'Learn Vimscript The Hard Way' from Steve Losh ***
echo "*** let's vim that file ***"
colo pablo
" set leader and local leader key
let mapleader = "-"
let localleader = "\\"
" enable mouse control
set mouse=a
" set paste
set paste
" enable syntax color
syntax on
" show line number
set number
" underline the cursor line
set cursorline
" make the 81st column turn red
set colorcolumn=81
" map - key to delete current line and paste it below
noremap - dd p
" map _ key to delete current line and paste it above
" (do not use it at the first or the last line of the file)
noremap _ dd <up> P
" in insert mode : convert the current word to uppercase
inoremap <c-u> <esc> viw U i
" in normal mode : convert the current word to uppercase
nnoremap <c-u> viw U
" open ~/.vimrc in a split window
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
" source ~/.vimrc
nnoremap <leader>sv :source $MYVIMRC<cr>
" surround the current word with "
nnoremap <leader>" viw<esc>a"<esc>bi"<esc>lel
" surround the current word with '
nnoremap <leader>' viw<esc>a'<esc>bi'<esc>lel
" in visual mode : surround current selection with '
vnoremap <leader>" <esc>`>a'<esc>`<i'<esc>`<lv`>l
" in normal mode : go to beginning of current line
nnoremap H 0
" in normal mode : go to the end of current line
nnoremap L $
" in insert mode : go to normal mode
inoremap jk <esc>
" (learning desability) desable esc key to go to normal mode
inoremap <esc> <nop>
" (learning desability) in normal and insert modes : desable arrow keys to move in the file
inoremap <Up> <nop>
inoremap <Down> <nop>
inoremap <Left> <nop>
inoremap <Right> <nop>
nnoremap <Up> <nop>
nnoremap <Down> <nop>
nnoremap <Left> <nop>
nnoremap <Right> <nop>
" Change how vim represents characters on the screen
set encoding=utf-8
" Set the encoding of files written
set fileencoding=utf-8
autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4
autocmd Filetype go setlocal tabstop=4 shiftwidth=4 softtabstop=4
" ts - show existing tab with 4 spaces width
" sw - when indenting with '>', use 4 spaces width
" sts - control <tab> and <bs> keys to match tabstop
" Control all other files
set shiftwidth=4
set softtabstop=4
set tabstop=4
set autoindent
set smartindent
filetype plugin indent on
" show line count in visual mode
set showcmd
" Allow backspace to delete indentation and inserted text
" i.e. how it works in most programs
set backspace=indent,eol,start
" indent allow backspacing over autoindent
" eol allow backspacing over line breaks (join lines)
" start allow backspacing over the start of insert; CTRL-W and CTRL-U
" stop once at the start of insert.
" go-vim plugin specific commands
" Also run `goimports` on your current file on every save
" Might be be slow on large codebases, if so, just comment it out
let g:go_fmt_command = "goimports"
" Status line types/signatures.
let g:go_auto_type_info = 1
"au filetype go inoremap <buffer> . .<C-x><C-o>
" If you want to disable gofmt on save
" let g:go_fmt_autosave = 0
" NERDTree plugin specific commands
:nnoremap <C-g> :NERDTreeToggle<CR>
"autocmd vimenter * NERDTree
" air-line plugin specific commands
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = ''
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
" airline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''