home-config/nvim/config/init.vim
6816354babcb412b0ca03308d387fe1964544bfe
· 2.7 KB · 100 lines
raw
| 1 | set nu rnu |
| 2 | imap kj <Esc> |
| 3 | set ts=4 |
| 4 | set sw=4 |
| 5 | set sts=4 |
| 6 | set et |
| 7 | set mouse= |
| 8 | set cursorline |
| 9 | set cc=79 |
| 10 | |
| 11 | call plug#begin(stdpath('data') . '/plugged') |
| 12 | "Plug 'prabirshrestha/vim-lsp' |
| 13 | "Plug 'mattn/vim-lsp-settings' |
| 14 | "Plug 'prabirshrestha/asyncomplete.vim' |
| 15 | "Plug 'prabirshrestha/asyncomplete-lsp.vim' |
| 16 | "Plug 'Yggdroot/indentLine' |
| 17 | Plug 'nvim-treesitter/nvim-treesitter', {'do':':TSUpdate'} |
| 18 | Plug 'vim-pandoc/vim-pandoc' |
| 19 | Plug 'vim-pandoc/vim-pandoc-syntax' |
| 20 | Plug 'dhruvasagar/vim-table-mode' |
| 21 | Plug '~/.config/nvim/after' |
| 22 | Plug 'skywind3000/asyncrun.vim' |
| 23 | Plug 'folke/tokyonight.nvim', {'branch':'main'} |
| 24 | Plug 'nvim-lualine/lualine.nvim' |
| 25 | Plug 'nvim-tree/nvim-web-devicons' |
| 26 | Plug 'ms-jpq/coq_nvim', {'branch':'coq'} |
| 27 | Plug 'ms-jpq/coq.artifacts', {'branch':'artifacts'} |
| 28 | Plug 'williamboman/mason.nvim' |
| 29 | Plug 'williamboman/mason-lspconfig.nvim' |
| 30 | Plug 'neovim/nvim-lspconfig' |
| 31 | Plug 'nvim-orgmode/orgmode' |
| 32 | Plug 'ggandor/leap.nvim' |
| 33 | call plug#end() |
| 34 | |
| 35 | "Load Theme |
| 36 | colorscheme tokyonight-night |
| 37 | |
| 38 | "Load COQ Autocomplete |
| 39 | let g:coq_settings = {'auto_start':'shut-up'} |
| 40 | |
| 41 | "Load LuaLine, COQ, and nvim-orgmode |
| 42 | lua << END |
| 43 | require('lualine').setup() |
| 44 | require('coq') |
| 45 | require('orgmode').setup_ts_grammar() |
| 46 | require("mason").setup() |
| 47 | require("mason-lspconfig").setup { |
| 48 | ensure_installed = { "pyright" }, |
| 49 | } |
| 50 | |
| 51 | require('leap').add_default_mappings() |
| 52 | |
| 53 | require("mason-lspconfig").setup_handlers { |
| 54 | function (server_name) |
| 55 | require("lspconfig")[server_name].setup {} |
| 56 | end, |
| 57 | } |
| 58 | |
| 59 | require('nvim-treesitter.configs').setup { |
| 60 | highlight = { |
| 61 | enable = true, |
| 62 | additional_vim_regex_highlighting = {'org'}, |
| 63 | }, |
| 64 | ensure_installed = {'org', 'vim', 'python'}, |
| 65 | } |
| 66 | |
| 67 | require('orgmode').setup({ |
| 68 | org_agenda_files = {'~/Sync/org/**/*'}, |
| 69 | org_default_notes_file = '~/Sync/org/refile.org', |
| 70 | org_blank_before_new_entry = { |
| 71 | heading = false, |
| 72 | plain_list_item = false, |
| 73 | }, |
| 74 | }) |
| 75 | |
| 76 | vim.opt.conceallevel = 2 |
| 77 | vim.opt.concealcursor = nc |
| 78 | |
| 79 | --local lspconfig = require('lspconfig') |
| 80 | END |
| 81 | |
| 82 | "asynccomplete Auto Complete Config |
| 83 | "inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" |
| 84 | "inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" |
| 85 | "inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>" |
| 86 | |
| 87 | "vim-pandoc config |
| 88 | let g:pandoc#modules#disabled = ['spell', 'folding'] |
| 89 | |
| 90 | "vim-table-mode config |
| 91 | let g:table_mode_corner_corner='+' |
| 92 | let g:table_mode_header_fillchar='=' |
| 93 | |
| 94 | "pandoc render and open preview |
| 95 | command Pv AsyncRun zathura '%:r.pdf' |
| 96 | command Rd silent exec "!pandoc -t pdf -o %:r.pdf --from=markdown+escaped_line_breaks -V geometry:margin=1in %" |
| 97 | command Rr exec "!pandoc -t pdf -o %:r.pdf --from=markdown+escaped_line_breaks -V geometry:margin=1in %" |
| 98 | |
| 99 | "Auto-rerender markdown files to pdf |
| 100 | autocmd BufWritePost *.mkd :Rd |