-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_vimrc
More file actions
71 lines (61 loc) · 3.73 KB
/
Copy pathdot_vimrc
File metadata and controls
71 lines (61 loc) · 3.73 KB
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
ru! defaults.vim " Use Enhanced Vim defaults
set mouse= " Reset the mouse setting from defaults
aug vimStartup | au! | aug END " Revert last positioned jump, as it is defined below
let g:skip_defaults_vim = 1 " Do not source defaults.vim again (after loading this system vimrc)
set ai " set auto-indenting on for programming
set showmatch " automatically show matching brackets. works like it does in bbedit.
set vb " turn on the "visual bell" - which is much quieter than the "audio blink"
set laststatus=2 " make the last line where the status is two lines deep so you can see status always
set showmode " show the current mode
set clipboard=unnamed " set clipboard to unnamed to access the system clipboard under windows
set wildmode=list:longest,longest:full " Better command line completion
" Enable line numbers, whitespace visibility, and tab indicators
set number " Show absolute line numbers
set list " Enable visibility of whitespace characters
set listchars=tab:»·,trail:·,extends:>,precedes:<,space:· " Define symbols for whitespace
" Enable pasting with CTRL+V
set pastetoggle=<C-V>
" Show EOL type and last modified timestamp, right after the filename
" Set the statusline
set statusline=%f " filename relative to current $PWD
set statusline+=%h " help file flag
set statusline+=%m " modified flag
set statusline+=%r " readonly flag
set statusline+=\ [%{&ff}] " Fileformat [unix]/[dos] etc...
set statusline+=\ (%{strftime(\"%H:%M\ %d/%m/%Y\",getftime(expand(\"%:p\")))}) " last modified timestamp
set statusline+=%= " Rest: right align
set statusline+=%l,%c%V " Position in buffer: linenumber, column, virtual column
set statusline+=\ %P " Position in buffer: Percentage
" Set performance & usability enhancements
set updatetime=300 " Faster updates (default is 4000ms)
set timeoutlen=500 " Reduce time for mapped sequences
set scrolloff=8 " Keep cursor 8 lines from top/bottom when scrolling
" set cursorline " Highlight the current line
set autochdir " Automatically change the working directory to the file's location
set undofile " Enable persistent undo
set backup " Enable backup files
set swapfile " Enable swap files for recovery
set termguicolors " Enable true color support
" Set indentation & tabs
set expandtab " Use spaces instead of tabs
set shiftwidth=4 " Number of spaces per indentation level
set tabstop=4 " Number of spaces per tab character
set smartindent " Auto-indent new lines
"------------------------------------------------------------------------------
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Set UTF-8 as the default encoding for commit messages
autocmd BufReadPre COMMIT_EDITMSG,MERGE_MSG,git-rebase-todo setlocal fileencoding=utf-8
" Remember the positions in files with some git-specific exceptions"
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$")
\ && &filetype !~# 'commit\|gitrebase'
\ && expand("%") !~ "ADD_EDIT.patch"
\ && expand("%") !~ "addp-hunk-edit.diff" |
\ exe "normal! g`\"" |
\ endif
autocmd BufNewFile,BufRead *.patch set filetype=diff
autocmd Filetype diff
\ highlight WhiteSpaceEOL ctermbg=red |
\ match WhiteSpaceEOL /\(^+.*\)\@<=\s\+$/
endif " has("autocmd")