-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple_vimrc_for_ideavim
205 lines (161 loc) · 3.98 KB
/
simple_vimrc_for_ideavim
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
""Downloading the wombat256mod colorscheme:
""Run lines below (the ! means 'run in terminal' in vim, so if you're typing
"" directly into a terminal, type them without the preceeding '!')
"!mkdir -p ~/.vim/colors
"!wget -O ~/.vim/colors/wombat256mod.vim http://www.vim.org/scripts/download_script.php?src_id=13400
try
colorscheme wombat256mod
catch /^Vim\%((\a\+)\)\=:E185/
colorscheme ron
endtry
"Exit insert mode by typing 'jk' instead of <esc>
imap jk <esc>
imap Jk <esc>
nnoremap o o<esc>
nnoremap O O<esc>
let mapleader = "ä"
nmap , ä
nnoremap ,, ,
" Quickly edit vimrc
nnoremap <leader>ev :vert split ~/.vimrc<CR>
nnoremap <leader>Ev :split ~/.vimrc<CR>
nnoremap <leader>EV :split ~/.vimrc<CR>
" Disable highlight (nohighlight) by typing <leader>h
nnoremap <leader>h :noh<cr>
":update will save but only if there's a change
nnoremap <space> :update<CR>
"Quickly move between windows with ctrl+hjkl
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Move vertically by visual line
nnoremap j gj
nnoremap k gk
nnoremap gj j
nnoremap gk k
" Easier indentation in visual mode (don't leave visual mode after < or >)
vnoremap < <gv
vnoremap > >gv
"0 is much easier to reach than ^
nnoremap 0 ^
nnoremap ´ ^
nnoremap ^ 0
nnoremap d0 d^
nnoremap c0 c^
nnoremap y0 y^
" More reasonable use of Y (as opposed to being identical to yy)
nnoremap Y y$
" Jump directly to a spot instead of just to that line
nnoremap ` '
nnoremap ' `
vnoremap ` '
vnoremap ' `
"Don't wait as long in insert mode (to enable us to quickly type j and k)
if has("autocmd")
augroup FastEscape
autocmd!
autocmd InsertEnter * set timeoutlen=450
autocmd InsertLeave * set timeoutlen=2500
augroup END
endif
""""""""""""""""""""
"Fix accidentally holding shift while trying to quit vim, e.g. :Q -> :q
command Q q
command Qa qa
command QA qa
cmap Q! q!
cmap Qa! qa!
cmap QA! qa!
""""""""""""""""""""
"Detect file types automatically
filetype plugin indent on
"Enable syntax highlighting
syntax enable
" Use :help 'option' to see the documentation for the given option.
"Line numbers
set number
set shiftwidth=4
set softtabstop=4 "Number of spaces in tab when editing
set fillchars=
set expandtab "Expands tabs into spaces
"Copy indent from previous line when we continue an indented line
set autoindent
set backspace=indent,eol,start
set complete-=i
"Use spaces, but <tab> and <bs> works like it was a single tab
set smarttab
set smartindent
set ttimeout
set ttimeoutlen=100
"Highlight patterns as we search
set incsearch
set ignorecase "ignore case when searching
set smartcase "ignore case when searching, except if we start with a capital
"Always show status bar
set laststatus=2
set ruler
set wildmenu
set wildmode=longest,list,full
set splitbelow
set splitright
"Always keep at least this many lines above/below/leftof/rightof cursor
if !&scrolloff
set scrolloff=4
endif
if !&sidescrolloff
set sidescrolloff=5
endif
set display+=lastline
if &encoding ==# 'latin1' && has('gui_running')
set encoding=utf-8
endif
if &listchars ==# 'eol:$'
set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
endif
if v:version > 703 || v:version == 703 && has("patch541")
set formatoptions+=j " Delete comment character when joining commented lines
endif
"Reload a file if it has been modified outside of vim
set autoread
if !empty(&viminfo)
set viminfo^=!
endif
"remaps å¨Å^ to []{} in various ways
source ~/.vim/ftplugin/remap_to_brackets.vim
" imap å [
" imap ¨ ]
" imap Å {
" imap ^ }
" inoremap zå å
" inoremap z¨ ¨
" inoremap zÅ Å
" inoremap zÅ Å
" inoremap z^ ^
"
" map få f[
" map f¨ f]
" map Få F[
" map F¨ F]
"
" map fÅ f{
" map f^ f}
" map FÅ F{
" map F^ F}
"
" "tT operators
" map tå f[
" map t¨ f]
" map Tå F[
" map T¨ F]
"
" map tÅ f{
" map t^ f}
" map TÅ F{
" map T^ F}
"
" map rå r[
" map r¨ r]
" map rÅ r{
" map r^ r}
" vim:set ft=vim et sw=4: