summaryrefslogtreecommitdiff
path: root/nvim
diff options
context:
space:
mode:
authorU-WINDOWS-PC\user <alex@cogarr.net>2025-02-01 01:28:27 -0600
committerU-WINDOWS-PC\user <alex@cogarr.net>2025-02-01 01:28:27 -0600
commita23d8e64eddba48b02ece6d425ccea3d4c07632d (patch)
tree1b69fc8b00b1bfba9c92543c3ca5bb36de098d13 /nvim
parent8e262292585fd0eb031738ac05eee4a1bdd91e84 (diff)
downloaddotfiles-a23d8e64eddba48b02ece6d425ccea3d4c07632d.tar.gz
dotfiles-a23d8e64eddba48b02ece6d425ccea3d4c07632d.tar.bz2
dotfiles-a23d8e64eddba48b02ece6d425ccea3d4c07632d.zip
more dotfiles
Diffstat (limited to 'nvim')
-rw-r--r--nvim/ginit.vim22
-rw-r--r--nvim/init.vim105
2 files changed, 97 insertions, 30 deletions
diff --git a/nvim/ginit.vim b/nvim/ginit.vim
index d037612..6d2a58a 100644
--- a/nvim/ginit.vim
+++ b/nvim/ginit.vim
@@ -1,11 +1,11 @@
-
-if exists("g:fvim_loaded")
- set guifont=LiterationMono\ Nerd\ Font\ Mono:h18
- nnoremap <A-CR> :FVimToggleFullScreen<CR>
- FVimCursorSmoothMove v:true
- FVimCursorSmoothBlink v:true
- nnoremap <C--> :FVimBackgroundComposition 'transparent'<CR>:FVimBackgroundOpacity 0.8<CR>
- nnoremap <C-=> :FVimBackgroundComposition 'none'<CR>:FVimBackgroundOpacity 1<CR>
- FVimCustomTitleBar v:true
-
-endif
+
+if exists("g:fvim_loaded")
+ set guifont=LiterationMono\ Nerd\ Font\ Mono:h18
+ nnoremap <A-CR> :FVimToggleFullScreen<CR>
+ FVimCursorSmoothMove v:true
+ FVimCursorSmoothBlink v:true
+ nnoremap <C--> :FVimBackgroundComposition 'transparent'<CR>:FVimBackgroundOpacity 0.8<CR>
+ nnoremap <C-=> :FVimBackgroundComposition 'none'<CR>:FVimBackgroundOpacity 1<CR>
+ FVimCustomTitleBar v:true
+
+endif
diff --git a/nvim/init.vim b/nvim/init.vim
index 4957a6e..5b7dd6d 100644
--- a/nvim/init.vim
+++ b/nvim/init.vim
@@ -7,6 +7,11 @@ set colorcolumn=80
" displace spaces, tabs, and newlines
set list
set listchars=tab:→\ ,space:·,nbsp:␣,trail:•,eol:¶,precedes:«,extends:»
+set noexpandtab
+
+" Set wrap
+set wrap
+
"2 lines of cmd, needed for echodoc
set cmdheight=2
if has('win32')
@@ -20,16 +25,16 @@ call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'scrooloose/nerdcommenter'
Plug 'godlygeek/tabular'
-
-"Git
+"
+" "Git
Plug 'xuyuanp/nerdtree-git-plugin'
Plug 'tpope/vim-fugitive'
-
-"Fuzzy file search
+"
+" "Fuzzy file search
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
-
-"tab completion
+"
+" "tab completion
Plug 'Shougo/denite.nvim'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/echodoc.vim'
@@ -37,7 +42,7 @@ Plug 'deoplete-plugins/deoplete-jedi'
Plug 'raimon49/requirements.txt.vim'
" Scala tab completion
-"Plug 'nvim-lua/plenary.nvim'
+Plug 'nvim-lua/plenary.nvim'
"Plug 'scalameta/nvim-metals'
" CSV formatting
@@ -49,8 +54,19 @@ Plug 'xolox/vim-lua-ftplugin'
Plug 'VaiN474/vim-etlua'
Plug 'leafo/moonscript-vim'
Plug 'teal-language/vim-teal'
+Plug 'neovim/nvim-lspconfig'
-"Plug 'whonore/Coqtail'
+" Treesitter, higlihting
+Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
+
+" Coq
+Plug 'whonore/Coqtail'
+
+" GLSL
+Plug 'tikhomirov/vim-glsl'
+
+" Supercollider
+Plug 'davidgranstrom/scnvim'
"Color schemes
Plug 'mhartington/oceanic-next'
@@ -80,6 +96,10 @@ Plug 'ghifarit53/tokyonight-vim'
"Icons, requires a nerd font
Plug 'ryanoasis/vim-devicons'
+"AI, requires ollama, curl, and plenary
+"on
+Plug 'nomnivore/ollama.nvim'
+
" Terraform
"Plug 'hashivim/vim-terraform'
call plug#end()
@@ -88,11 +108,11 @@ colorscheme onedark
"deoplete
let g:deoplete#enable_at_startup = 1
-inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : <SID>check_back_space() ? "\<TAB>" : deoplete#manual_complete()
+inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : <SID>check_back_space() ? "\<TAB>" : deoplete#mappings#manual_complete()
function s:check_back_space() abort "{{{
let col = col('.') - 1
return !col || getline('.')[col-1] =~ '\s'
-endfunction"}}}
+endfunction "}}}
autocmd CompleteDone * if pumvisible() == 0 | silent! pclose | endif
" echodoc
@@ -117,6 +137,8 @@ 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
+" GLSL
+au BufReadPost *.vs,*.fs set ft=glsl
"scala
augroup lsp
@@ -136,7 +158,8 @@ let NERDTreeMapJumpLastChild='y'
let NERDTreeMapJumpFirstChild='y'
"NERDCommenter config
-nnoremap <C-/> :call NERDComment('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} }
@@ -144,8 +167,8 @@ noremap <A-p> :call fzf#run(fzf#wrap({'sink': 'tabe', 'left': '20%', 'source': '
noremap <C-p> :call fzf#run(fzf#wrap({'sink': 'vsplit', 'left': '50%', 'source': 'git ls-files'}))<Cr>
"Fuzzy git checkout branch
-noremap <C-c> :call fzf#run(fzf#wrap({'sink': 'Git checkout', 'left':'20%', 'source': 'git branch --format "%(refname:short)"'}))<Cr>
-noremap <C-a> :call fzf#run(fzf#wrap({'sink': 'Git checkout', 'left':'50%', 'source': 'ag --nogroup --column --color --', 'preview-window':'up','preview':expand('<sfile>:p:h:h:h').'/bin/preview.sh'}))<Cr>
+noremap <leader>c :call fzf#run(fzf#wrap({'sink': 'Git checkout', 'left':'20%', 'source': 'git branch --format "%(refname:short)"'}))<Cr>
+noremap <leader>a :call fzf#run(fzf#wrap({'sink': 'Git checkout', 'left':'50%', 'source': 'ag --nogroup --column --color --', 'preview-window':'up','preview':expand('<sfile>:p:h:h:h').'/bin/preview.sh'}))<Cr>
"Fuzzy sbt
@@ -176,6 +199,11 @@ nnoremap K 5k
nnoremap H 5h
nnoremap L 5l
+vnoremap J 5j
+vnoremap K 5k
+vnoremap H 5h
+vnoremap L 5l
+
"Navigate splits
tnoremap <A-h> <C-\><C-n><C-w>h
tnoremap <A-j> <C-\><C-n><C-w>j
@@ -212,6 +240,7 @@ function! s:PushResize(direction, amount)
echo l:cmd . ' ' . l:amount
execute l:cmd . ' ' . l:amount
+ set cmdheight=2
endfunction
nnoremap <C-h> :call <SID>PushResize('h',5)<CR>
@@ -243,11 +272,49 @@ syntax enable
"Unmap a bunch of stuff set by lunarvim
if has_key(environ(), "LUNARVIM_BASE_DIR")
- lua lvim.builtin.which_key.mappings.e = nil
- lua lvim.lsp.buffer_mappings.normal_mode.K = nil
+ lua if lvim then lvim.builtin.which_key.mappings.e = nil end
+ lua if lvim then lvim.lsp.buffer_mappings.normal_mode.K = nil end
+ lua if lvim then lvim.builtin.bufferline.active = false end
let $MYVIMRC=$LUNARVIM_BASE_DIR . "\\vimrc.vim"
- nmap <C-Bslash> :NvimTreeToggle<CR>
- vunmap <C-/>
- vmap <C-/> :call NERDComment('x', 'toggle')<CR>
- nnoremap <C-/> :call nerdcommenter#Comment('x', 'toggle')<CR>
+ "nmap <C-Bslash> :NvimTreeToggle<CR>
+ "vunmap <C-/>
+ "vmap <C-/> :call nerdcommenter#NERDComment('x', 'toggle')<CR>
+ "nnoremap <C-/> :call nerdcommenter#Comment('x', 'toggle')<CR>
endif
+
+" ollama.nvim - ai code assist
+lua require("ollama").config.model = "codestral"
+vnoremap <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>
+nnoremap <leadeR>gt :lua require("ollama").prompt("Raw")<CR>
+lua << EOF
+ vim.api.nvim_create_autocmd('FileType', {
+ -- This handler will fire when the buffer's 'filetype' is "lua"
+ pattern = 'lua',
+ callback = function(ev)
+ vim.lsp.start({
+ name = 'lua-lsp',
+ cmd = {'lua-language-server'},
+
+ -- Set the "root directory" to the parent directory of the file in the
+ -- current buffer (`ev.buf`) that contains either a "setup.py" or a
+ -- "pyproject.toml" file. Files that share a root directory will reuse
+ -- the connection to the same LSP server.
+ root_dir = "data"
+ })
+ end,
+ })
+EOF
+lua << EOF
+ require("lspconfig").lua_ls.setup{
+ settings={
+ Lua={
+ runtime={
+ version="LuaJIT",
+ path="data/?.lua"
+ }
+ }
+ }
+ }
+EOF