Guest User

Untitled

a guest
Dec 8th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 2.52 KB | None | 0 0
  1. " Show line numbers, enable syntax highlighting and indentation
  2. set number
  3. syntax on
  4.  
  5. " Makes sure no unsafe commands can be run in files not owned by me
  6. set secure
  7.  
  8. " Use true colors
  9. set termguicolors
  10.  
  11. " Set colorscheme
  12. colorscheme solarized8_dark_high
  13.  
  14. " Set space/tab behaviour for filetypes
  15. autocmd FileType haskell setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab
  16. autocmd FileType cpp setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab
  17.  
  18. " Set .h files to be detected as C by default
  19. autocmd BufNewFile,BufRead *.h set filetype=c
  20.  
  21. " Scroll when 5 lines near the top and bottom
  22. set scrolloff=5
  23.  
  24. " Better splits navigation
  25. nnoremap <C-J> <C-W><C-J>
  26. nnoremap <C-K> <C-W><C-K>
  27. nnoremap <C-L> <C-W><C-L>
  28. nnoremap <C-H> <C-W><C-H>
  29. set splitbelow
  30. set splitright
  31.  
  32. " Ctags configuration
  33. set tags=./tags,tags;$HOME
  34.  
  35. " Load plugins
  36. call plug#begin("~/.local/share/nvim/plugged")
  37.  
  38. " Default to LaTeX
  39. let g:tex_flavor = "latex"
  40.  
  41. " Vim-airline options
  42. Plug 'vim-airline/vim-airline'
  43. Plug 'vim-airline/vim-airline-themes'
  44. let g:airline_theme='solarized'
  45. let g:airline_solarized_bg='dark'
  46. let g:airline_highlighting_cache = 1
  47.  
  48. " ALE options
  49. Plug 'w0rp/ale'
  50. let c_base_opts = '-std=gnu11 -Wall -Wextra -Iinclude'
  51. let g:ale_sign_column_always = 1
  52. let g:ale_set_highlights = 0
  53. let g:ale_lint_on_enter = 0
  54. let g:ale_completion_enabled = 1
  55. let g:ale_rust_rls_toolchain = 'stable'
  56. let g:ale_c_gcc_options = c_base_opts
  57. let g:ale_pattern_options = {
  58. \  '.*byteos/.*\.[ch]$': {
  59. \    'ale_c_gcc_options': c_base_opts . ' -ffreestanding -Iinclude/kernel',
  60. \    'ale_c_gcc_executable': 'x86_64-elf-gcc',
  61. \    'ale_linters': {
  62. \   'c': ['gcc']
  63. \    },
  64. \  },
  65. \}
  66. let g:ale_linters = {
  67. \ 'python': [],
  68. \ 'javascript': [],
  69. \ 'json': [],
  70. \ 'asm': [],
  71. \ 'c': ['gcc'],
  72. \ 'rust': ['rls'],
  73. \}
  74.  
  75. " Allow cycling through autocomplete options with tab
  76. inoremap <silent><expr> <Tab> pumvisible() ? "\<C-n>" : "\<TAB>"
  77.  
  78. " GLSL syntax support
  79. Plug 'tikhomirov/vim-glsl'
  80.  
  81. " NERDTree options
  82. Plug 'scrooloose/nerdtree'
  83. let NERDTreeWinSize = 20
  84. let NERDTreeIgnore = ['\.o$', '\.d$', '\.orig$', '^node_modules$', '^tags$', '^target$']
  85. autocmd StdinReadPre * let s:std_in = 1
  86. autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
  87.  
  88. " Haskell-vim options
  89. Plug 'neovimhaskell/haskell-vim'
  90. let g:haskell_indent_before_where = -2
  91. let g:haskell_indent_after_bare_where = 2
  92.  
  93. " Vim-opencl options
  94. Plug 'petRUShka/vim-opencl'
  95.  
  96. call plug#end()
Add Comment
Please, Sign In to add comment