-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
93 lines (70 loc) · 1.99 KB
/
init.vim
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
lua require("init")
" === generic setup ===
set confirm
set number
set cursorline
set noequalalways
set colorcolumn=80
set updatetime=100
set signcolumn=yes
" Set completeopt to have a better completion experience
set completeopt=menuone,noinsert,noselect
" Avoid showing extra message when using completion
set shortmess+=c
" ident using 2 spaces
set expandtab
set shiftwidth=2
set softtabstop=2
" Show the current cursor position
set ruler
" disable default syntax highlighting, use treesitter instead
syntax off
" Send more characters for redraws
set ttyfast
" Enable mouse use in all modes
set mouse=a
" select with shift + arrow keys
set keymodel=startsel
" display special chars
" set list
" set listchars=tab:→\ ,space:·,nbsp:␣,trail:•,precedes:«,extends:»
",eol:¶
" show leader key in the bottom right corner
set showcmd
" do not save while in insert mode
let g:auto_save_in_insert_mode = 0
" Ctrl-s to save
noremap <silent> <C-S> :update<CR>
vnoremap <silent> <C-S> <C-C>:update<CR>
inoremap <silent> <C-S> <C-O>:update<CR>
" Create Blank Newline and stay in Normal mode
nnoremap <silent> <A-o> :<C-u>call append(line("."), repeat([""], v:count1))<CR>
nnoremap <silent> <A-O> :<C-u>call append(line(".")-1, repeat([""], v:count1))<CR>
" clear highlighten items with esc
nnoremap <silent> <esc> :let @/ = ""<cr>
" copy/paste operations
vmap <leader>y "+y
vmap <leader>d "+d
nmap <leader>p "+p
nmap <leader>P "+P
vmap <leader>p "+p
vmap <leader>P "+P
" close quickfix list
nmap <silent> <leader>q :cclose <bar> :Trouble close<cr>
" open new empty tab next to current one
nnoremap <C-n> :tabnew<cr>
" Go to tab by number
noremap <leader>1 1gt
noremap <leader>2 2gt
noremap <leader>3 3gt
noremap <leader>4 4gt
noremap <leader>5 5gt
noremap <leader>6 6gt
noremap <leader>7 7gt
noremap <leader>8 8gt
noremap <leader>9 9gt
noremap <leader>0 :tablast<cr>
" navigate to start/end of line in normal mode to match insert mode
" (see assistcontrol/readline.nvim plugin)
nnoremap <C-a> ^
nnoremap <C-e> $