summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthing1 <thing1@seacrossedlovers.xyz>2025-03-24 21:04:43 +0000
committerthing1 <thing1@seacrossedlovers.xyz>2025-03-24 21:04:43 +0000
commit295e74d25a9bebbb9d5c1fa8defee511db29496e (patch)
treec87205405cdca36de5ac4f8f2d13536f815d7897
init commitHEADmaster
-rw-r--r--init.vim96
-rw-r--r--latex.vim10
-rw-r--r--roff.vim12
3 files changed, 118 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' },
+ },
+ }
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