runtime! archlinux.vim set nocompatible " encodings scriptencoding utf-8 set fileencoding=utf-8 set encoding=utf-8 set fileformats=unix " Avoid infinite screen recursion unlet $SSH_CLIENT " Set sane defaults, if not using neovim already if !has('nvim') let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" " Check if the backup/swap dir exists if !isdirectory($XDG_CACHE_HOME . '/vim') silent!mkdir -p "$XDG_CACHE_HOME/vim" endif set directory=$XDG_CACHE_HOME/vim,/tmp set backupdir=$XDG_CACHE_HOME/vim,/tmp if has('viminfo') set viminfo=%,'10,<10,/200,:200,h,n$XDG_CACHE_HOME/vim/.viminfo endif set runtimepath=$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIM,$VIMRUNTIME,$VIM/vimfiles,$VIM/vimfiles/after,$VIM/vimfiles/plugin " Fix shift-tab exe 'set t_kB=' . nr2char(27) . '[Z' " Everything apparently breaks (in Neovim) if setting background = dark "set bg=dark syntax enable filetype plugin indent on endif " behaviour set history=1024 set wildmenu set ruler set cursorline set showmatch set hlsearch set incsearch set backspace=indent,eol,start set laststatus=2 set number set splitright set conceallevel=2 set scrolloff=0 set sidescrolloff=1 set display+=truncate "" Format options see :help fo- for help on each of the options " Autowrap text and comments using `textwidth`, autoinsert comment-leader, and " other leaders when wrapping, also with `gq`. set formatoptions=tcro/q " Recognize numbered lists set formatoptions+=n " Autowrap lines. set formatoptions+=bl1 " Remove comment leader when joining lines set formatoptions+=j " set formatoptions+=p set nowrap set textwidth=80 set colorcolumn=81 " tabs set expandtab set tabstop=2 set softtabstop=2 set shiftwidth=2 set smartindent set smarttab " Sets terminal title to current filename set title " Search up in every parent dir for a tags file. if has('path_extra') && (',' . &g:tags . ',') =~# ',\./tags,' setglobal tags-=./tags tags-=./tags; tags^=./tags; endif " Allow color schemes to do bright colors without forcing bold. if &t_Co == 8 && $TERM !~# '^Eterm' set t_Co=16 endif " Enable mouse support set mouse=a " Set clipboard to system one set clipboard+=unnamedplus " netrw settings let g:netrw_banner=0 let g:netrw_browse_split=1 let g:netrw_altv=4 " thematics set listchars=tab:\ \ >,extends:…,precedes:… set list " Enable termguicolors if exists('+termguicolors') let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" set termguicolors endif " Remove trailing cancer on write autocmd BufWritePre * %s/\s\+$//e let mapleader="," " Move around in insert mode with Alt+{hjkl} inoremap inoremap inoremap inoremap nnoremap h nnoremap j nnoremap k nnoremap l " Go to end/start of line, like in the shell imap A imap I " Search for VISUAL-highlighted text (very brittle) vmap // y/\V" " Wrap selection in parenthesis, hard or soft brackets vnoremap ( `>a)` vnoremap [ `>a]` vnoremap { `>a}` """ X11 specific stuff, that is also only relevant with vim "" Preserve clipboard only relevant if !has('nvim') "autocmd VimLeave * call system("xsel -ib", getreg()) "autocmd VimSuspend * call system("xsel -ib", getreg()) "" Turn on capslock LED when in insert mode. "augroup CapsLockLED " autocmd! " autocmd InsertEnter * :silent !xset led named 'Caps Lock' " autocmd InsertLeave * :silent !xset -led named 'Caps Lock' " autocmd VimLeave * :silent !xset -led named 'Caps Lock' "augroup END "" Plugin settings " junegunn/fzf.vim bindings "noremap :Files "noremap :Buffers " lervag/vimtex let g:tex_flavor='latex' let g:vimtex_view_method='zathura' let g:vimtex_quickfix_mode=0 let g:tex_conceal='abdmg' let g:vimtex_parser_bib_backend = 'bibtex' let g:vimtex_compiler_method = 'latexrun' let g:vimtex_compiler_latexrun = { \ 'backend' : 'jobs', \ 'background' : 1, \ 'build_dir' : 'latex.out', \ 'options' : [ \ '-verbose-cmds', \ '--latex-args="-synctex=1"', \ ], \} let g:latex_view_general_viewer = 'zathura' let g:vimtex_view_method = 'zathura' " tpope/vim-markdown specific settings "let g:markdown_fenced_languages = ['c', 'css', 'sh', 'vim', 'futhark'] "if has("autocmd") " augroup templates " autocmd BufNewFile *.h 0r $XDG_CONFIG_HOME/vim/templates/skeleton.h " autocmd BufNewFile *.h "s/<++DEF++>/" toupper(expand('%:t:r') . "_" . expand('%:e'))) " augroup END "endif " Change cursor to block " 1 -> solid underscore " 2 -> block " 4 -> underline " 5 -> blinking vertical bar " 6 -> solid vertical bar " 7 -> snowman "autocmd VimEnter * silent execute "!echo -e '\e[2 q'" "autocmd VimResume * silent execute "!echo -e '\e[2 q'" "autocmd VimLeave * silent execute "!echo -e '\e[6 q'" "autocmd InsertEnter * silent execute "!echo -ne '\e[6 q'" "autocmd InsertLeave * silent execute "!echo -ne '\e[2 q'" " "Start Insert-mode" line let &t_SI = "\e[6 q" " "Start Replace-mode" underscore let &t_SR = "\e[4 q" " "End Insert-mode" block let &t_EI = "\e[2 q" "autocmd VimResume * silent execute "!echo -e '\e[2 q'" "" Undercurls/spelling let &t_Cs = "\e[4:3m" let &t_Ce = "\e[4:0m" if !has('nvim') highlight SpellBad guisp=red gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=undercurl ctermul=red highlight SpellCap guisp=yellow gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=undercurl ctermul=yellow endif if has('nvim') call plug#begin() Plug 'neovim/nvim-lspconfig' " deps for haskell-tools.nvim Plug 'nvim-lua/plenary.nvim' Plug 'mfussenegger/nvim-dap' Plug 'phoityne/haskell-debug-adapter' Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.1' } Plug 'nvim-treesitter/nvim-treesitter' " For Haskell LSP (hls) Plug 'mrcjkb/haskell-tools.nvim' Plug 'neovimhaskell/haskell-vim' " Fuzzy Wuzzy Finding Plug 'junegunn/fzf.vim' " VimTex Plug 'lervag/vimtex' Plug 'tpope/vim-markdown' "" Colorschemes "Plug 'bluz71/vim-moonfly-colors', { 'as': 'moonfly' } "Plug 'pineapplegiant/spaceduck', { 'branch': 'main' } Plug 'ghifarit53/tokyonight-vim' "Plug 'folke/tokyonight.nvim' Plug 'oxfist/night-owl.nvim' Plug '0undefined/futhark.vim' call plug#end() endif colorscheme night-owl