forked from paatre/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
140 lines (109 loc) · 3 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
" My configuration file for Vim. Used defaults.vim as a base and expanded from
" there.
"
" Maintainer: Teemu Viikeri <[email protected]>
" Last change: 2023 Oct 8
" ==========================
"
" Application level settings
"
" ==========================
" Set Vim to be non Vi-compatible
set nocompatible
" Disable Vim's swap file creation
set noswapfile
" Keep 200 lines of command line history
set history=200
" Quite a few people accidentally type "q:" instead of ":q" and get confused
" by the command line window. Give a hint about how to get out.
augroup vimHints
au!
autocmd CmdwinEnter *
\ echohl Todo |
\ echo 'You discovered the command-line window! You can close it with ":q".' |
\ echohl None
augroup END
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
" Revert with: ":delcommand DiffOrig".
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
" ==========================
"
" Mouse and keyboard settings
"
" ==========================
" Use backspace key
set backspace=indent,eol,start
" Show a few lines of context around the cursor
set scrolloff=5
" ===================
"
" Statusline settings
"
" ===================
" Always show statusline
set laststatus=2
" Set statusline format
set statusline=
" Show full file path
set statusline+=%F
" Show line and column number
set statusline+=\ %l,%c
" Display incomplete commands on the right side of the statusline
set showcmd
" Display completion matches in a status line
set wildmenu
" =================
"
" Highligh settings
"
" =================
" Use syntax highlighting
syntax on
" Switch on highlighting and incremental search
set hlsearch
set incsearch
" ================================
"
" Indentation and spacing settings
"
" ================================
" Load indentation files: indent.vim
filetype indent on
" Indenation rules
set autoindent
set smartindent
" Insert spaces instead of tabs
set expandtab
" Sets the number of spaces for a tab
set tabstop=2
" Sets the number of spaces to use when indenting
set shiftwidth=2
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
augroup END
" ===============
"
" Plugin settings
"
" ===============
" Load plugin files: ftplugin.vim
filetype plugin on
" Automatically install vim-plug if not installed yet
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Initialize vim-plug
call plug#begin('~/.vim/plugged')
" Add plugins here
" End of vim-plug section
call plug#end()