Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Show line numbers, enable syntax highlighting and indentation
- set number
- syntax on
- " Makes sure no unsafe commands can be run in files not owned by me
- set secure
- " Use true colors
- set termguicolors
- " Set colorscheme
- colorscheme solarized8_dark_high
- " Set space/tab behaviour for filetypes
- autocmd FileType haskell setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab
- autocmd FileType cpp setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab
- " Set .h files to be detected as C by default
- autocmd BufNewFile,BufRead *.h set filetype=c
- " Scroll when 5 lines near the top and bottom
- set scrolloff=5
- " Better splits navigation
- nnoremap <C-J> <C-W><C-J>
- nnoremap <C-K> <C-W><C-K>
- nnoremap <C-L> <C-W><C-L>
- nnoremap <C-H> <C-W><C-H>
- set splitbelow
- set splitright
- " Ctags configuration
- set tags=./tags,tags;$HOME
- " Load plugins
- call plug#begin("~/.local/share/nvim/plugged")
- " Default to LaTeX
- let g:tex_flavor = "latex"
- " Vim-airline options
- Plug 'vim-airline/vim-airline'
- Plug 'vim-airline/vim-airline-themes'
- let g:airline_theme='solarized'
- let g:airline_solarized_bg='dark'
- let g:airline_highlighting_cache = 1
- " ALE options
- Plug 'w0rp/ale'
- let c_base_opts = '-std=gnu11 -Wall -Wextra -Iinclude'
- let g:ale_sign_column_always = 1
- let g:ale_set_highlights = 0
- let g:ale_lint_on_enter = 0
- let g:ale_completion_enabled = 1
- let g:ale_rust_rls_toolchain = 'stable'
- let g:ale_c_gcc_options = c_base_opts
- let g:ale_pattern_options = {
- \ '.*byteos/.*\.[ch]$': {
- \ 'ale_c_gcc_options': c_base_opts . ' -ffreestanding -Iinclude/kernel',
- \ 'ale_c_gcc_executable': 'x86_64-elf-gcc',
- \ 'ale_linters': {
- \ 'c': ['gcc']
- \ },
- \ },
- \}
- let g:ale_linters = {
- \ 'python': [],
- \ 'javascript': [],
- \ 'json': [],
- \ 'asm': [],
- \ 'c': ['gcc'],
- \ 'rust': ['rls'],
- \}
- " Allow cycling through autocomplete options with tab
- inoremap <silent><expr> <Tab> pumvisible() ? "\<C-n>" : "\<TAB>"
- " GLSL syntax support
- Plug 'tikhomirov/vim-glsl'
- " NERDTree options
- Plug 'scrooloose/nerdtree'
- let NERDTreeWinSize = 20
- let NERDTreeIgnore = ['\.o$', '\.d$', '\.orig$', '^node_modules$', '^tags$', '^target$']
- autocmd StdinReadPre * let s:std_in = 1
- autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
- " Haskell-vim options
- Plug 'neovimhaskell/haskell-vim'
- let g:haskell_indent_before_where = -2
- let g:haskell_indent_after_bare_where = 2
- " Vim-opencl options
- Plug 'petRUShka/vim-opencl'
- call plug#end()
Add Comment
Please, Sign In to add comment