You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.4 KiB

2 years ago
  1. filetype plugin indent on
  2. filetype on
  3. " options
  4. set nu
  5. set rnu
  6. set mouse+=a
  7. set linebreak
  8. set shiftwidth=2
  9. set tabstop=2
  10. set softtabstop=2
  11. set expandtab
  12. set smarttab
  13. set shiftround
  14. set autoindent
  15. set textwidth=80
  16. set colorcolumn=80
  17. set list
  18. set nowrap
  19. set undofile nohlsearch incsearch
  20. set scrolloff=7
  21. autocmd FileType tex,text set nosmarttab autoindent
  22. autocmd Filetype python set textwidth=0 formatprg=autopep8 shiftwidth=4 tabstop=4 softtabstop=4
  23. autocmd FileType c,cpp,slang set nosmarttab autoindent
  24. autocmd Filetype markdown set nosmarttab shiftwidth=4 tabstop=4 softtabstop=4 autoindent
  25. " Remaps
  26. let g:mapleader=" "
  27. nnoremap j gj
  28. nnoremap k gk
  29. nnoremap <C-h>, <C-w>h
  30. nnoremap <C-j>, <C-w>j
  31. nnoremap <C-k>, <C-w>k
  32. nnoremap <C-l>, <C-w>l
  33. nnoremap <C-h> <C-w>h
  34. nnoremap <C-j> <C-w>j
  35. nnoremap <C-k> <C-w>k
  36. nnoremap <C-l> <C-w>l
  37. inoremap <A-a> ā
  38. inoremap <A-e> ē
  39. inoremap <A-i> ī
  40. inoremap <A-o> ō
  41. inoremap <A-u> ū
  42. nnoremap <F12> :w<BAR>:!texbld run compile<CR>
  43. nnoremap <F5> :w<BAR>:!./test.sh<CR>
  44. vnoremap J :m '>+1<CR>gv=gv
  45. vnoremap K :m '<-2<CR>gv=gv
  46. nnoremap J mzJ`z
  47. nnoremap <C-d> <C-d>zz
  48. nnoremap <C-u> <C-u>zz
  49. nnoremap n nzzzv
  50. nnoremap N Nzzzv
  51. xnoremap <leader>p _dP
  52. vnoremap <leader>y +y
  53. nnoremap <leader>y +y
  54. nnoremap <leader>Y +Y
  55. nnoremap <leader>x :!chmod +x %:p<CR>
  56. nnoremap <leader>X :!chmod -x %<CR>
  57. nnoremap <leader>e :! %:p<CR>
  58. " Status Line
  59. " https://www.tdaly.co.uk/projects/vim-statusline-generator/
  60. "