Advertisement
Guest User

basic .vimrc example

a guest
Feb 20th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1.  
  2. Skip to content
  3. All gists
  4. Back to GitHub
  5. Sign in
  6. Sign up
  7.  
  8. Instantly share code, notes, and snippets.
  9. @simonista simonista/.vimrc
  10. Last active 2 days ago
  11.  
  12. 255
  13.  
  14. 115
  15.  
  16. Code
  17. Revisions 3
  18. Stars 255
  19. Forks 115
  20. A basic .vimrc file that will serve as a good template on which to build.
  21. .vimrc
  22. " Don't try to be vi compatible
  23. set nocompatible
  24.  
  25. " Helps force plugins to load correctly when it is turned back on below
  26. filetype off
  27.  
  28. " TODO: Load plugins here (pathogen or vundle)
  29.  
  30. " Turn on syntax highlighting
  31. syntax on
  32.  
  33. " For plugins to load correctly
  34. filetype plugin indent on
  35.  
  36. " TODO: Pick a leader key
  37. " let mapleader = ","
  38.  
  39. " Security
  40. set modelines=0
  41.  
  42. " Show line numbers
  43. set number
  44.  
  45. " Show file stats
  46. set ruler
  47.  
  48. " Blink cursor on error instead of beeping (grr)
  49. set visualbell
  50.  
  51. " Encoding
  52. set encoding=utf-8
  53.  
  54. " Whitespace
  55. set wrap
  56. set textwidth=79
  57. set formatoptions=tcqrn1
  58. set tabstop=2
  59. set shiftwidth=2
  60. set softtabstop=2
  61. set expandtab
  62. set noshiftround
  63.  
  64. " Cursor motion
  65. set scrolloff=3
  66. set backspace=indent,eol,start
  67. set matchpairs+=<:> " use % to jump between pairs
  68. runtime! macros/matchit.vim
  69.  
  70. " Move up/down editor lines
  71. nnoremap j gj
  72. nnoremap k gk
  73.  
  74. " Allow hidden buffers
  75. set hidden
  76.  
  77. " Rendering
  78. set ttyfast
  79.  
  80. " Status bar
  81. set laststatus=2
  82.  
  83. " Last line
  84. set showmode
  85. set showcmd
  86.  
  87. " Searching
  88. nnoremap / /\v
  89. vnoremap / /\v
  90. set hlsearch
  91. set incsearch
  92. set ignorecase
  93. set smartcase
  94. set showmatch
  95. map <leader><space> :let @/=''<cr> " clear search
  96.  
  97. " Remap help key.
  98. inoremap <F1> <ESC>:set invfullscreen<CR>a
  99. nnoremap <F1> :set invfullscreen<CR>
  100. vnoremap <F1> :set invfullscreen<CR>
  101.  
  102. " Textmate holdouts
  103.  
  104. " Formatting
  105. map <leader>q gqip
  106.  
  107. " Visualize tabs and newlines
  108. set listchars=tab:▸\ ,eol:¬
  109. " Uncomment this to enable by default:
  110. " set list " To enable by default
  111. " Or use your leader key + l to toggle on/off
  112. map <leader>l :set list!<CR> " Toggle tabs and EOL
  113.  
  114. " Color scheme (terminal)
  115. set t_Co=256
  116. set background=dark
  117. let g:solarized_termcolors=256
  118. let g:solarized_termtrans=1
  119. " put https://raw.github.com/altercation/vim-colors-solarized/master/colors/solarized.vim
  120. " in ~/.vim/colors/ and uncomment:
  121. " colorscheme solarized
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement