Commits

Oliver Schneider committed 5628ba2

- Some minor adjustments to the .vimrc to make it fit better :)

  • Participants
  • Parent commits d008bd3

Comments (0)

Files changed (1)

+set nocompatible
+
 set background=dark " using dark terminal make certain elements a little brighter ;)
 set backspace=indent,eol,start " make backspace more convenient
 
 " Load plugins
 runtime ftplugin/man.vim
 
-" Tab related settings
+" Indentation/tab related settings
 set tabstop=4
 set shiftwidth=4
 set softtabstop=4
 set noexpandtab
-set nocompatible
 set autoindent
 set smartindent
-set showmatch
-set list
-set ruler        " show the cursor position all the time
+
+" General settings
 set history=1000 " store lots of :cmdline history
 set showmode     " show current mode down the bottom
 set nowrap       " dont wrap lines
 set linebreak    " wrap lines at convenient points
 set wildmode=list:longest,full " make cmdline tab completion similar to bash
-set wildmenu     " enable ctrl-n and ctrl-p to scroll thru matches
+set wildmenu     " enable ctrl-n and ctrl-p to scroll through matches
 set scrolloff=3  " keep 3 lines when scrolling
 set nobackup     " do not keep a backup file
-" set title        " show title in console title bar
-set wrap!        " turn off word wrapping
-" set off the other paren
-highlight MatchParen ctermbg=4
-" quickly set comma or semicolon at the end of the string
-"inoremap ,, <End>,
-"inoremap ;; <End>;
-" allow command mode with semi-colon, and comma
+" allow command mode with semi-colon
 noremap ; :
-noremap , ;
-" toggle line numbers
-nmap <C-N><C-N> <silent>:set invnumber<CR>
-highlight LineNr term=reverse cterm=NONE ctermfg=DarkGrey ctermbg=NONE
-set nonumber " but turn off line numbers by default
-" status line
+
+" status line and layout of the work space
 set laststatus=2
 set statusline=%F%m%r%h%w\ (%{&ff}){%Y}\ [%l,%v][%p%%]
+set showmatch
+set list
+set number
+set ruler        " show the cursor position all the time
+" default status line setting
+highlight StatusLine term=reverse cterm=NONE ctermfg=2 ctermbg=NONE
+
 " search-related
 set incsearch    " find the next match as we type the search
 set hlsearch     " highlight searches by default
-" ... and how to get rid of the highlights? Like so:
-"nnoremap <esc> <silent>:noh<return><esc> <--- behaves weird ...
-nnoremap <CR> <silent>:noh<CR><CR>
 set ignorecase   " ignore case when searching
+set smartcase    " ... but only when typing all lowercase, otherwise case-sensitive
+" ... and how to get rid of the highlighted search matches? Like so:
+nmap <leader>h :nohl<CR>
 
-set smartcase
 " syntax highlighting
 filetype on
 filetype plugin on
 filetype indent on
 syntax on
-" set paste
 if version >= 700
-  set showcmd      " show incomplete cmds down the bottom
-  nmap <C-t> :tabnew<CR>
-  imap <C-t> <Esc>:tabnew<CR>
-  map  <F11> :tabprevious <CR>
-  map  <F12> :tabnext     <CR>
-  nmap <F11> :tabprevious <CR>
-  nmap <F12> :tabnext     <CR>
-  imap <F11> :tabprevious <CR>
-  imap <F12> :tabnext     <CR>
-  set spl=en spell  " use English for spellchecking
-  set nospell       " but don't spellcheck by default
-  set numberwidth=4 " width for line number gutter
-  au FileType python inoremap :: <End>:
-  " now set it up to change the status line based on mode
-  au InsertLeave * highlight StatusLine term=reverse cterm=NONE ctermfg=2 ctermbg=NONE
-  au InsertEnter * highlight StatusLine term=reverse cterm=NONE ctermfg=DarkGrey ctermbg=NONE
+	set showcmd      " show incomplete cmds down the bottom
+	nmap <C-t> :tabnew<CR>
+	imap <C-t> <Esc>:tabnew<CR>
+	map  <F11> :tabprevious <CR>
+	map  <F12> :tabnext     <CR>
+	nmap <F11> :tabprevious <CR>
+	nmap <F12> :tabnext     <CR>
+	imap <F11> :tabprevious <CR>
+	imap <F12> :tabnext     <CR>
+	set spl=en spell  " use English for spellchecking
+	set nospell       " but don't spellcheck by default
+	set numberwidth=4 " width for line number gutter
+	au FileType python inoremap :: <End>:
+	" now set it up to change the status line based on mode
+	au InsertLeave * highlight StatusLine term=reverse cterm=NONE ctermfg=2 ctermbg=NONE
+	au InsertEnter * highlight StatusLine term=reverse cterm=NONE ctermfg=DarkGrey ctermbg=NONE
 endif
-" default status line setting
-highlight StatusLine term=reverse cterm=NONE ctermfg=2 ctermbg=NONE
 " Allow saving of files as sudo when I forgot to start vim using sudo.
 " http://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work
 cmap w!! %!sudo tee > /dev/null %
+"command! -bar -nargs=0 SudoW :silent exe "write !sudo tee % >/dev/null" | silent edit!
 
 " Shortcut to rapidly toggle `set list`
-nmap <leader>l :set list!<CR>
+nmap <leader>l :set list!<CR>:set number!<CR>
 
 " Use the same symbols as TextMate for tabstops and EOLs
 if &encoding == 'utf-8'
 endif
 highlight NonText ctermfg=DarkGrey guifg=#4a4a59
 highlight SpecialKey ctermfg=DarkGrey guifg=#4a4a59
+" Matching parentheses should be highlighted
+highlight MatchParen ctermbg=4
+highlight LineNr term=reverse cterm=NONE ctermfg=DarkGrey ctermbg=NONE
+" Highlight odd tabs in the middle of the line
+match errorMsg /[^\t]\zs\t\+/