-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvimrc
106 lines (83 loc) · 1.75 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
set nocompatible " no vi mess
set encoding=utf-8
filetype off
syntax on
filetype plugin indent on
set hidden
set ttyfast
set t_Co=256
set background=dark
set nofoldenable
let mapleader = "\<Space>"
set formatoptions=tcqrn1
set matchpairs+=<:> " use % to jump between pairs
runtime! macros/matchit.vim
set modelines=0
set wildmenu
set wildmode=longest:list
set showmode
set showcmd
set laststatus=2
set ttimeoutlen=50
set scrolloff=15
set sidescrolloff=15
set backspace=indent,eol,start " backspace everything
autocmd BufRead,BufNewFile *.md setlocal spell
autocmd FileType gitcommit setlocal spell
set number
set cursorline
set ruler
set nobackup
set noswapfile
set nowritebackup
set expandtab
set smarttab
set tabstop=2
set shiftwidth=2
set autoindent
set hlsearch
set incsearch
set ignorecase
set smartcase
set showmatch
nnoremap / /\v
vnoremap / /\v
map <leader><esc> :let @/=''<cr> " clear search
set splitright
set splitbelow
" 80 is a wondeful number
set colorcolumn=80
" I don't attempt to arrow anymore, but keeping here for nostalgia ❤️
for prefix in ['i', 'n', 'v']
for key in ['<Up>', '<Down>', '<Left>', '<Right>']
exe prefix . "noremap " . key . " <Nop>"
endfor
endfor
" fingers
command! Wq wq
command! WQ wq
command! W w
command! Q q
nnoremap Q <NOP>
noremap 0 ^
noremap ^ 0
nnoremap j gj
nnoremap k gk
" System Clipboard yankyputting
noremap <Leader>y "+y
noremap <Leader>p "+p
" Toggle case
nnoremap <Leader>t g~
nnoremap <Leader>tc ~h
nnoremap <Leader>tl g~~
" save
nnoremap <Leader>w :w<CR>
" closing buffers is too slow
nnoremap <Leader>c :bd<CR>
nnoremap <Leader>C :bd!<CR>
" closing everything is too slow
nnoremap <Leader>q :q<CR>
nnoremap <Leader>Q :q!<CR>
" cycle through buffers
nnoremap <Leader><tab> :bn<CR>
nnoremap <Leader>` :bp<CR>