SHARE
TWEET

Untitled

a guest Sep 30th, 2016 203 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. " An example for a vimrc file.
  3. " - Modified by George Bakewell
  4. "
  5. " Maintainer:  Bram Moolenaar <Bram@vim.org>
  6. " Last change:  2008 Dec 17
  7. "
  8. " To use it, copy it to
  9. "     for Unix and OS/2:  ~/.vimrc
  10. "        for Amiga:  s:.vimrc
  11. "  for MS-DOS and Win32:  $VIM\_vimrc
  12. "      for OpenVMS:  sys$login:.vimrc
  13.  
  14. " When started as "evim", evim.vim will already have done these settings.
  15. if v:progname =~? "evim"
  16.   finish
  17. endif
  18.  
  19. " Use Vim settings, rather than Vi settings (much better!).
  20. " This must be first, because it changes other options as a side effect.
  21. set nocompatible
  22.  
  23. " Also, enable pathogen now - George Bakewell
  24. execute pathogen#infect()
  25.  
  26. " allow backspacing over everything in insert mode
  27. set backspace=indent,eol,start
  28.  
  29. set nobackup    " do not keep a backup file, use versions instead
  30. set history=25    " keep 50 lines of command line history
  31. set ruler    " show the cursor position all the time
  32. set showcmd    " display incomplete commands
  33. set incsearch    " do incremental searching
  34.  
  35. " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
  36. " let &guioptions = substitute(&guioptions, "t", "", "g")
  37.  
  38. " Don't use Ex mode, use Q for formatting
  39. map Q gq
  40.  
  41. " CTRL-U in insert mode deletes a lot.  Use CTRL-G u to first break undo,
  42. " so that you can undo CTRL-U after inserting a line break.
  43. inoremap <C-U> <C-G>u<C-U>
  44.  
  45. " In many terminal emulators the mouse works just fine, thus enable it.
  46. if has('mouse')
  47. " set mouse=a // I am not so sure I want to be using a mouse
  48. endif
  49.  
  50. " Kick vim into recognising that this terminal can support 256 colors
  51. if $TERM == "xterm-256color" || $TERM == "screen-256color" || $COLORTERM == "gnome-terminal"
  52.   set t_Co=256
  53. endif
  54.  
  55. " Switch syntax highlighting on, when the terminal has colors
  56. " Also switch on highlighting the last used search pattern.
  57. if &t_Co > 2 || has("gui_running")
  58.   syntax on
  59.   " Set my preferred color scheme
  60.   colorscheme lucario
  61.   set hlsearch
  62. endif
  63.  
  64. " Only do this part when compiled with support for autocommands.
  65. if has("autocmd")
  66.  
  67.   " Enable file type detection.
  68.   " Use the default filetype settings, so that mail gets 'tw' set to 72,
  69.   " 'cindent' is on in C files, etc.
  70.   " Also load indent files, to automatically do language-dependent indenting.
  71.   filetype plugin indent on
  72.  
  73.   " Put these in an autocmd group, so that we can delete them easily.
  74.   augroup vimrcEx
  75.   au!
  76.  
  77.   " For all text files set 'textwidth' to 80 characters - the default was 78,
  78.   " I changed it to 80 - George
  79.   autocmd FileType text setlocal textwidth=80
  80.  
  81.   " When editing a file, always jump to the last known cursor position.
  82.   " Don't do it when the position is invalid or when inside an event handler
  83.   " (happens when dropping a file on gvim).
  84.   " Also don't do it when the mark is in the first line, that is the default
  85.   " position when opening a file.
  86.   autocmd BufReadPost *
  87.     \ if line("'\"") > 1 && line("'\"") <= line("$") |
  88.     \   exe "normal! g`\"" |
  89.     \ endif
  90.  
  91.   augroup END
  92.  
  93. else
  94.  
  95.   set autoindent    " always set autoindenting on
  96.  
  97. endif
  98.  
  99. " Convenient command to see the difference between the current buffer and the
  100. " file it was loaded from, thus the changes you made.
  101. " Only define it when not defined already.
  102. if !exists(":DiffOrig")
  103.   command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
  104.       \ | wincmd p | diffthis
  105. endif
  106.  
  107. " My preferred tab size: 2 space indents
  108. set shiftwidth=2
  109. set softtabstop=2
  110. set expandtab
  111. set smarttab
  112.  
  113. " Plugin stuff.
  114. " First, I want the beautiful |airline| to use the beautiful powerline
  115. " symbols.
  116. let g:airline_powerline_fonts = 1
  117. " Remove the pause after exiting insert mode
  118. set ttimeoutlen=10
  119. " Make the status bar alwaysvisible, even when editing just one window.
  120. set laststatus=2
  121.  
  122. " I want to be able to avoid having to backspace through a prepended comment
  123. " after pressing o or O
  124. autocmd FileType * set formatoptions-=o
  125.  
  126. " New function for enter key: insert a new line without entering insert mode
  127. nmap <CR> o<Esc>
  128. " Map Ctrl+N to NerdTree
  129. map <C-n> :NERDTreeToggle<CR>
  130. " Map Ctrl+B to run node on the package in a javascript file
  131. nmap <C-b> :!npm start<CR>
  132. " Map insert-mode esc to esc and then move right
  133. inoremap <Esc> <Esc>l
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top