-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
179 lines (131 loc) · 4.23 KB
/
.vimrc
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
" ------------------------------------------------------------
" [[ vim ]] - minimal configuration
" ------------------------------------------------------------
" Make Vim more useful
set nocompatible
" Use UTF-8 without BOM
set encoding=utf-8 nobomb
" Show the filename in the window titlebar
set title
" Always show status line
set laststatus=2
" Enable syntax highlighting
syntax on
" Enable file type detection
filetype on
" Set bg dark/light
set background=dark
" enable 24-bit RGB colors
set termguicolors
" set color scheme
" colorscheme one
" colorscheme slate
colorscheme wildcharm
" Disable word wrap
set nowrap
" Enable line numbers
set number
" Highlight current line
set cursorline
" enable folding (default "foldmarker")
set foldmethod=marker
" intro / messages / hit-enter prompts / ins-completion-men
set shortmess=actIsoOFW
" signcolumn
set signcolumn=auto
" Enable mouse in all modes
" set mouse=a
" min number of screen lines above/below the cursor
set scrolloff=2
" vertical split to the right
set splitright
" system clipboard
set clipboard=unnamed,unnamedplus
" ignore case in search patterns
set ignorecase
" override the ignorecase option if the search containse upper characters
set smartcase
" Highlight searches
set hlsearch
" Highlight dynamically as pattern is typed
set incsearch
" complete menu
set completeopt=menu,menuone,noselect
" Reload file on external change
set autoread
" Backups
set nobackup
set noswapfile
set noundofile
set nowritebackup
" tabs indent
set tabstop=2 " 1 tab == 2 spaces
set shiftwidth=2 " indent is 2 spaces
set softtabstop=2 " insert 2 spaces when tab is pressed
set expandtab " use spaces instead of tabs
set smartindent " autoindent new lines
" Enhance command-line completion
set wildmenu
" Optimize for fast terminal connections
set ttyfast
" Don't reset cursor to start of line when moving around
set nostartofline
" Show the cursor position
set ruler
" Show the current mode
set showmode
" Show the (partial) command as it's being typed
set showcmd
" Don't add empty newlines at the end of binary files
set binary
set noeol
" Respect modeline in files
set modeline
set modelines=4
" Allow backspace in insert mode
set backspace=indent,eol,start
" If this many milliseconds nothing is typed the swap file will be written to disk
set updatetime=1024
" Allow cursor keys in insert mode
set esckeys
" list
set nolist
set listchars=eol:¬,tab:›-,trail:~,extends:»,precedes:«
" Adjust cursor blink rate
" Default is blinkwait700-blinkon400-blinkoff250
set guicursor=n:blinkwait1024-blinkon1024-blinkoff512
" ------------------------------------------------------------
" omni completion
" ------------------------------------------------------------
set omnifunc=syntaxcomplete#Complete
" ------------------------------------------------------------
" Pmenu
" ------------------------------------------------------------
highlight Pmenu ctermfg=White ctermbg=Black
highlight PmenuSel ctermfg=White ctermbg=Red
" ------------------------------------------------------------
" ------------------------------------------------------------
" Save a file as root (,W)
" ------------------------------------------------------------
noremap <leader>W :w !sudo tee % > /dev/null<CR>
" ------------------------------------------------------------
" Visually select and press CTRL+C to yank to system clipboard
" ------------------------------------------------------------
vnoremap <C-c> "+y
" Use <C-L> to clear the highlighting of :set hlsearch.
" ------------------------------------------------------------
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
endif
" ------------------------------------------------------------
" Automatic commands
" ------------------------------------------------------------
" Trim trailing whitespace on save
autocmd BufWritePre * :%s/\s\+$//e
" Rust
autocmd BufNewFile,BufRead *.rs setlocal tabstop=2 shiftwidth=2 softtabstop=2 noexpandtab
" ------------------------------------------------------------
" ------------------------------------------------------------
" wayland clipboard
" https://github.com/yavorski/vim-wayland-clipboard
" ------------------------------------------------------------