From 295e74d25a9bebbb9d5c1fa8defee511db29496e Mon Sep 17 00:00:00 2001 From: thing1 Date: Mon, 24 Mar 2025 21:04:43 +0000 Subject: init commit --- init.vim | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ latex.vim | 10 +++++++ roff.vim | 12 ++++++++ 3 files changed, 118 insertions(+) create mode 100644 init.vim create mode 100644 latex.vim create mode 100644 roff.vim 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 = "\" +nnoremap m :make +nnoremap l $ +nnoremap h ^ +nnoremap j 10j +nnoremap k 10k +nnoremap zz :wqa +nnoremap m :make +nnoremap y "+y +nnoremap d "+d +nnoremap p "+p +nnoremap t :tab term +nnoremap n :tabNext +nnoremap c zz +tnoremap + +" 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({ + [''] = cmp.mapping.scroll_docs(-4), -- Up + [''] = cmp.mapping.scroll_docs(4), -- Down + -- C-b (back) C-f (forward) for snippet placeholder navigation. + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }, + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { 'i', 's' }), + }), + sources = { + { name = 'nvim_lsp' }, + }, + } diff --git a/latex.vim b/latex.vim new file mode 100644 index 0000000..4ff798e --- /dev/null +++ b/latex.vim @@ -0,0 +1,10 @@ +" latex settings very cool! +function Latexsetup() + set wrap + set spell + set spelllang=en_gb + set makeprg=./build.sh + nnoremap j gj + nnoremap k gk + nnoremap k gk +endfunction diff --git a/roff.vim b/roff.vim new file mode 100644 index 0000000..64b510e --- /dev/null +++ b/roff.vim @@ -0,0 +1,12 @@ +" roff settings very cool! +function Roffsetup() + set wrap + set spell + set spelllang=en_gb + nnoremap j gj + nnoremap k gk + nnoremap k gk + + syntax match roffmac /^\..*$/ + highlight link roffmac Title +endfunction -- cgit v1.2.3