From a23d8e64eddba48b02ece6d425ccea3d4c07632d Mon Sep 17 00:00:00 2001 From: "U-WINDOWS-PC\\user" Date: Sat, 1 Feb 2025 01:28:27 -0600 Subject: more dotfiles --- git/.gitconfig | 15 +++++++++ nvim/ginit.vim | 22 ++++++------ nvim/init.vim | 105 ++++++++++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 112 insertions(+), 30 deletions(-) create mode 100644 git/.gitconfig diff --git a/git/.gitconfig b/git/.gitconfig new file mode 100644 index 0000000..5c823fb --- /dev/null +++ b/git/.gitconfig @@ -0,0 +1,15 @@ +[credential] + helper = manager +[pull] + rebase = false +[user] + name = Alexander M Pickering +[http] + postBuffer = 500M + maxRequestBuffer = 100M +[core] + compression = 0 + editor = nvim + pager = bat +[diff] + tool = nvimdiff 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 :FVimToggleFullScreen - FVimCursorSmoothMove v:true - FVimCursorSmoothBlink v:true - nnoremap :FVimBackgroundComposition 'transparent':FVimBackgroundOpacity 0.8 - nnoremap :FVimBackgroundComposition 'none':FVimBackgroundOpacity 1 - FVimCustomTitleBar v:true - -endif + +if exists("g:fvim_loaded") + set guifont=LiterationMono\ Nerd\ Font\ Mono:h18 + nnoremap :FVimToggleFullScreen + FVimCursorSmoothMove v:true + FVimCursorSmoothBlink v:true + nnoremap :FVimBackgroundComposition 'transparent':FVimBackgroundOpacity 0.8 + nnoremap :FVimBackgroundComposition 'none':FVimBackgroundOpacity 1 + 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 pumvisible() ? "\" : check_back_space() ? "\" : deoplete#manual_complete() +inoremap pumvisible() ? "\" : check_back_space() ? "\" : 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 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 :call NERDComment('x', 'toggle') +"nnoremap :call nerdcommenter#Comment('x', 'toggle') +"vnoremap :call nerdcommenter#Comment('x', 'toggle') "Fuzzy file search let g:fzf_layout = { 'window': {'width': 0.9, 'height': 0.6} } @@ -144,8 +167,8 @@ noremap :call fzf#run(fzf#wrap({'sink': 'tabe', 'left': '20%', 'source': ' noremap :call fzf#run(fzf#wrap({'sink': 'vsplit', 'left': '50%', 'source': 'git ls-files'})) "Fuzzy git checkout branch -noremap :call fzf#run(fzf#wrap({'sink': 'Git checkout', 'left':'20%', 'source': 'git branch --format "%(refname:short)"'})) -noremap :call fzf#run(fzf#wrap({'sink': 'Git checkout', 'left':'50%', 'source': 'ag --nogroup --column --color --', 'preview-window':'up','preview':expand(':p:h:h:h').'/bin/preview.sh'})) +noremap c :call fzf#run(fzf#wrap({'sink': 'Git checkout', 'left':'20%', 'source': 'git branch --format "%(refname:short)"'})) +noremap a :call fzf#run(fzf#wrap({'sink': 'Git checkout', 'left':'50%', 'source': 'ag --nogroup --column --color --', 'preview-window':'up','preview':expand(':p:h:h:h').'/bin/preview.sh'})) "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 h tnoremap 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 :call PushResize('h',5) @@ -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 :NvimTreeToggle - vunmap - vmap :call NERDComment('x', 'toggle') - nnoremap :call nerdcommenter#Comment('x', 'toggle') + "nmap :NvimTreeToggle + "vunmap + "vmap :call nerdcommenter#NERDComment('x', 'toggle') + "nnoremap :call nerdcommenter#Comment('x', 'toggle') endif + +" ollama.nvim - ai code assist +lua require("ollama").config.model = "codestral" +vnoremap gg :lua require("ollama").prompt("fgen") +vnoremap gh :lua require("ollama").prompt("Explain_Code") +vnoremap gG :lua require("ollama").prompt("extend") +nnoremap gt :lua require("ollama").prompt("Raw") +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 -- cgit v1.2.3-70-g09d2