bastelhalde.de


Philipp,

pimp my vim

thanks to the blog of Vincent Driessen

shortcuts:

  • toggle line numbers :set number (:set nonumber)
  • un/comment next 10 lines: 10+,+c+<space>
  • delete line: d+d
  • set mouse=a

prequesites:

  • install pathogen:
    mkdir -p ~/.vim/autoload ~/.vim/bundle && curl -LSso ~/.vim/autoload/pathogen.vim https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim
  • install mustang colorscheme:
    mkdir -p ~/.vim/colors && curl -LSso ~/.vim/colors/mustang.vim https://raw.githubusercontent.com/croaker/mustang-vim/master/colors/mustang.vim
  • install nerdcommenter via pathogen:
  • cd ~/.vim/bundle/: git clone https://github.com/scrooloose/nerdcommenter.git
  • ~/.vimrc:
set number
set nocompatible

execute pathogen#infect()

filetype plugin on
let mapleader=","
set timeout timeoutlen=1500

syntax on
set nowrap        " don't wrap lines
set tabstop=4     " a tab is four spaces
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set autoindent    " always set autoindenting on
set copyindent    " copy the previous indentation on autoindenting
set number        " always show line numbers
set shiftwidth=4  " number of spaces to use for autoindenting
set shiftround    " use multiple of shiftwidth when indenting with '<' and '>'
set showmatch     " set show matching parenthesis
set ignorecase    " ignore case when searching
set smartcase     " ignore case if search pattern is all lowercase,  case-sensitive otherwise
set smarttab      " insert tabs on the start of a line according to shiftwidth, not tabstop
set hlsearch      " highlight search terms
set incsearch     " show search matches as you type
set history=1000         " remember more commands and search history
set undolevels=1000      " use many muchos levels of undo
set wildignore=*.swp,*.bak,*.pyc,*.class
set title                " change the terminal's title
set visualbell           " don't beep
set noerrorbells         " don't beep
if &t_Co >= 256 || has("gui_running")
        colorscheme mustang
        endif

if &t_Co > 2 || has("gui_running")
        "switch syntax highlighting on, when the terminal has colors
         syntax on
endif

set pastetoggle=<F2>

Leave Comment: