aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-07-14 03:27:00 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-07-14 03:27:00 +0300
commit4e2b86f32e36b78a38b9859397f63dd262ee7225 (patch)
tree8ed32474ff463eb9050412d3d1bbd176c77722e9
parentmerge upstream bash-related dotfiles (diff)
downloadlinux-home-4e2b86f32e36b78a38b9859397f63dd262ee7225.tar.gz
linux-home-4e2b86f32e36b78a38b9859397f63dd262ee7225.zip
merge .vimrc from the upstream
-rw-r--r--.vimrc39
1 files changed, 26 insertions, 13 deletions
diff --git a/.vimrc b/.vimrc
index 1900083..dd58f44 100644
--- a/.vimrc
+++ b/.vimrc
@@ -1,7 +1,7 @@
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last change: 2014 Nov 05
+" Last change: 2016 Apr 05
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
@@ -21,14 +21,12 @@ set nocompatible
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
-"if has("vms")
+if has("vms")
set nobackup " do not keep a backup file, use versions instead
- set nowritebackup
- set noswapfile
-"else
-" set backup " keep a backup file (restore to previous version)
-" set undofile " keep an undo file (undo changes after closing)
-"endif
+else
+ set backup " keep a backup file (restore to previous version)
+ set undofile " keep an undo file (undo changes after closing)
+endif
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
@@ -49,11 +47,16 @@ if has('mouse')
set mouse=a
endif
-" Switch syntax highlighting on, when the terminal has colors
-" Also switch on highlighting the last used search pattern.
+" Switch syntax highlighting on when the terminal has colors or when using the
+" GUI (which always has colors).
if &t_Co > 2 || has("gui_running")
syntax on
+
+ " Also switch on highlighting the last used search pattern.
set hlsearch
+
+ " I like highlighting strings inside C comments.
+ let c_comment_strings=1
endif
" Only do this part when compiled with support for autocommands.
@@ -75,10 +78,8 @@ if has("autocmd")
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
- " Also don't do it when the mark is in the first line, that is the default
- " position when opening a file.
autocmd BufReadPost *
- \ if line("'\"") > 1 && line("'\"") <= line("$") |
+ \ if line("'\"") >= 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
@@ -105,6 +106,13 @@ if has('langmap') && exists('+langnoremap')
set langnoremap
endif
+
+" Add optional packages.
+"
+" The matchit plugin makes the % command work better, but it is not backwards
+" compatible.
+packadd matchit
+
color desert
set expandtab
set shiftwidth=4
@@ -117,3 +125,8 @@ set showmode
set exrc
set secure
+
+set nobackup
+set noswapfile
+set noundofile
+set nowritebackup