etc/vimrc

379 lines
9.3 KiB
VimL
Raw Normal View History

se nocompatible
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
2015-02-16 18:04:52 +00:00
Plug 'ntpeters/vim-better-whitespace'
2015-03-14 09:10:15 +00:00
Plug 'nathanaelkane/vim-indent-guides'
2015-02-16 18:04:52 +00:00
2015-01-03 11:16:22 +00:00
Plug 'chrisbra/Recover.vim'
Plug 'Shougo/vimproc.vim' , { 'do': 'make -f make_unix.mak' }
Plug 'ciaranm/securemodelines'
2014-08-10 07:25:50 +00:00
Plug 'chrisbra/SudoEdit.vim'
2014-08-18 14:42:57 +00:00
Plug 'majutsushi/tagbar'
Plug 'bling/vim-airline'
Plug 'tomtom/tcomment_vim'
2015-01-03 11:16:22 +00:00
" Plug 'jalcine/cmake.vim' --slow
2014-08-30 06:16:58 +00:00
Plug 'editorconfig/editorconfig-vim'
" vim-sleuth?
2021-06-09 13:41:19 +00:00
" Plug 'kchmck/vim-coffee-script' " BANNED for messing with html indentation
2015-02-09 13:02:50 +00:00
Plug 'pangloss/vim-javascript'
Plug 'mtscout6/vim-cjsx'
Plug 'mxw/vim-jsx'
Plug 'othree/html5.vim'
Plug 'digitaltoad/vim-jade'
2015-02-09 13:02:50 +00:00
Plug 'ledger/vim-ledger'
2014-08-31 11:39:39 +00:00
Plug 'dag/vim2hs'
2014-06-01 12:13:23 +00:00
2015-01-03 11:16:22 +00:00
" clojure
Plug 'tpope/vim-leiningen'
Plug 'tpope/vim-projectionist'
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-fireplace'
2014-06-01 12:13:23 +00:00
Plug 'jnwhiteh/vim-golang'
Plug 'Blackrush/vim-gocode'
2014-06-01 12:13:23 +00:00
Plug 'zah/nimrod.vim'
2014-06-01 12:13:23 +00:00
Plug 'wting/rust.vim'
2017-03-31 07:55:12 +00:00
Plug 'cespare/vim-toml'
2014-06-01 12:13:23 +00:00
Plug 'derekwyatt/vim-scala'
2014-06-01 12:13:23 +00:00
Plug 'dogrover/vim-pentadactyl'
Plug 'superbrothers/vim-vimperator'
2014-06-14 11:26:00 +00:00
Plug 'idris-hackers/idris-vim'
2014-07-13 11:29:14 +00:00
2019-04-14 12:21:58 +00:00
Plug 'tpope/vim-fugitive' " git integration
Plug 'airblade/vim-gitgutter'
2014-07-18 06:41:58 +00:00
2017-10-10 07:31:04 +00:00
Plug 'lervag/vimtex'
Plug 'kana/vim-textobj-user'
Plug 'kana/vim-textobj-indent'
2015-03-13 18:13:54 +00:00
Plug 'rhysd/vim-grammarous'
2014-10-24 05:32:52 +00:00
Plug 'tpope/vim-surround'
2018-03-25 12:09:12 +00:00
Plug 'tpope/vim-characterize'
2014-10-24 05:32:59 +00:00
Plug 'peterhoeg/vim-qml'
2014-11-25 13:55:00 +00:00
Plug 'ekalinin/Dockerfile.vim'
2015-02-16 18:04:52 +00:00
Plug 'jvoorhis/coq.vim'
Plug 'LnL7/vim-nix'
2015-03-13 18:13:54 +00:00
2015-03-14 09:10:15 +00:00
Plug 'urbit/hoon.vim'
2015-07-12 13:34:07 +00:00
Plug 'ahf/twelf-syntax'
2015-09-15 17:20:37 +00:00
Plug 'c-cube/vim-tptp'
2019-04-07 12:06:33 +00:00
Plug 'sirtaj/vim-openscad'
Plug 'nanotech/jellybeans.vim'
Plug 'sonph/onehalf', { 'rtp': 'vim' }
2021-05-23 18:55:38 +00:00
" Plug '~/dgapt', { 'rtp': 'vim' }
2016-08-14 18:45:21 +00:00
2018-06-01 07:50:42 +00:00
Plug 'rickhowe/diffchar.vim'
2016-04-15 14:29:26 +00:00
Plug 'raichoo/smt-vim'
2016-07-24 16:50:12 +00:00
Plug 'tkztmk/vim-vala'
2018-03-25 12:09:12 +00:00
Plug 'wlangstroth/vim-racket'
2018-10-09 10:03:23 +00:00
Plug 'dag/vim-fish'
2020-07-14 15:49:29 +00:00
Plug 'elixir-editors/vim-elixir'
" Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } }
2021-05-23 18:55:38 +00:00
if has('nvim-0.5')
2021-08-05 09:41:59 +00:00
Plug 'nvim-lua/plenary.nvim'
2021-05-23 18:55:38 +00:00
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-treesitter/nvim-treesitter-textobjects'
Plug 'nvim-treesitter/playground'
Plug 'hrsh7th/nvim-compe'
if isdirectory(expand('~/lean.nvim'))
Plug '~/lean.nvim'
else
2021-05-31 08:59:01 +00:00
Plug 'Julian/lean.nvim'
endif
2021-05-23 18:55:38 +00:00
Plug 'neovim/nvim-lspconfig'
2021-05-24 10:16:15 +00:00
Plug 'folke/lua-dev.nvim'
2021-05-24 13:06:55 +00:00
Plug 'simrat39/rust-tools.nvim'
2021-05-24 10:16:15 +00:00
2021-05-30 08:58:23 +00:00
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
else
Plug 'junegunn/fzf', { 'dir': '~/.fzf' }
Plug 'junegunn/fzf.vim'
2021-05-23 18:55:38 +00:00
endif
call plug#end()
2014-06-14 17:47:10 +00:00
filetype plugin indent on
2013-12-29 17:32:58 +00:00
set tw=0 expandtab ts=8 sts=2 sw=2 sm ai si
2014-08-18 14:42:57 +00:00
set noml mls=5 " scan 5 lines for modelines
syn on " enable syntax highlighting
set hls " highlight search
set bg=dark " dark background
2016-01-05 12:18:57 +00:00
se foldlevel=99
set vb " turn on the "visual bell" - which is much quieter than the "audio blink"
set nobackup
se bs=2
2021-05-24 17:33:12 +00:00
se nosc " disable flashing partial commands in status bar
2019-10-01 08:51:51 +00:00
set backupcopy=yes
2019-03-13 09:24:12 +00:00
se inccommand=nosplit
set mouse=
2016-01-05 12:18:57 +00:00
set title
2021-05-24 13:06:55 +00:00
se scl=yes:1 " say no to wobbly side column
2021-05-24 09:50:36 +00:00
let mapleader=" "
2019-03-11 10:44:44 +00:00
let g:jellybeans_overrides = {
\ 'background': { 'guibg': '000000' },
2021-04-02 19:29:09 +00:00
\ 'Normal': { 'guifg': 'ffffff' },
\ 'SignColumn': { 'guibg': '191919' },
2019-03-11 10:44:44 +00:00
\}
if exists('g:started_by_firenvim')
set bg=light
colors onehalflight
else
colors jellybeans
endif
2019-03-13 09:23:00 +00:00
au syntax java setl ts=4 sts=4 sw=4
2016-01-05 12:18:57 +00:00
2019-03-13 09:23:00 +00:00
au BufNewFile,BufRead *.s setl ft=tptp
au BufNewFile,BufRead *.s.out setl ft=tptp
au BufNewFile,BufRead *.tptp setl ft=tptp
au BufNewFile,BufRead *.smt2 setl ft=smt
2016-01-05 12:18:57 +00:00
2013-03-29 14:24:24 +00:00
au BufReadCmd *.epub call zip#Browse(expand("<amatch>"))
2020-07-14 11:15:57 +00:00
au BufReadCmd *.FCStd call zip#Browse(expand("<amatch>"))
2016-01-05 12:18:57 +00:00
2014-10-09 20:11:42 +00:00
let g:haskell_conceal = 0
2013-05-19 21:33:53 +00:00
2018-04-13 16:02:45 +00:00
call tcomment#type#Define('nix', '# %s')
call tcomment#type#Define('chaskell', '-- %s')
call tcomment#type#Define('vala', '// %s')
2020-06-25 12:03:57 +00:00
call tcomment#type#Define('tptp', '%% %s')
2021-05-28 12:17:40 +00:00
call tcomment#type#Define('lean', '-- %s')
2017-10-10 07:31:04 +00:00
2016-01-05 12:18:57 +00:00
au syntax tex setl iskeyword+=:
au syntax tex syn region texZone start="\\begin{clilisting}" end="\\end{clilisting}\|%stopzone\>"
2016-04-15 14:29:26 +00:00
au syntax tex syn region texZone start="\\begin{tacticslisting}" end="\\end{tacticslisting}\|%stopzone\>"
au syntax tex syn region texZone start="\\begin{tacticsoutput}" end="\\end{tacticsoutput}\|%stopzone\>"
2015-11-26 20:45:12 +00:00
2014-09-28 07:31:52 +00:00
" disable annoying "file is read-only" warnings
au FileChangedRO * set noreadonly
2021-05-23 18:55:38 +00:00
if has('nvim-0.5')
lua <<EOF
require('lean').setup{
2021-06-02 09:04:07 +00:00
abbreviations = {
extras = {
['.'] = '·',
},
2021-06-03 18:12:07 +00:00
builtin = true,
2021-06-02 09:04:07 +00:00
},
2021-06-02 15:56:28 +00:00
-- treesitter = {},
2021-05-23 18:55:38 +00:00
lsp = {
on_attach = function(client, bufnr)
vim.api.nvim_exec([[
augroup lsp_document_highlight
autocmd!
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]], false)
end,
init_options = {
semanticHighlighting = true,
},
cmd = {"lean", "--server"},
},
}
require('nvim-treesitter.configs').setup{
-- playground = {
-- enable = true,
-- disable = {},
-- updatetime = 25,
-- },
-- query_linter = {
-- enable = true,
-- use_virtual_text = true,
-- lint_events = {"BufWrite", "CursorHold"},
-- },
highlight = { enable = true },
indent = { enable = true },
textobjects = {
select = {
enable = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
},
},
},
}
2021-05-24 09:50:36 +00:00
require'compe'.setup {
enabled = true;
2021-05-25 16:39:56 +00:00
autocomplete = false;
2021-05-24 09:50:36 +00:00
debug = false;
min_length = 1;
preselect = 'enable';
throttle_time = 80;
source_timeout = 200;
incomplete_delay = 400;
max_abbr_width = 100;
max_kind_width = 100;
max_menu_width = 100;
documentation = true;
source = {
path = true;
buffer = true;
calc = true;
nvim_lsp = true;
2021-06-02 15:56:28 +00:00
-- emoji = true;
2021-05-24 09:50:36 +00:00
};
}
2021-05-28 12:17:40 +00:00
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
-- Enable underline, use default values
underline = true,
-- Enable virtual text, override spacing to 4
virtual_text = {
spacing = 4,
},
-- Use a function to dynamically turn signs off
-- and on, using buffer local variables
-- signs = function(bufnr, client_id)
-- return vim.bo[bufnr].show_signs == false
-- end,
update_in_insert = true,
})
2021-05-24 10:16:15 +00:00
local luadev = require("lua-dev").setup({
lspconfig = {
cmd = {"lua-language-server"}
},
})
local lspconfig = require('lspconfig')
lspconfig.sumneko_lua.setup(luadev)
2021-05-24 12:51:52 +00:00
lspconfig.ccls.setup{}
2021-05-24 13:06:55 +00:00
lspconfig.pyright.setup{}
lspconfig.tsserver.setup{}
2021-05-24 18:18:30 +00:00
lspconfig.texlab.setup{}
2021-05-24 13:06:55 +00:00
2021-06-02 15:56:28 +00:00
--vim.lsp.set_log_level("debug")
2021-05-24 13:06:55 +00:00
require('rust-tools').setup{}
2021-05-24 10:16:15 +00:00
2021-06-02 09:04:45 +00:00
require('telescope').setup{
defaults = {
file_ignore_patterns = {
'stage0/.*'
},
},
}
2021-05-23 18:55:38 +00:00
EOF
hi LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow
hi LspReferenceText cterm=bold ctermbg=red guibg=LightYellow
hi LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow
hi LspDiagnosticsDefaultError cterm=bold ctermfg=Red
hi LspDiagnosticsDefaultWarning cterm=bold ctermfg=Yellow
hi LspDiagnosticsDefaultInformation ctermfg=Blue
2021-06-29 19:03:06 +00:00
hi LspDiagnosticsUnderlineError gui=undercurl
hi LspDiagnosticsUnderlineWarning gui=undercurl
hi LspDiagnosticsUnderlineInformation gui=undercurl
hi LspDiagnosticsUnderlineHint gui=undercurl
2021-05-31 08:59:01 +00:00
hi link SpecialChar Character
2017-06-18 13:47:34 +00:00
2021-05-24 13:06:55 +00:00
au syntax leaninfo setl scl=no
2021-05-24 09:50:36 +00:00
inoremap <silent><expr> <C-Space> compe#complete()
inoremap <silent><expr> <CR> compe#confirm('<CR>')
inoremap <silent><expr> <C-e> compe#close('<C-e>')
inoremap <silent><expr> <C-f> compe#scroll({ 'delta': +4 })
inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 })
nnoremap gD <Cmd>lua vim.lsp.buf.declaration()<CR>
nnoremap gd <Cmd>lua vim.lsp.buf.definition()<CR>
nnoremap K <Cmd>lua vim.lsp.buf.hover()<CR>
nnoremap <leader>K <cmd>lua vim.lsp.diagnostic.show_line_diagnostics{show_header = false}<CR>
nnoremap gi <cmd>lua vim.lsp.buf.implementation()<CR>
nnoremap <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
nnoremap <space>wa <cmd>lua vim.lsp.buf.add_workspace_folder()<CR>
nnoremap <space>wr <cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>
nnoremap <space>wl <cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>
nnoremap <space>D <cmd>lua vim.lsp.buf.type_definition()<CR>
nnoremap <space>rn <cmd>lua vim.lsp.buf.rename()<CR>
nnoremap <space>ca <cmd>lua vim.lsp.buf.code_action()<CR>
nnoremap gr <cmd>lua vim.lsp.buf.references()<CR>
nnoremap <space>e <cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>
nnoremap [d <cmd>lua vim.lsp.diagnostic.goto_prev()<CR>
nnoremap ]d <cmd>lua vim.lsp.diagnostic.goto_next()<CR>
nnoremap <space>q <cmd>lua vim.lsp.diagnostic.set_loclist()<CR>
nnoremap <space>f <cmd>lua vim.lsp.buf.formatting()<CR>
2021-06-02 15:56:28 +00:00
nnoremap <leader>i <Cmd>lua require('lean.infoview').toggle()<CR>
2021-05-30 08:58:23 +00:00
nnoremap <c-p> <cmd>Telescope find_files<cr>
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
else
nnoremap <c-p> :FZF<cr>
2021-05-23 18:55:38 +00:00
endif
2017-10-10 07:31:04 +00:00
2020-10-03 10:52:14 +00:00
let g:tex_flavor = 'latex'
2017-10-13 14:12:56 +00:00
let g:vimtex_compiler_progname = 'nvr'
2021-04-28 08:52:10 +00:00
let g:vimtex_indent_enabled = 0
au syntax tex setl indentexpr= " disable vim crap: https://github.com/lervag/vimtex/issues/2007#issuecomment-808768783