Compare commits

..

47 commits

Author SHA1 Message Date
thomas-gideon-gm
d6528e1d11 Make LSP diagnostics less intrusive 2024-10-02 14:51:09 -04:00
6f99625cba Migrate setting for upgraded plugin 2024-09-11 08:26:16 -04:00
thomas-gideon-gm
5025818b98 Fix leader binding 2024-08-23 13:57:10 -04:00
372846fa2f Improve handling of leader init keymaps 2024-08-09 08:27:28 -04:00
22acd8bb5b Adjust package path
To support using require() for settings converted to lua modules
2024-06-29 09:50:52 -04:00
thomas-gideon-gm
12437b5bcd Adjust key map settings 2024-06-27 16:35:56 -04:00
b135ce095b Add project files
- text.lua for markdown focused projects like personal wiki, diary
- leptos.lua for Rust projects using leptos, to set some rust-analyzer
  settings that help with with conditional compilation used by
  cargo-leptos
2024-06-24 10:27:53 -04:00
994f52bd50 Set matching airline theme 2024-06-23 11:10:23 -04:00
5e5dd9e4d2 Fix Os detection 2024-06-23 10:35:09 -04:00
b23fd9b050 Remove option missing from neovim 2024-06-23 10:34:51 -04:00
23b07f56d9 Restore breezy theme
- Setting background to dark and disabling colorscheme switch based on
  filetype seems to have resolved the issues.
2024-06-23 10:34:41 -04:00
thomas-gideon-gm
21e9dfa8b0 Update rust tooling, convert more config to lua
* Drop unmaintained rust-tools.
* Adopted rustaceanvm
* Convert Plug config to lua
* Convert key mapping to lua, update LSP bindings
* Remove unused syntastic plugin and config
2024-06-22 09:10:01 -04:00
thomas-gideon-gm
59683c0702 Condition paste toggle on OS 2024-06-21 09:53:33 -04:00
45af25f204 Remove text and markdown specific colorscheme
LSP breaks this because overlays with multiple lines are opened with a
filetype of text causing the colorscheme to change unpredictably and
sometimes break.

Moved wiki/diary specific colorscheme to a project specific config
outside of this repo.
2024-06-10 10:21:25 -04:00
thomas-gideon-gm
9d6de405f3 Change mapping to work from shell 2024-04-19 09:54:14 -04:00
thomas-gideon-gm
cd9c45cf26 macOS adjustments 2024-04-18 17:21:36 -04:00
3ca0930d08 Add more vimwiki mappings
- Ones for working with tags
- One for finding incomplete tasks
2024-04-10 11:40:19 -04:00
abcaef846e Restore font after update 2024-02-12 09:08:41 -05:00
50470717d3 Fix font size 2024-01-06 11:44:12 -05:00
9fee066f65 Convert to lua
- prune unused
- drop scripting, use symlink for identical options
2023-05-09 11:31:20 -04:00
dc820cae1c Try to restore scheme, add vimwiki filetype 2023-05-09 10:52:57 -04:00
f4d92ed3d8 Adjust rust config 2023-05-07 15:44:11 -04:00
81107d89c4 Set colorscheme for text and markdown 2023-03-11 10:24:23 -05:00
535c4396c8 Add deno support 2023-03-11 10:04:33 -05:00
c14bba2448 Remove broken plugin 2022-11-28 17:23:26 -05:00
79737fc15e Finish port of main config 2022-10-31 11:03:45 -04:00
1bcdea7a37 Start converting to Lua 2022-10-30 13:27:18 -04:00
d561d1964e Switch to same nerd font as alacritty 2022-09-18 10:25:46 -04:00
da7fbd68c7 Remove old mapping 2022-08-16 20:48:19 -04:00
d2af6e0d9e Update rust-tools init 2022-08-14 09:50:24 -04:00
94d44b3134 Remove auto command for now 2022-07-31 18:10:10 -04:00
b5b41624af Allow project specifics 2022-07-30 15:28:00 -04:00
c8d7834f22 Fix trouble configs 2022-07-27 12:59:29 -04:00
151a65cf23 Replace autoformat and prettier with neoformat 2022-07-26 13:52:56 -04:00
671dbd3bf9 Add Trouble for LSP diagnostics display 2022-06-01 07:46:39 -04:00
1441dd27a2 Increase base font 2022-06-01 07:46:18 -04:00
b2082f6aa1 Add map for lsp in loclist 2022-04-20 16:40:41 -04:00
dcae584991 Update from deprecated commands 2022-04-17 16:54:36 +00:00
bf3a4e2a86 Enable mouse 2022-02-23 08:19:55 -05:00
f57649029c Explicitly set shift width 2022-01-12 11:35:15 -05:00
2503edbce7 Disable for yaml, markdown 2022-01-10 16:37:02 -05:00
8180e3adf6 Migrate deprecated call 2022-01-04 15:27:36 -05:00
1aa5379036 Clean, add more TS support 2021-12-29 15:52:08 -05:00
6fd08618c9 Add more config for TS 2021-12-28 16:20:46 -05:00
add867aa9d Add TypeScript support 2021-12-28 16:07:11 -05:00
2f9df47bce Try zoxide plugin 2021-12-10 09:36:23 -05:00
48c76e67a5 Disable temporary wikis outside the list 2021-12-07 11:41:05 -05:00
24 changed files with 423 additions and 319 deletions

1
after/ftplugin/rust.lua Normal file
View file

@ -0,0 +1 @@
vim.g.rustfmt_autosave = 1

View file

@ -1,16 +0,0 @@
let g:JavaImpDataDir = $HOME . "/.vim/JavaImp"
" F7 to call clean redundant Java imports and sort them
function JavaImpClean()
%!~/bin/clean_imports.sh %
:JavaImpSort
endfunction
:command JavaImpClean exec JavaImpClean()
:nnoremap <F7> :JavaImpClean<CR>
"let makeprg = 'java -cp /opt/boxen/homebrew/opt/checkstyle/libexec/checkstyle-6.0-all.jar -c '. vimrc_git . '/checkstyle.xml %:p'
let makeprg = 'checkstyle -c '. vimrc_git . '/checkstyle.xml ./%'
let &makeprg=escape(makeprg, ' ')
setlocal errorformat=%f:%l:\ %m,%f:%l:%v:\ %m,%-G%.%#

3
ftplugin/javascript.lua Normal file
View file

@ -0,0 +1,3 @@
vim.cmd('setlocal fdm=indent')
vim.cmd('setlocal smartindent')
vim.cmd('setlocal list')

View file

@ -1,3 +0,0 @@
setlocal fdm=indent
setlocal smartindent
setlocal list

16
ftplugin/markdown.lua Normal file
View file

@ -0,0 +1,16 @@
-- set a smaller indent
local indent = 2
vim.opt.tabstop = indent
vim.opt.shiftwidth = indent
vim.opt.softtabstop = indent
-- don't hard break text
vim.opt.textwidth = 0
-- keep soft breaks between words
vim.cmd('setlocal linebreak')
-- turn list off as it interferes with soft wrapping
vim.cmd('setlocal nolist')
-- turn off breaking when typing new text
vim.cmd('setlocal formatoptions-=t')
-- turn off line width hint
vim.cmd('setlocal colorcolumn=0')

View file

@ -1,8 +0,0 @@
" set a smaller indent
setlocal ts=2
" and set up the buffer just like a text file
let oldwd = getcwd()
exec "cd ~/.config/nvim/ftplugin"
source text.vim
exec "cd " . oldwd

View file

@ -1 +0,0 @@
let g:rustfmt_autosave = 1

View file

@ -1 +0,0 @@
au BufWrite * :Autoformat

10
ftplugin/text.lua Normal file
View file

@ -0,0 +1,10 @@
-- don't hard break text
vim.opt.textwidth = 0
-- keep soft breaks between words
vim.cmd('setlocal linebreak')
-- turn list off as it interferes with soft wrapping
vim.cmd('setlocal nolist')
-- turn off breaking when typing new text
vim.cmd('setlocal formatoptions-=t')
-- turn off line width hint
vim.cmd('setlocal colorcolumn=0')

View file

@ -1,10 +0,0 @@
" don't hard break text
setlocal tw=0
" keep soft breaks between words
setlocal linebreak
" turn list off as it interferes with soft wrapping
setlocal nolist
" turn off breaking when typing new text
setlocal formatoptions-=t
" turn off line width hint
setlocal colorcolumn=0

11
ftplugin/typescript.lua Normal file
View file

@ -0,0 +1,11 @@
vim.g.neoformat_try_node_exe = 1
-- set a smaller indent
local indent = 2
vim.opt.tabstop = indent
vim.opt.shiftwidth = indent
vim.opt.softtabstop = indent
vim.cmd('setlocal fdm=indent')
vim.cmd('setlocal smartindent')
vim.cmd('setlocal list')

View file

@ -1 +0,0 @@
au BufWrite * :Autoformat

1
ftplugin/vimwiki.vim Symbolic link
View file

@ -0,0 +1 @@
markdown.vim

141
init.lua Normal file
View file

@ -0,0 +1,141 @@
local vimrc_git = os.getenv("HOME") .. "/src/vimrc"
-- add to package path to allow use of require() for lua modules
package.path = string.format("%s;%s?.lua", package.path, vimrc_git.."/")
-- it is a big fat key, after all
-- N.B. should come before plugins and plugin specific settings
vim.g.mapleader = ' '
require("plug")
--vim.cmd("source " .. vimrc_git .. "/plug.lua")
vim.cmd("source " .. vimrc_git .. "/airline.vim")
vim.cmd("source " .. vimrc_git .. "/lsp.vim")
require("mapping")
--vim.cmd("source " .. vimrc_git .. "/mapping.lua")
vim.cmd("source " .. vimrc_git .. "/fzf.vim")
vim.cmd("source " .. vimrc_git .. "/jsonnet.vim")
vim.cmd("source " .. vimrc_git .. "/nerdtree.vim")
vim.cmd("source " .. vimrc_git .. "/wiki.vim")
if vim.g.neovide then
require("size-matters")
end
-- set up a line number on the current line but relative above and below to
-- help with motion commands
vim.opt.number = true
vim.opt.numberwidth = 2
vim.opt.relativenumber = true
-- even with the nice space/tab autodetect, prefer 4 for tab stops but let file
-- type specifics override (for instance a setting of 2 for markdown
vim.opt.tabstop = 4
-- default to folding on syntax
vim.opt.foldmethod = "syntax"
-- disable automatic line breaks, rely on visual wrapping instead
vim.opt.textwidth = 0
-- make white space visible, where that matters
vim.opt.list = true
local function nolist()
vim.opt.list = false
end
-- make white space invisible only in help text
vim.api.nvim_create_autocmd("FileType", {
pattern = "help",
callback = nolist,
})
-- set up folding preferences
vim.opt.fde = "1"
-- vim's spelling is smart enough for code, to only check comments
vim.opt.spell = true
-- add a hint for long lines
vim.opt.colorcolumn = "120"
-- default to expanding tabs, I'm not insane
vim.opt.expandtab = true
-- change buffer behaviors to no longer require changes when hiding a buffer
vim.opt.hidden = true
-- look for vimrc in the current directory as well as $MYVIMRC
-- e.g. place .init.lua at the root of a project directory for project specific settings
vim.opt.exrc = true
-- make looking for local changes secure
vim.opt.secure = true
-- more secure
vim.opt.modelines = 0
-- preserve some context
vim.opt.scrolloff = 3
-- make the cursor a bit easier to follows
vim.opt.cursorline = true
-- make search work a bit more like tab completion in bash
vim.opt.incsearch = true
vim.opt.wildmode = "longest:full"
vim.opt. wildmenu = true
-- line break handling
vim.opt.linebreak = true
vim.opt.showbreak = "+"
-- always on status line
vim.opt.laststatus = 2
-- let backspace work more naturally
vim.opt.backspace = "start,indent,eol"
-- favor modern encoding
vim.opt.enc = "utf-8"
-- more readable config for list mode
vim.opt.listchars = {nbsp = '¬', tab = '»·', trail = '·'}
-- smarter handling of case during search
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- centralize swap to have backup without clutter
vim.opt.directory = os.getenv("HOME") .. "/.var/nvim/swp//"
-- and undo
vim.opt.undofile = true
vim.opt.undodir = os.getenv("HOME") .. "/.nvim/undodir"
-- save when moving away
vim.api.nvim_create_autocmd("FocusLost", {pattern = "*", command = "wa"})
-- make sure to set TERM to xterm-256color in terminal program or app
vim.opt.background = "dark"
vim.opt.termguicolors = true
vim.cmd("colorscheme breezy")
vim.g.airline_theme = "breezy"
-- ensure autoread works, to detect file changes outside the editor
vim.opt.autoread = true
vim.api.nvim_create_autocmd("CursorHold", {pattern = "*", command = "checktime"})
-- for gui, make it easier to tell different instances apart
vim.opt.title = true
-- keep nvim from resetting font back to default from terminal config
vim.opt.guicursor = nil
local guiopts = vim.g.guioptions
if guiopts == nil then
guiopts = ""
end
guiopts = guiopts:gsub("r", "")
guiopts = guiopts:gsub("b", "")
guiopts = guiopts:gsub("T", "")
guiopts = guiopts:gsub("m", "")
vim.g.guioptions = guiopts
vim.opt.mouse = "nv"
if vim.loop.os_uname().sysname == 'Linux' then
vim.opt.gfn = "FiraCode Nerd Font Mono:h12"
require('nvim-projectconfig').setup({autocmd=true})
else
vim.opt.gfn = "FiraCode Nerd Font Mono:h16"
require('nvim-projectconfig').setup()
end
require("trouble").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}

129
init.vim
View file

@ -1,129 +0,0 @@
" set the directory where vimrc git project is located
let vimrc_git=$HOME . "/src/vimrc"
" it is a big fat key, after all
" N.B. should come before plugins and plugin specific settings
let mapleader = "\<Space>"
" source aux files also under git control
let oldwd = getcwd()
exec "cd " . vimrc_git
source plug.vim
source airline.vim
source syntastic.vim
source fzf.vim
source rust.vim
source mapping.vim
source jsonnet.vim
source nerdtree.vim
exec "cd " . oldwd
" set up a line number on the current line but relative above and below to help
" with motion commands
set number
set relativenumber
" even with the nice space/tab autodetect, prefer 4 for tab stops
" but let file type specifics override (for instance a setting of 2 for markdown
set tabstop=4
" default to folding on syntax
set foldmethod=syntax
" disable automatic line breaks, rely on visual wrapping instead
set textwidth=0
" make white space visible, where that matters
set list!
" except for help
autocmd FileType help setlocal nolist
" set up folding preferences
set fde=1
" vim's spelling is smart enough for code, to only check comments
set spell
" add a hint for long lines
set colorcolumn=120
" default to expanding tabs, I'm not insane
set expandtab
" change buffer behaviors to no longer require changes when hiding a buffer
set hidden
" look for vimrc in the current director as well as $MYVIMRC
set exrc
" make looking for local changes secure
set secure
" more secure
set modelines=0
" preserve some context
set scrolloff=3
" make the cursor a bit easier to follows
set cursorline
" make search work a bit more like tab completion in bash
set incsearch
set wildmode=longest:full
set wildmenu
" line break handling
set linebreak
set showbreak=+
" always on status line
set laststatus=2
" let backspace work more naturally
set backspace=start,indent,eol
" favor modern encoding
set enc=utf-8
" more readable config for list mode
set listchars+=nbsp,tab:»·,trail
set listchars-=eol:$
" smarter handling of case during search
set ignorecase
set smartcase
" centralize swap to have backup without clutter
set directory=$HOME/.var/nvim/swp//
" and undo
set undofile
set undodir=$HOME/.nvim/undodir
" make pastemode more accessible
set pastetoggle=<F2>
" save when moving away
au FocusLost * :wa
" make sure to set TERM to xterm-256color in terminal program or app
colorscheme breezy
set background=light
set termguicolors
" ensure autoread works, to detect file changes outside the editor
set autoread
au CursorHold * checktime
" for gui, make it easier to tell different instances apart
set title
" keep nvim from resetting font back to default from terminal config
set guicursor=
set guioptions-=r
set guioptions-=b
set guioptions-=T
set guioptions-=m
set gfn=DejaVu\ Sans\ Mono\ for\ Powerline:h13
" from https://stackoverflow.com/a/51424640
let s:fontsize = 13
function! AdjustFontSize(amount)
let s:fontsize = s:fontsize+a:amount
:execute "set gfn=DejaVu\\ Sans\\ Mono\\ for\\ Powerline:h" . s:fontsize
endfunction
noremap <C-Up> :call AdjustFontSize(1)<CR>
noremap <C-Down> :call AdjustFontSize(-1)<CR>
inoremap <C-Up> <Esc>:call AdjustFontSize(1)<CR>a
inoremap <C-Down> <Esc>:call AdjustFontSize(-1)<CR>a
" override the default location of vimwiki and change to markdown
let g:vimwiki_list = [{'path': '~/Documents/Wiki', 'syntax': 'markdown', 'ext': '.md'}]
let g:vimwiki_dir_link = 'index'
let g:LanguageClient_serverCommands = {
\ 'rust': ['rust-analyzer'],
\ }

View file

@ -9,31 +9,8 @@ set completeopt=menuone,noinsert,noselect
" Avoid showing extra messages when using completion
set shortmess+=c
" Configure LSP through rust-tools.nvim plugin.
" rust-tools will configure and enable certain LSP features for us.
" See https://github.com/simrat39/rust-tools.nvim#configuration
lua <<EOF
local nvim_lsp = require'lspconfig'
local opts = {
tools = { -- rust-tools options
autoSetHints = true,
hover_with_actions = true,
inlay_hints = {
show_parameter_hints = false,
parameter_hints_prefix = "",
other_hints_prefix = "",
},
},
-- all the opts to send to nvim-lspconfig
-- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
server = {}, -- rust-analyer options
}
require('rust-tools').setup(opts)
EOF
" Recognize slint files
autocmd BufEnter *.slint :setlocal filetype=slint
" Setup Completion
" See https://github.com/hrsh7th/nvim-cmp#basic-configuration
@ -73,10 +50,38 @@ cmp.setup({
EOF
" Set updatetime for CursorHold
" 300ms of no cursor movement to trigger CursorHold
set updatetime=750
" ms of no cursor movement to trigger CursorHold
set updatetime=3000
" Show diagnostic popup on cursor hold
autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics()
autocmd CursorHold * lua vim.diagnostic.open_float()
" have a fixed column for the diagnostics to appear in
" this removes the jitter when warnings/errors flow in
set signcolumn=yes
let g:LanguageClient_serverCommands = {
\ 'rust': ['rust-analyzer'],
\ }
lua<<EOF
vim.g.markdown_fenced_languages = {
"ts=typescript"
}
require("nvim-lsp-installer").setup {}
local lspconfig = require('lspconfig')
local util = require('lspconfig.util')
lspconfig.denols.setup {
on_attach = on_attach,
root_dir = util.root_pattern("deno.json", "deno.jsonc"),
init_options = {
enabled = true,
unstable = true
}
}
lspconfig.ts_ls.setup {
on_attach = on_attach,
root_dir = util.root_pattern("package.json"),
single_file_support = false
}
EOF

74
mapping.lua Normal file
View file

@ -0,0 +1,74 @@
-- from: https://sharksforarms.dev/posts/neovim-rust/
-- Set completeopt to have a better completion experience
-- :help completeopt
-- menuone: popup even when there's only one match
-- noinsert: Do not insert text until a selection is made
-- noselect: Do not select, force user to select one from the menu
vim.opt.completeopt = "menuone,noinsert,noselect"
-- Avoid showing extra messages when using completion
vim.opt.shortmess:append('c')
-- extend timeout to allow time for three character shortcuts
vim.opt.timeoutlen = 2500
local opts = { noremap = true, silent = true }
-- toggle gundo's display
vim.keymap.set('n', '<F5>', vim.cmd.UndotreeToggle)
-- quickly toggle a left, vsplit for an insanely powerful file explorer
vim.keymap.set('n', '<F8>', vim.cmd.NERDTreeToggle)
vim.keymap.set('n', '<F9>', vim.cmd.NERDTreeFind)
-- use similar key, esc, to exit terminal mode
vim.cmd("tnoremap <C-Space><Esc> <C-\\><C-n>")
-- Code navigation shortcuts
-- from https://github.com/neovim/nvim-lspconfig/blob/master/test/minimal_init.lua#L34
vim.keymap.set('n', '<Leader>ga', vim.lsp.buf.code_action)
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition)
vim.keymap.set('n', 'K', vim.lsp.buf.hover)
vim.keymap.set('n', '<Leader>gi', vim.lsp.buf.implementation)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help)
-- vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
-- vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set('n', '<Leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts)
vim.keymap.set('n', '<Leader>D', vim.lsp.buf.type_definition)
vim.keymap.set('n', '<Leader>nr', vim.lsp.buf.rename)
vim.keymap.set('n', '<Leader>gr', vim.lsp.buf.references)
vim.keymap.set('n', '<Leader>e', vim.diagnostic.open_float)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<Leader>q', vim.diagnostic.setloclist)
vim.keymap.set('n', '<Leader>xx', vim.cmd.TroubleToggle, opts)
vim.keymap.set('n', '<Leader>xw', function()
vim.cmd("TroubleToggle workspace_diagnostics")
end, opts)
vim.keymap.set('n', '<Leader>xd', function()
vim.cmd("TroubleToggle workspace_diagnostics")
end, opts)
vim.keymap.set('n', '<Leader>xq', function()
vim.cmd("TroubleToggle quickfix")
end, opts)
vim.keymap.set('n', '<Leader>xl', function()
vim.cmd("TroubleToggle loclist")
end, opts)
-- work with Trouble to view lists of diagnostic warnings/errors
vim.keymap.set('n', '<Leader>wt', function()
vim.cmd("e ~/Documents/Wiki/tags.md")
end, opts)
vim.keymap.set('n', '<Leader>tr', vim.cmd.VimwikiRebuildTags, opts)
vim.keymap.set('n', '<Leader>tg', vim.cmd.VimwikiGenerateTagLinks, opts)
-- TODO translate to lua
--function! VimwikiFindAllIncompleteTasks()
-- lvimgrep /- \[ \]/ *
-- lopen
--endfunction
--nmap <Leader>wa :call VimwikiFindAllIncompleteTasks()<CR>

View file

@ -1,31 +0,0 @@
" quickly clear Syntastic info
nmap <F4> :SyntasticReset<CR>
" toggle gundo's display
nmap <F5> :UndotreeToggle<CR>
" quickly toggle a right, vsplit for viewing, navigating whatever structure easy
" tags/tagbar can figure out for the current buffer
nmap <F9> :TagbarToggle<CR>
" quickly toggle a left, vsplit for an insanely powerful file explorer
nmap <F8> :NERDTreeToggle<CR>
" open tree to current buffer
nmap <S-F8> :NERDTreeFind<CR>
" use similar key, esc, to exit terminal mode
tnoremap <C-Space><Esc> <C-\><C-n>
" from: https://sharksforarms.dev/posts/neovim-rust/
" Code navigation shortcuts
nnoremap <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
nnoremap <silent> gD <cmd>lua vim.lsp.buf.implementation()<CR>
nnoremap <silent> <c-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
nnoremap <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<CR>
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR>
nnoremap <silent> <Leader>rn <cmd>lua vim.lsp.buf.rename()<CR>
" Goto previous/next diagnostic warning/error
nnoremap <silent> g[ <cmd>lua vim.lsp.diagnostic.goto_prev()<CR>
nnoremap <silent> g] <cmd>lua vim.lsp.diagnostic.goto_next()<CR>

108
plug.lua Normal file
View file

@ -0,0 +1,108 @@
local vim = vim
local Plug = vim.fn['plug#']
vim.call('plug#begin')
-- I try to keep these to a minimum and to understand what each plugin does and
-- adds to my existing(set up. I try to capture the value, at least to me, each
-- plugin adds. I've tried to logically group them, as well, to spot overlap
-- and redundancy.
-- dynamic font resizing(using ctl and arrow keys
Plug('tenxsoydev/size-matters.nvim')
-- custom colorscheme
Plug('fneu/breezy')
-- informational
-- lightweight but sophisticated status line
Plug('vim-airline/vim-airline')
Plug('vim-airline/vim-airline-themes')
-- visualize vim's undo tree
Plug('mbbill/undotree')
-- diagnostics display
Plug('folke/trouble.nvim')
-- icons for Trouble
Plug('kyazdani42/nvim-web-devicons')
-- files, folders, projects, etc.
-- file and dir browser
Plug('preservim/nerdtree')
-- integrate ripgrep, especially to be able to open matches, hugely useful for
-- code aware search
Plug('jremmen/vim-ripgrep')
-- Support for the cd replacement, zoxide
Plug('nanotee/zoxide.vim')
-- taskwarrior
Plug('xarthurx/taskwarrior.vim')
-- Wiki support - my life is in vimwiki
Plug('vimwiki/vimwiki', { ['branch'] = 'dev' })
-- git integration
Plug('tpope/vim-fugitive')
Plug('tpope/vim-rhubarb')
Plug('mhinz/vim-signify')
-- git support for nerdtree
Plug('Xuyuanp/nerdtree-git-plugin')
-- better support for JS
Plug('pangloss/vim-javascript')
-- find, complete, etc. on steroids
-- fast fuzzy finder
Plug('junegunn/fzf', { ['dir'] = '~/.fzf', ['do'] = function()
vim.fn['fzf#install']()
end })
Plug('junegunn/fzf.vim')
-- auto detect tab and space handling(rather than setting per project
Plug('tpope/vim-sleuth')
-- tools - all languages
-- look for .editorconfig(and merge into vim settings
Plug('editorconfig/editorconfig-vim')
-- auto format all the things
Plug('sbdchd/neoformat')
-- load config(from $CWD/.config/init.vim
Plug('windwp/nvim-projectconfig')
-- Collection of common configurations for the Nvim LSP client
Plug('neovim/nvim-lspconfig')
-- Add commands to add and manage lsp plugins
Plug('williamboman/nvim-lsp-installer')
-- Completion framework
-- I found these when updating(my lsp configuration and after using the
-- additional sources for a while, find them super useful for general editing
-- too
-- See hrsh7th's other plugins for more completion sources!
Plug('hrsh7th/nvim-cmp')
-- LSP completion source for nvim-cmp
Plug('hrsh7th/cmp-nvim-lsp')
-- Snippet completion source for nvim-cmp
Plug('hrsh7th/cmp-vsnip')
-- Other useful completion sources
Plug('hrsh7th/cmp-path')
Plug('hrsh7th/cmp-buffer')
-- Snippet engine
Plug('hrsh7th/vim-vsnip')
-- allows other programs and scripts to hook into NeoVim's language server
-- protocol support; adopted as a pre-requisite for prettier integration
Plug('jose-elias-alvarez/null-ls.nvim')
-- specific languages, programming(and otherwise
-- support for the Rust programming(language
Plug('rust-lang/rust.vim')
-- handles Rust configuration for LSP
Plug('mrcjkb/rustaceanvim')
-- support for jsonnet
Plug('google/vim-jsonnet')
-- nvm to make JS/TS/Node easier to work with
Plug('marene/nvm.vim')
vim.call('plug#end')

View file

@ -1,80 +0,0 @@
call plug#begin("~/.config/nvim/plugged")
" look for .editorconfig and merge into vim settings
Plug 'editorconfig/editorconfig-vim'
" file and dir browser
Plug 'preservim/nerdtree'
" git support for nerdtree
Plug 'Xuyuanp/nerdtree-git-plugin'
" syntax checking on steroids
Plug 'scrooloose/syntastic'
" integrate ripgrep, especially to be able to open matches, hugely useful for
" code aware search
Plug 'jremmen/vim-ripgrep'
" lightweight but sophisticated status line
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" git integration
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'mhinz/vim-signify'
" visualize vim's undo tree
Plug 'mbbill/undotree'
" better support for JS
Plug 'pangloss/vim-javascript'
" find, complete, etc. on steroids
" fast fuzzy finder
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" auto detect tab and space handling rather than setting per project
Plug 'tpope/vim-sleuth'
" support for the Rust programming language
Plug 'rust-lang/rust.vim'
" the rest of the rust config came from: https://sharksforarms.dev/posts/neovim-rust/
" Collection of common configurations for the Nvim LSP client
Plug 'neovim/nvim-lspconfig'
" Completion framework
Plug 'hrsh7th/nvim-cmp'
" LSP completion source for nvim-cmp
Plug 'hrsh7th/cmp-nvim-lsp'
" Snippet completion source for nvim-cmp
Plug 'hrsh7th/cmp-vsnip'
" Other usefull completion sources
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-buffer'
" See hrsh7th's other plugins for more completion sources!
" To enable more of the features of rust-analyzer, such as inlay hints and more!
Plug 'simrat39/rust-tools.nvim'
" Snippet engine
Plug 'hrsh7th/vim-vsnip'
" support for jsonnet
Plug 'google/vim-jsonnet'
" groovy syntax and indent
Plug 'vim-scripts/groovy.vim'
Plug 'vim-scripts/groovyindent-unix'
" auto format all the things
" https://github.com/Chiel92/vim-autoformat
Plug 'Chiel92/vim-autoformat'
" taskwarrior
Plug 'xarthurx/taskwarrior.vim'
" Wiki support
Plug 'vimwiki/vimwiki', { 'branch': 'dev' }
" integrating taskwarrior and vimwiki
Plug 'tools-life/taskwiki'
" Preferred color scheme
Plug 'fneu/breezy'
" All of your Plugins must be added before the following line
call plug#end() " required

18
projects/leptos.lua Normal file
View file

@ -0,0 +1,18 @@
vim.g.rustaceanvim = {
server = {
default_settings = {
['rust-analyzer'] = {
cargo = {
features = {
"ssr"
},
},
rustfmt = {
overrideCommand = {
"leptosfmt", "--stdin", "--rustfmt"
},
},
},
},
},
}

3
projects/text.lua Normal file
View file

@ -0,0 +1,3 @@
vim.cmd('colorscheme quiet')
vim.opt.background = "light"
vim.opt.termguicolors = true

View file

@ -1,11 +0,0 @@
" configure syntastic, advanced syntax checker, with some reasonable behaviors
"
" always stick detected errors in the location list
let g:syntastic_always_populate_loc_list = 1
" open but only when errors are detected; default closes when errors are cleared
" but doesn't open the list automatically
let g:syntastic_auto_loc_list = 0
" check when first opening a file
let g:syntastic_check_on_open = 0
" don't check on writing and quitting
let g:syntastic_check_on_wq = 0

4
wiki.vim Normal file
View file

@ -0,0 +1,4 @@
" override the default location of vimwiki and change to markdown
let g:vimwiki_list = [{'path': '~/Documents/Wiki', 'syntax': 'markdown', 'ext': '.md'}]
let g:vimwiki_dir_link = 'index'
let g:vimwiki_global_ext = 0