diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2025-03-24 21:04:43 +0000 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2025-03-24 21:04:43 +0000 |
commit | 295e74d25a9bebbb9d5c1fa8defee511db29496e (patch) | |
tree | c87205405cdca36de5ac4f8f2d13536f815d7897 /init.vim |
Diffstat (limited to 'init.vim')
-rw-r--r-- | init.vim | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/init.vim b/init.vim new file mode 100644 index 0000000..005cf93 --- /dev/null +++ b/init.vim @@ -0,0 +1,96 @@ +syntax match roffmac /^\..*$/ +source ~/.config/nvim/latex.vim +source ~/.config/nvim/roff.vim + +" global options +set number +set relativenumber +set nohlsearch +set incsearch +set showcmd +set scrolloff=10 +set nowrap + +" custom keys +let mapleader = "\<Space>" +nnoremap <Leader>m :make<Return> +nnoremap <Leader>l $ +nnoremap <Leader>h ^ +nnoremap <Leader>j 10j +nnoremap <Leader>k 10k +nnoremap <Leader>zz :wqa<Return> +nnoremap <Leader>m :make<Return> +nnoremap <Leader>y "+y +nnoremap <Leader>d "+d +nnoremap <Leader>p "+p +nnoremap <Leader>t :tab term<Return> +nnoremap <Leader>n :tabNext<Return> +nnoremap c zz +tnoremap <Esc> <C-\><C-n> + +" language specific settings +autocmd FileType tex call Latexsetup() " latex +autocmd FileType nroff call Roffsetup() " roff + +" plugins +call plug#begin('~/.local/share/nvim/plugged') +Plug 'neovim/nvim-lspconfig' +Plug 'hrsh7th/cmp-nvim-lsp' +Plug 'hrsh7th/cmp-buffer' +Plug 'hrsh7th/cmp-path' +Plug 'hrsh7th/cmp-cmdline' +Plug 'hrsh7th/nvim-cmp' +Plug 'hrsh7th/cmp-nvim-lsp' +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} +Plug 'kepano/flexoki-neovim' +call plug#end() + +colorscheme flexoki-dark + + +" lsp client things +lua << EOF + +local capabilities = require("cmp_nvim_lsp").default_capabilities() + +local lspconfig = require('lspconfig') + +-- Enable some language servers with the additional completion capabilities offered by nvim-cmp +local servers = { 'clangd', 'hls', 'texlab' } +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + capabilities = capabilities, + } + end + + -- nvim-cmp setup + local cmp = require 'cmp' + cmp.setup { + mapping = cmp.mapping.preset.insert({ + ['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up + ['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down + -- C-b (back) C-f (forward) for snippet placeholder navigation. + ['<C-Space>'] = cmp.mapping.complete(), + ['<CR>'] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }, + ['<Tab>'] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { 'i', 's' }), + ['<S-Tab>'] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { 'i', 's' }), + }), + sources = { + { name = 'nvim_lsp' }, + }, + } |