-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.ideavimrc
119 lines (90 loc) · 2.62 KB
/
.ideavimrc
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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General Settings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Leader
let mapleader = ","
" Determines the OS
let uname = substitute(system('uname'), '\n', '', '')
" Sets how many lines of history VIM has to remember
set history=1000
" Disable swap and backup file options
set noswapfile
set nowb
" No annoying sound on errors
set visualbell
set t_vb=
set tm=500
" Ignore case when searching
set ignorecase
" When searching try to be smart about cases
set smartcase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" Don't redraw while executing macros (good performance config)
set lazyredraw
" For regular expressions turn magic on
set magic
" Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
set mat=2
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Mappings and configurations for better vi
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Clears highlights on hitting esc twice
nnoremap <esc><esc> :noh<return>
" Maps / to <space> for faster search
nnoremap <space> /
" Disable auto-comment insertion
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Enable persistent undo.
try
set undodir=~/.vim_runtime/temp_dirs/undodir
set undofile
catch
endtry
" Disable arrow keys in normal mode
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
" Different cursors in insert and visual mode
let &t_SI = "\e[5 q"
let &t_EI = "\e[1 q"
" move to beginning/end of line
nnoremap <Tab> $
nnoremap <S-Tab> ^
" Enables relative numbers in normal mode
set number
set relativenumber
" Indent with >,< without loosing cursor position
vmap < <gv
vmap > >gv
" Maps d and x to black-hole registry
nnoremap x "_x
nnoremap X "_X
" Maps leader d to cut
nnoremap <leader>d "_d
nnoremap <leader>D "_D
vnoremap <leader>d "_d
" Paste without yanking
vnoremap p "_dP
" Maps <leader>d to visual in word
:map <leader>w viw
" Maps leader yank to copy to system clipboard.
" Works only hasclipboard is true
noremap <leader>y "*y
noremap <leader>Y "*+y
noremap <leader>p "*p
noremap <leader>P "+p
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Plugin Related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => vim-multi-cursor
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set multiple-cursors
set surround
set commentary