-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit.vim
130 lines (105 loc) · 2.53 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
" # DD neovim configuration
"
" File: init.vim
" Author: Danilo Dellaquila
" Date: Fri, 07 Apr 2017 18:02:53 +0200
"
" This is file is part of the personal neovim configuration of
" Danilo Dellaquila.
"
" ## Generic Settings
"
" Set vim directory path
let $VIMPATH=$HOME."~/.config/nvim"
" Disable backup
set nobackup
" Do not automatically load files changed outside of Vim
set noautoread
" Enable autowrite
"set autowriteall
" Set some search options
set noincsearch
set ignorecase
set smartcase
" Map <C-L> to clear highlight
nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
" Increase history
if &history < 1000
set history=1000
endif
" Don't consider octal numbers that have leading zeros for padding,
" so that such numbers are incremented and decremented as expected.
set nrformats-=octal
" ## Vim UI
"
" Terminator colors
set termguicolors
" Line numbers
set number
" Set statusline, always show it with ruler
set statusline=%F%m%r%h%w\ [%{&ff}]\ [%Y]\ [ASCII=\%03.3b\ HEX=\%02.2B]\ [POS=%04l,%04v\ %p%%\ %L]
set laststatus=2
set ruler
" Minimal number of screen lines/column to keep
if !&scrolloff
set scrolloff=1
endif
if !&sidescrolloff
set sidescrolloff=5
endif
set display+=lastline
" Background
set background=dark
" Color Scheme
" Enable true-color in a terminal emulator that DOES support 24-bit color,
" see https://github.com/joshdick/onedark.vim#installation
if (has("termguicolors"))
set termguicolors
endif
" ... keep it disable for Terminator
"if ! empty("g:$TERMINATOR_UUID")
"set notermguicolors
"endif
colorscheme desert
" ## Programming and Formatting
"
" Set maximum width of text line
set textwidth=72
" Automatic Indentation
set smartindent
" Tabs settings
"set noexpandtab (better for Golang code, this is the default in neovim)
set expandtab
set tabstop=4
set smarttab
set shiftwidth=4
set shiftround
" Set folding method and leave all folds open
set fdm=indent
set foldlevel=99
" Syntax Highlighting
if has('syntax') && !exists('g:syntax_on')
syntax enable
endif
" ## Key Mappings
"
source $VIMPATH/mappings.vim
" Time out on :mappings and key codes
set ttimeout
set ttimeoutlen=100
" ## Plugins
"
source $VIMPATH/plugins.vim
" ## File Types
"
" enable filetype detection:
filetype on
filetype plugin on
filetype indent on " file type based indentation
" Set filetype for known extesions
augroup filetypedetect
autocmd BufNewFile,BufRead *.ledger set filetype=ledger
autocmd BufNewFile,BufRead *.adoc set filetype=asciidoc
augroup END
" Set indentation
autocmd FileType yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2