-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
56 lines (50 loc) · 1.44 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
" neovim configs
" ~/.config/nvim/init.vim
" vim-plug stuff
" If you add new shit have to run :PlugInstall in nvim 🥴
call plug#begin()
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
call plug#end()
" end vim-plug stuff
" remaps
" Telescope stuff
nnoremap <silent> <C-E> :Telescope find_files<CR>
nnoremap <silent> <C-F> :Telescope live_grep<CR>
nnoremap <silent> <C-W> :Telescope buffers<CR>
" configs
set number
" only needs to be present in ./colors/sonokai.vim to work :)
colorscheme sonokai
set tabstop=4
set shiftwidth=4
set ignorecase
set smartcase
set hlsearch
set showmatch
set mat=2
set scrolloff=3
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Indent if we're at the beginning of a line. Else, do completion.
"NOTE(Rudy): DOES NOT WORK WITH :set paste
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <expr> <tab> InsertTabWrapper()
inoremap <s-tab> <c-n>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Move between windows with ctrl <-- -->
nmap <silent> <C-Right> :wincmd l<CR>
nmap <silent> <C-Left> :wincmd h<CR>
" remove highlighting after search with comma-space
nnoremap <silent> ,<space> :nohlsearch<CR>
" Remap q to Q (macro)
" Helps hit it less
nnoremap Q q
nnoremap q <Nop>