aboutsummaryrefslogtreecommitdiffstats
path: root/init.vim
blob: 2fd2da8862763466fe1ba1862e1ef7ccb94cb3e9 (plain)
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
" Allows to have a .nvimrc per project folder
set exrc

syntax enable

let mapleader = ' '

inoremap <C-c> <esc>

nnoremap <Leader><CR> :so ~/.config/nvim/init.vim<CR>

let g:vimwiki_list = [{'path': '~/vimwiki/',
                      \ 'syntax': 'markdown', 'ext': '.md'}]

let g:gitgutter_map_keys = 0

" forward and backward search of current word
nnoremap * /\<<C-R>=expand('<cword>')<CR>\><CR>
nnoremap # ?\<<C-R>=expand('<cword>')<CR>\><CR>

vnoremap <leader>p "_dP

" remove whitespaces
autocmd BufWritePre * :%s/\s\+$//e

" format json files
autocmd BufWritePre *stubs/**/*.json :%!jq

" augroup fmtphp
"   autocmd!
"   autocmd BufWritePre filetype php undojoin | lua vim.lsp.buf.formatting()
" augroup END

filetype plugin indent on
autocmd FileType yaml setl indentkeys-=<:>
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType cucumber setl indentkeys-=<:>
autocmd FileType cucumber setlocal ts=2 sts=2 sw=2 expandtab

autocmd BufWritePost */alpha/**.lua lua require('plenary.reload').reload_module('alpha')

nnoremap Y y$

nnoremap n nzzzv
nnoremap N Nzzzv
nnoremap J mzJ`z

inoremap , ,<c-g>u
inoremap . .<c-g>u
inoremap ! !<c-g>u
inoremap ? ?<c-g>u
inoremap $ $<c-g>u
inoremap > ><c-g>u

vnoremap < <gv
vnoremap > >gv

" disable vim-go K binding
let g:go_doc_keywordprg_enabled = 0

lua require('plugins')
lua require("alpha")

" quick duplication of files
nnoremap <expr> <leader>dp ":saveas " .  expand('%')

let g:laravel_artisan = 'sail artisan'
let test#php#pest#executable = 'sail debug test'

" Has to be the last line for the .nvimrc per project
set secure