summaryrefslogtreecommitdiff
path: root/nvim/init.vim
diff options
context:
space:
mode:
authorAlexander M Pickering <alex@cogarr.net>2025-07-05 16:36:14 -0500
committerAlexander M Pickering <alex@cogarr.net>2025-07-05 16:36:14 -0500
commit2709dd8bf97bdf88d9343374a7d0d04466fb5776 (patch)
tree074560a9b70e59584e01a8bffa806e55286d60c1 /nvim/init.vim
parent9a1701b5d6364e540b7af3d9de55a644e330fcfd (diff)
parentb817b79e9e050f79c5bbc2b10ca0e419e2ee1456 (diff)
downloaddotfiles-2709dd8bf97bdf88d9343374a7d0d04466fb5776.tar.gz
dotfiles-2709dd8bf97bdf88d9343374a7d0d04466fb5776.tar.bz2
dotfiles-2709dd8bf97bdf88d9343374a7d0d04466fb5776.zip
Merge branch 'master' of ssh://cogarr.net/home/git/dotfiles
Diffstat (limited to 'nvim/init.vim')
-rw-r--r--nvim/init.vim127
1 files changed, 87 insertions, 40 deletions
diff --git a/nvim/init.vim b/nvim/init.vim
index 09dd212..f3a6021 100644
--- a/nvim/init.vim
+++ b/nvim/init.vim
@@ -4,7 +4,7 @@ set nu
set ff=unix
"set the highlight column at 80
set colorcolumn=80
-" displace spaces, tabs, and newlines
+" display spaces, tabs, and newlines
set list
set listchars=tab:→\ ,space:·,nbsp:␣,trail:•,eol:¶,precedes:«,extends:»
set noexpandtab
@@ -46,19 +46,20 @@ Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" "tab completion
-Plug 'williamboman/mason.nvim'
-Plug 'williamboman/mason-lspconfig.nvim'
+Plug 'mason-org/mason.nvim'
+Plug 'mason-org/mason-lspconfig.nvim'
+Plug 'mfussenegger/nvim-lint'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
"Plug 'Shougo/denite.nvim'
-"Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
+Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
"Plug 'Shougo/echodoc.vim'
-"Plug 'deoplete-plugins/deoplete-jedi'
+Plug 'deoplete-plugins/deoplete-jedi'
Plug 'neovim/nvim-lspconfig'
-"Plug 'deoplete-plugins/deoplete-lsp'
+Plug 'deoplete-plugins/deoplete-lsp'
" Snippits
Plug 'hrsh7th/cmp-vsnip'
@@ -69,35 +70,34 @@ Plug 'raimon49/requirements.txt.vim'
" Scala tab completion
Plug 'nvim-lua/plenary.nvim'
-"Plug 'scalameta/nvim-metals'
+Plug 'scalameta/nvim-metals'
" CSV formatting
Plug 'chrisbra/csv.vim'
" Lua, Moonscript, Teal
-"Plug 'xolox/vim-misc'
-"Plug 'xolox/vim-lua-ftplugin'
-Plug 'VaiN474/vim-etlua'
+Plug 'xolox/vim-misc'
+Plug 'xolox/vim-lua-ftplugin'
+"Plug 'VaiN474/vim-etlua'
Plug 'leafo/moonscript-vim'
Plug 'teal-language/vim-teal'
-Plug 'S1M0N38/love2d.nvim'
+"Plug 'S1M0N38/love2d.nvim'
" Treesitter, higlihting
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
" Coq
-Plug 'whonore/Coqtail'
+"Plug 'whonore/Coqtail'
" GLSL
-Plug 'tikhomirov/vim-glsl'
+"Plug 'tikhomirov/vim-glsl'
" Supercollider
-Plug 'davidgranstrom/scnvim'
+"Plug 'davidgranstrom/scnvim'
"Color schemes
Plug 'mhartington/oceanic-next'
Plug 'vim-scripts/Wombat'
-Plug 'zeis/vim-kolor'
Plug 'alessandroyorba/despacio'
Plug 'alessandroyorba/alduin'
Plug 'tomasr/molokai'
@@ -106,18 +106,18 @@ Plug 'sts10/vim-pink-moon'
Plug 'severij/vadelma'
Plug 'kkpmw/sacredforest-vim'
Plug 'jsit/toast.vim'
-Plug 'henrynewcomer/vim-theme-papaya'
Plug 'sainnhe/edge'
Plug 'kjssad/quantum.vim'
Plug 'kyoz/purify'
-Plug 'jonathanfilip/vim-lucius'
Plug 'joshdick/onedark.vim'
Plug 'cocopon/iceberg.vim'
Plug 'wolf-dog/sceaduhelm.vim'
Plug 'danilo-augusto/vim-afterglow'
Plug 'kamwitsta/mythos'
-Plug 'softmotions/vim-dark-frost-theme'
+Plug 'https://github.com/gbprod/nord.nvim'
Plug 'ghifarit53/tokyonight-vim'
+Plug 'scottmckendry/cyberdream.nvim'
+Plug 'nyoom-engineering/oxocarbon.nvim'
"Icons, requires a nerd font
Plug 'ryanoasis/vim-devicons'
@@ -128,11 +128,14 @@ Plug 'nomnivore/ollama.nvim'
Plug 'nvim-lualine/lualine.nvim'
" Terraform
-"Plug 'hashivim/vim-terraform'
+Plug 'hashivim/vim-terraform'
call plug#end()
-let colorschemes = ['OceanicNext', 'afterglow', 'alduin', 'darkforest', 'edge', 'desert', 'despacio', 'onedark', 'evening', 'everforest', 'habamax', 'iceberg', 'kolor', 'lucius', 'lunaperche', 'molokai', 'moon', 'mythos', 'default', 'orange-moon', 'papaya', 'papaya_original', 'pink-moon', 'quantum', 'retrobox', 'sceaduhelm', 'slate', 'sorbet', 'toast', 'tokyonight', 'vadelma', 'yellow-moon', 'zaibatsu']
+set background=dark
+let colorschemes = ['OceanicNext', 'afterglow', 'alduin', 'nord', 'edge', 'desert', 'despacio', 'onedark', 'evening', 'everforest', 'habamax', 'iceberg', 'oxocarbon', 'lunaperche', 'molokai', 'moon', 'mythos', 'cyberdream', 'orange-moon', 'pink-moon', 'quantum', 'retrobox', 'sceaduhelm', 'slate', 'sorbet', 'toast', 'tokyonight', 'vadelma', 'yellow-moon', 'zaibatsu']
+"Randomly select a colorscheme based on current directory. Each project gets
+"it's own color- usually.
let cs = colorschemes[str2nr(sha256(execute('pwd'))[1:5],16) % len(colorschemes)]
execute('colorscheme ' . cs)
@@ -140,8 +143,8 @@ execute('colorscheme ' . cs)
"let g:deoplete#enable_at_startup = 1
"call deoplete#custom#option("min_pattern_length", 1)
"call deoplete#custom#option("smart_case", 1)
-imap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
-imap <expr><CR> pumvisible() ? "\<CR>\<Plug>AutoPairsReturn" : "\<CR>"
+"imap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
+"imap <expr><CR> pumvisible() ? "\<CR>\<Plug>AutoPairsReturn" : "\<CR>"
"imap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<S-TAB>"
"imap <expr><CR> pumvisible() ? deoplete#close_popup() : "\<CR>\<Plug>AutoPairsReturn"
@@ -162,12 +165,12 @@ let g:lua_compiler_name='lua'
"let g:lua_compiler_name='lua'
let g:lua_complete_dynamic=1
let g:lua_complete_keywords=0
-"let g:deoplete#lsp#handler_enabled=1
-"let g:deoplete#lsp#use_icons_for_candidates=1
+"let g:deoplete#lsp#handler_enabled=v:true
+"let g:deoplete#lsp#use_icons_for_candidates=v:true
-au BufReadPost *.busted set syntax=lua
-au BufReadPost *.spec set syntax=lua
-au BufReadPost *.etlua set syntax=html
+"au BufReadPost *.busted set syntax=lua
+"au BufReadPost *.spec set syntax=lua
+"au BufReadPost *.etlua set syntax=html
"Overwrite xolox:ftplugin's "Help" with shift-k
"au BufReadPost *.lua nunmap <buffer> K
"au BufReadPost *.lua let g:lua_complete_omni=1
@@ -192,8 +195,8 @@ let NERDTreeMapJumpLastChild='y'
let NERDTreeMapJumpFirstChild='y'
"NERDCommenter config
-"nnoremap <C-/> :call nerdcommenter#Comment('x', 'toggle')<CR>
-"vnoremap <C-/> :call nerdcommenter#Comment('x', 'toggle')<CR>
+nnoremap <C-/> :call nerdcommenter#Comment('x', 'toggle')<CR>
+vnoremap <C-/> :call nerdcommenter#Comment('x', 'toggle')<CR>
"Fuzzy file search
let g:fzf_layout = { 'window': {'width': 0.9, 'height': 0.6} }
@@ -294,7 +297,14 @@ vnoremap <C-;> :'<,'>s/\([^;]\)$/\1;/g<Cr>
noremap <C-b> :vsplit term://make all<Cr>
"Start a terminal
-noremap <C-t> :vsplit<CR>:terminal<CR>
+function! s:Terminal()
+ if filereadable(".terminal")
+ execute feedkeys(":vsplit\<CR>:terminal\<CR>i./.terminal\<CR>")
+ else
+ execute feedkeys(":vsplit\<CR>:terminal\<CR>i")
+ endif
+endfunction
+noremap <C-t> :call <SID>Terminal()<CR>
"Find and open in a new tab
noremap <C-f> :Ag<Cr>
@@ -318,8 +328,19 @@ if has_key(environ(), "LUNARVIM_BASE_DIR")
endif
" mason.nvim - lsp running
-lua require("mason").setup()
-"lua require("mason-lspconfig").setup({ensure_installed = {"lua_ls","harper-ls"}})
+lua << EOF
+--[[
+require("mason").setup({
+ ui = {icons = {
+ package_installed = "󰄳",
+ package_pending = "󱑤",
+ package_uninstalled = ""
+ }}
+})]]
+require("mason").setup()
+
+EOF
+lua require("mason-lspconfig").setup({ensure_installed = {"lua_ls"}})
lua << EOF
local cmp = require("cmp")
@@ -342,7 +363,7 @@ lua << EOF
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
- ["<CR>"] = cmp.mapping.confirm({select=true}),
+ --["<CR>"] = cmp.mapping.confirm({select=true}),
["<C-e>"] = cmp.mapping.abort(),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
@@ -362,6 +383,8 @@ lua << EOF
feedkey("<Plug>(vsnip-jump-prev)", "")
end
end, {"i","s"}),
+ ["<C-j>"] = cmp.mapping.scroll_docs(5),
+ ["<C-k>"] = cmp.mapping.scroll_docs(-5),
}),
sources = cmp.config.sources({
{name = "nvim_lsp"},
@@ -390,8 +413,8 @@ lua << EOF
enable=true,
},
workspace = {
- "${3rd}/love2d/library",
- "${3rd}/busted/library",
+ --"${3rd}/love2d/library",
+ --"${3rd}/busted/library",
}
}
}
@@ -441,9 +464,9 @@ Respond EXACTLY in this format:
<your code>
```
]],
- action = "display_insert"
+ action = "display_insert",
}
- require("ollama").config.prompts.extend= {
+ require("ollama").config.prompts.rewrite= {
prompt = [[
Change this $ftype code to $input, keep any comments:
@@ -456,17 +479,39 @@ Respond EXACTLY in this format:
]],
action = "display_replace"
}
-end
+ require("ollama").config.prompts.review = {
+ prompt = [[
+Take a look at this $ftype code and provide critique in the style of a code review with concrete hints on how to make the code easier to read or more pythonic.
+Keep your review succinct. Respond EXACTLY in this format:
+
+```$ftype
+<your comments>
+```
+```
+$buf
+```
+
+]],
+ action = "display"
+ }
+end
EOF
+" Open diagnostics (e.g. for harper)
+nnoremap <leader>s :lua vim.diagnostic.open_float()<CR>
+
+" Copy the current filename
+nnoremap <leader>y :let @+ = expand('%')<CR>
+
" ollama.nvim - ai code assist
lua require("ollama").config.model = "codestral"
-vnoremap <leader>gg :lua require("ollama").prompt("fgen")<CR>
+nnoremap <leader>gg :lua require("ollama").prompt("fgen")<CR>
vnoremap <leader>gh :lua require("ollama").prompt("Explain_Code")<CR>
-vnoremap <leadeR>gG :lua require("ollama").prompt("extend")<CR>
+vnoremap <leadeR>gG :lua require("ollama").prompt("rewrite")<CR>
nnoremap <leadeR>gt :lua require("ollama").prompt("Raw")<CR>
+nnoremap <leadeR>gr :lua require("ollama").prompt("review")<CR>
lua << EOF
vim.api.nvim_create_autocmd('FileType', {
-- This handler will fire when the buffer's 'filetype' is "lua"
@@ -489,11 +534,13 @@ EOF
" love2d help
lua << EOF
+ --[[
require("love2d").setup{
path_to_love_bin = "love",
path_to_love_library = vim.fn.globpath(vim.o.runtimepath, "love2d/library"),
restart_on_save = false,
}
+ ]]
EOF
" Acrisure