~kaction/config

ref: 3a2f7e196ce335ca88261a7f462ef60e54e8f0f1 config/universe/neovim/init.vim -rw-r--r-- 3.1 KiB
3a2f7e19 — Dmitry Bogatov uenv: fix missing slash in /usr/local/bin 3 months ago
                                                                                
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
set nocompatible
syntax enable
filetype plugin indent on

set keymap=russian-jcukenwin
set iminsert=0
set imsearch=0

set autoindent
set cmdwinheight=4
" This teaches vim to find files references by Python's pkgutil.get_data
set path+=.;.git
set complete+=t "tag completion
set copyindent
set exrc
set foldclose=all
set foldlevel=0
set foldmethod=marker
set incsearch
set list
set listchars=trail:-,tab:>.
" panic action to prevent cve-2019-12735
set nomodeline
set magic
set nohlsearch
set ruler
set secure
set showmatch
set showcmd
set smartcase
set wildmenu
set wildmode=list:longest,list:longest
set infercase
set colorcolumn=80
set laststatus=0
set number

" There is no reason for .viminfo file to survive reboot. This way it
" does not clutter ~/.
let &viminfofile = "/dev/shm/" . getenv("USER") . "/.neovim.info"
let g:netrw_home = "/dev/shm/" . getenv("USER")

let g:terraform_align = 1
let g:terraform_fmt_on_save = 1

let g:sql_type_default = 'pgsql'
let g:pgsql_pl = ['python']

" Vim thinks, that /bin/sh scripts must use backticks for command
" substitution. Make it believe that shell is actually bash.
let g:is_bash=1
let g:sh_fold_enabled=7
" Goal here is to match emacs behaviour perfectly.
let g:timestamp_modelines=8
let g:timestamp_regexp = '\v\c%(Time-stamp:\s+).*'
let g:timestamp_rep='Time-stamp: <%Y-%m-%d %H:%M:%S dbogatov>'

let g:formatdef_indent = '"indent -linux -psl -bad"'
let g:formatdef_yapf = '"yapf"'
let g:formatters_c = ['indent']
let g:formatters_python = ['yapf']
" Otherwise it does stupid things with regard to git-commit buffers.
let g:autoformat_autoindent = 0
let g:autoformat_retab = 0
let g:autoformat_remove_trailing_spaces = 0

map Q gq
tnoremap <C-_><C-_> <C-\><C-N>
noremap j gj
noremap k gk
noremap $ g$
noremap 0 g0
set tags+=../tags,../../tags,../../../tags,../../../../tags

au BufNewFile,BufRead *.asy setf asy
au BufNewFile,BufRead manifest setf sh

" These are huge files (~150k lines) in nixpkgs, and they hang syntax
" highlight.
au BufNewFile,BufRead all-packages.nix set syntax=off
au BufNewFile,BufRead hackage-packages.nix set syntax=off

au BufNewFile,BufRead */.mail/*/[0123456789]* setf mail
au BufNewFile,BufRead /tmp/src* setf gitcommit
au BufNewFile,BufRead *.asy setfiletype asy
au BufNewFile,BufRead manifest setfiletype sh
au BufNewFile,BufRead *.ex set filetype=execline
au BufNewFile,BufRead *.exec set filetype=execline
" Used by redo(1) build system.
au BufNewFile,BufRead *.do set filetype=sh
au BufNewFile,BufRead *.fasm setfiletype fasm
au BufNewFile,BufRead */mail/*/[0123456789]* setfiletype mail
au BufNewFile,BufRead syntax sync minlines=200 "slower but more correct highlighting
au BufWritePre * :silent !mkdir -p %:p:h
au BufWrite * :Autoformat

imap <Tab> <Plug>snipMateNextOrTrigger
smap <Tab> <Plug>snipMateNextOrTrigger
vmap <Tab> <Plug>snipMateVisual

imap <S-Tab> <Plug>snipMateBack
smap <S-Tab> <Plug>snipMateBack

imap <C-s> <Plug>snipMateShow
let g:snipMate = { 'snippet_version': 1 }
let g:nnn#action = {
      \ '<c-t>': 'tab split',
      \ '<c-x>': 'split',
      \ '<c-v>': 'vsplit' }
let g:nnn#replace_netrw = 1
colorscheme wombat256