settings.vim 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. " set leader key
  2. let g:mapleader = "\<Space>"
  3. syntax enable " Enables syntax highlighing
  4. set hidden " Required to keep multiple buffers open multiple buffers
  5. set nowrap " Display long lines as just one line
  6. set encoding=utf-8 " The encoding displayed
  7. set pumheight=10 " Makes popup menu smaller
  8. set fileencoding=utf-8 " The encoding written to file
  9. set ruler " Show the cursor position all the time
  10. set cmdheight=2 " More space for displaying messages
  11. set iskeyword+=- " treat dash separated words as a word text object"
  12. set mouse=a " Enable your mouse
  13. set splitbelow " Horizontal splits will automatically be below
  14. set splitright " Vertical splits will automatically be to the right
  15. set t_Co=256 " Support 256 colors
  16. set conceallevel=0 " So that I can see `` in markdown files
  17. set tabstop=2 " Insert 2 spaces for a tab
  18. set shiftwidth=2 " Change the number of space characters inserted for indentation
  19. set smarttab " Makes tabbing smarter will realize you have 2 vs 4
  20. set expandtab " Converts tabs to spaces
  21. set smartindent " Makes indenting smart
  22. set autoindent " Good auto indent
  23. set laststatus=0 " Always display the status line
  24. set number " Line numbers
  25. set cursorline " Enable highlighting of the current line
  26. set background=dark " tell vim what the background color looks like
  27. set showtabline=2 " Always show tabs
  28. set noshowmode " We don't need to see things like -- INSERT -- anymore
  29. set nobackup " This is recommended by coc
  30. set nowritebackup " This is recommended by coc
  31. set shortmess+=c " Don't pass messages to |ins-completion-menu|.
  32. set signcolumn=yes " Always show the signcolumn, otherwise it would shift the text each time
  33. set updatetime=300 " Faster completion
  34. set timeoutlen=100 " By default timeoutlen is 1000 ms
  35. set formatoptions-=cro " Stop newline continution of comments
  36. set clipboard=unnamedplus " Copy paste between vim and everything else
  37. "set autochdir " Your working directory will always be the same as your working directory
  38. au! BufWritePost $MYVIMRC source % " auto source when writing to init.vm alternatively you can run :source $MYVIMRC
  39. autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
  40. " You can't stop me
  41. cmap w!! w !sudo tee %