-
Notifications
You must be signed in to change notification settings - Fork 0
/
general.vim
150 lines (121 loc) · 2.59 KB
/
general.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
"" ===========================
"" General Settings for Neovim
"" ===========================
"" Required
filetype plugin indent on
"" ======================
"" Start General settings
"" ======================
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8
set bomb
set binary
set fileformat=unix
"" Fix backspace indent
set backspace=indent,eol,start
"" Tabs. May be overriten by autocmd rules
set tabstop=4
set softtabstop=0
set shiftwidth=4
set expandtab
set smarttab
"" Map leader to ,
let g:mapleader=','
"" Set lazyredraw
set lz
"" Enable hidden buffers
set hidden
"" Enable persistent undo
set undofile
if has("win32") || has("win64")
set undodir=$HOME\vimfiles\undo
else
set undodir=$HOME/.nvim/undo
endif
"" Searching
set hlsearch
set incsearch
set ignorecase
set smartcase
"" Directories for swp files
set nobackup
set noswapfile
set fileformats=unix,dos,mac
set showcmd
if exists('$SHELL')
set shell=$SHELL
else
set shell=/bin/sh
endif
if has("win32") || has("win64")
set shell=cmd
endif
"" ===============
"" Visual Settings
"" ===============
syntax on
set ruler
set number
set relativenumber
" set ch=2
set noshowmode
"" For mouse support
set mouse=a
set mousemodel=popup
"" Theme and font
set guioptions=egmrti " Gui window options
" set gfn=Monospace\ 10
set colorcolumn=79
if has('win32') || has('win64')
set gfn="Source Code Pro"\ 11
else
set gfn="Inconsolata"\ 11
endif
set termguicolors
set background=dark " or light
"" Disable the blinking cursor and center cursor on screen
" set gcr=a:blinkon0
set guicursor=
set scrolloff=5
"" Status bar
" set laststatus=2
"" Use modeline overrides
set modeline
set modelines=10
"" Title (restore title on exit)
set title
set titleold="Terminal"
set titlestring=%F
"" Status line
set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
if exists("*fugitive#statusline")
set statusline+=%{fugitive#statusline()}
endif
"" For search ignore files
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite
set wildignore+=*.o,*.obj,.git,*.rbc,*.pyc,__pycache__
set wildmode=list:longest,list:full
" Disable visualbell
set noerrorbells visualbell t_vb=
if has('autocmd')
autocmd GUIEnter * set visualbell t_vb=
endif
"" Copy/Paste/Cut
if has('unnamedplus')
set clipboard+=unnamed,unnamedplus
" set clipboard+=unnamed
endif
"" Auto read changed files (not periodic)
set autoread
"" no one is really happy until you have this shortcuts
cnoreabbrev W! w!
cnoreabbrev Q! q!
cnoreabbrev Qall! qall!
cnoreabbrev Wq wq
cnoreabbrev Wa wa
cnoreabbrev wQ wq
cnoreabbrev WQ wq
cnoreabbrev W w
cnoreabbrev Q q
cnoreabbrev Qall qall