blob: b179acc8c8949aaf17960074df2b39dd81fe533f (
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
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
131
132
133
134
135
136
137
138
139
140
|
" VIM configuration
" Basic options
syn on
set nu
set background=dark
set nobackup
set nowritebackup
set noswapfile
set noautoindent
set nosmartindent
set tabstop=2
set shiftwidth=2
set expandtab
set mouse=a
set autoread
set nocompatible
set laststatus=2
set shortmess+=I
set ignorecase
set smartcase
let mapleader="-"
" Syntax highlighting
syntax on
" Indenting
filetype indent off
filetype plugin indent on
" Syntax check
let g:syntastic_mode_map={ 'mode': 'passive',
\ 'active_filetypes': [],
\ 'passive_filetypes': [] }
" Folding
" Disabled due to slowness
"set foldmethod=syntax
"set foldlevelstart=99
"let g:sh_fold_enabled=1
"let javaScript_fold=1
"let perl_fold=1
"let php_folding=1
"let r_syntax_folding=1
"let ruby_fold=1
"let sh_fold_enabled=1
"let vimsyn_folding='af'
"let xml_syntax_folding=1
" Command mode completion
" See https://stackoverflow.com/questions/526858/how-do-i-make-vim-do-normal-bash-like-tab-completion-for-file-names
"set wildmode=longest,list
set wildmode=longest,list,full
set wildmenu
" Disable modelines
"
" https://lwn.net/Articles/20249/
" http://usevim.com/2012/03/28/modelines/
" http://www.techrepublic.com/blog/it-security/turn-off-modeline-support-in-vim/
set nomodeline
set modelines=0
" Color scheme
"colorscheme github
"colorscheme solarized
"colorscheme gentooish
"colorscheme revolutions
"colorscheme two2tango
"colorscheme vj
"colorscheme wood
"colorscheme zenburn
"colorscheme inkpot
if $WINDOWID != ""
colorscheme xoria256
else
colorscheme zenburn
endif
" Status and tab lines
set laststatus=2 " Always display the statusline in all windows
set showtabline=2 " Always display the tabline, even if there is only one tab
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
" Airline
if $WINDOWID != ""
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled=1
else
let g:loaded_airline = 1
endif
" Powerline
"python from powerline.vim import setup as powerline_setup
"python powerline_setup()
"python del powerline_setup
" Autoread
"
" http://vim.wikia.com/wiki/Have_Vim_check_automatically_if_the_file_has_changed_externally
" http://stackoverflow.com/questions/2490227/how-does-vims-autoread-work
" http://stackoverflow.com/questions/2490227/how-does-vims-autoread-work
"au FocusGained,BufEnter * :silent! !
"au FocusLost,WinLeave * :silent! w
" Autosave
" See https://github.com/vim-scripts/vim-auto-save
"let g:auto_save = 1
" Auto change dir
"
" Automatically set the current working directory to the current buffer file's
" directory
"
" See http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file
"set autochdir
augroup changedir
autocmd!
autocmd BufEnter * silent! lcd %:p:h
augroup END
" Session management
"
" http://usevim.com/2013/07/05/sessions/
" https://github.com/xolox/vim-session
" https://github.com/tpope/vim-obsession
" http://stackoverflow.com/questions/1642611/how-to-save-a-session-in-vim
" https://bocoup.com/weblog/sessions-the-vim-feature-you-probably-arent-using/
" http://vimdoc.sourceforge.net/htmldoc/usr_21.html#21.4
" https://github.com/xolox/vim-session?tab=readme-ov-file#options
"let g:session_autosave_periodic=1
set sessionoptions-=buffers
set sessionoptions-=blank
set sessionoptions-=resize
set sessionoptions-=winsize
set sessionoptions-=winpos
let g:session_autosave_silent=1
let g:session_autosave='yes'
let g:session_autoload='no'
let g:session_directory='~/.local/share/vim/sessions'
|