Compare commits

...

41 Commits

Author SHA1 Message Date
ViViDboarder 66c11ff5a0 Update 0.9 plugin snapshots 2024-03-29 12:34:00 -07:00
ViViDboarder a2c6ba1f41 Pin telescope for lower than 0.9 versions of nvim 2024-03-29 12:31:57 -07:00
ViViDboarder f9fa1677d6 Use pipx install since upgrade doesn't work on first install
Maybe should add --force to allow upgrades, but keeping it stable for now.
2023-12-13 10:26:27 -08:00
ViViDboarder 87ad6b6947 Big update to coding helpers install to prefer system packages
Currently only for luarocks, pip, and npm packages.
2023-12-13 10:18:10 -08:00
ViViDboarder 3a637add78 Rename install-language-servers.sh to install-coding-helpers.sh
This now has much more than just language servers.
2023-12-13 09:29:51 -08:00
ViViDboarder 60819a7dff Language Servers: Fix go detection
maybe_run only checks the first arugment, which for go modules
would have been `env`. Since `env` exists, it would always attempt
to do the `go install` command, regardless of whether or not go
exists.

This patch moves the env to an exported variable rather than
being passed inline.
2023-12-13 09:25:51 -08:00
ViViDboarder 702af2fa15 Language Servers: Add smarter installs for pip packages using pipx 2023-12-13 09:25:51 -08:00
ViViDboarder 77e8e797d0 Fix rust-tools
DAP for rust doesn't work. Something to do with paths or something.
2023-12-13 09:25:51 -08:00
ViViDboarder abe6a88fa7 Add dap 2023-12-08 11:49:01 -08:00
ViViDboarder b3f73d92dc Fix rust-tools 2023-12-08 09:35:32 -08:00
ViViDboarder b652a9b49d Update 0.7 plugins 2023-11-17 22:52:25 +00:00
ViViDboarder 35ad43e6a3 Link latest snapshot to nvim-0.9 2023-11-15 09:56:19 -08:00
ViViDboarder 76903741e7 Disable vim_markdown_frontmatter when obsidian is loaded 2023-11-15 09:53:47 -08:00
ViViDboarder b9917f562e Add markdown_inline treesitter parser 2023-11-15 09:53:28 -08:00
ViViDboarder 7e32c53c05 Update sha for sg.nvim to include my patch 2023-11-15 09:24:36 -08:00
ViViDboarder d52d57f5d5 Indicate min nvim version along side lspconfig version 2023-11-15 09:22:22 -08:00
ViViDboarder dac42c039a Configure bashls to not run shellcheck
I was getting duplicate warnings from shellcheck because it
was being run by bashls and null-ls
2023-11-15 09:22:22 -08:00
ViViDboarder 9b05e6a4e0 Update some version pinning
Telescope master is now 0.9 and on. Making sure 0.7 versions are pinned
to stable releases, even if 0.9 is using same releases for now.

For todo-comment, using a version rule rather than a moving tag to
avoid got weirdness.
2023-11-15 08:07:12 -08:00
ViViDboarder ab29c55c39 Update comments to explain a bit better 2023-11-15 08:05:18 -08:00
ViViDboarder 6f7627d290 Move darknotify config to it's own file 2023-11-10 14:54:14 -08:00
ViViDboarder 00598ea1c4 Fix obsidian workspaces list 2023-11-10 14:49:19 -08:00
ViViDboarder b97d2aafbe Lazy load sg and disable cody 2023-11-10 11:25:19 -08:00
ViViDboarder cc7d7820b9 Use full github urls for plugins and update all 2023-11-10 11:25:03 -08:00
ViViDboarder 78f926dd79 Update obsidian plugins to auto handle git 2023-11-10 11:24:11 -08:00
ViViDboarder cf2c776af6 Fix indentation for fugitive fix commit 2023-10-20 17:02:52 -07:00
ViViDboarder c338a0b580 Add sourcegraph 2023-10-20 17:00:30 -07:00
ViViDboarder 20af7a9374 Add Obsidian 2023-10-20 17:00:30 -07:00
ViViDboarder e783fde179 Unpin fugitive for patched Neovim versions 2023-09-23 23:10:48 -07:00
ViViDboarder 7739ba5579 Remove pyls and replace it with pyright for Vim Ale 2023-07-20 11:32:57 -07:00
ViViDboarder 8ed18d206d Add fallback install of rust-analyzer from GitHub 2023-07-20 11:15:06 -07:00
ViViDboarder c077ee967c Fix 0.7 packages 2023-06-27 21:48:52 -07:00
ViViDboarder 7a275315f0 Add markdown treesitter parser 2023-06-27 16:29:21 -07:00
ViViDboarder 0387b70d3b Make data dir a volume 2023-06-27 16:24:39 -07:00
ViViDboarder 50a72348e8 Return some top level mappings for lsp and fix diagnostic 2023-06-26 15:02:36 -07:00
ViViDboarder 5c77243b8c Add csv column to statusline 2023-06-26 15:02:36 -07:00
ViViDboarder 0d8261b924 Only load nvim lua configs for version 0.6+
That's now minimum version for my Lua configs. 0.5 can use vimscript.
2023-06-15 11:41:21 -07:00
ViViDboarder f82987bc19 Make wombat_lush default neovim theme 2023-06-13 17:27:23 -07:00
ViViDboarder 29d9b7960d Disable lua_ls formatting in favor of stylua 2023-06-13 17:24:37 -07:00
ViViDboarder ad47f57d68 Lazy load snippets
This shaves 300ms of startup time
2023-06-13 17:12:45 -07:00
ViViDboarder 963cc8bb6a Use my keymap functions instead of whichkey for telescope 2023-06-13 17:03:16 -07:00
ViViDboarder a616e2e14c Drop support for nvim 0.5 2023-06-13 16:47:03 -07:00
19 changed files with 630 additions and 576 deletions

View File

@ -13,9 +13,13 @@ install:
update:
sh ./update-plugins.sh
.PHONY: install-coding-helpers
install-coding-helpers:
sh ./install-coding-helpers.sh
.PHONY: install-language-servers
install-language-servers:
sh ./install-language-servers.sh
install-language-servers: install-coding-helpers
@echo "Using obsolete make target. Change to install-coding-helpers"
.PHONY: uninstall
uninstall:

View File

@ -1,3 +1,5 @@
# hadolint global ignore=DL3018,DL3059
FROM alpine:3.18
RUN apk add --no-cache \
@ -23,6 +25,7 @@ RUN apk add --no-cache shellcheck rustup || true
RUN adduser -D -h /home/vividboarder -s /bin/bash --ingroup users vividboarder
USER vividboarder
# Create home and XDG paths
WORKDIR /home/vividboarder
ENV HOME /home/vividboarder
ENV XDG_CONFIG_HOME $HOME/.config
@ -44,8 +47,8 @@ RUN mkdir $HOME/bin
ENV PATH $HOME/bin:$PATH
# Install Language servers
COPY --chown=vividboarder:users ./install-language-servers.sh ./
RUN ./install-language-servers.sh
COPY --chown=vividboarder:users ./install-coding-helpers.sh ./
RUN ./install-coding-helpers.sh
# Add config
COPY --chown=vividboarder:users ./neovim $HOME/.config/nvim
@ -57,6 +60,7 @@ RUN nvim --headless -c "lua require('plugins.treesitter').bootstrap()" -c quital
# Create persistent data dir
RUN mkdir -p /home/vividboarder/.data
VOLUME /home/vividboarder/.data
# Generate workdir
RUN mkdir /home/vividboarder/data

View File

@ -41,13 +41,13 @@ else
fi
# Determines if a command exists or not
function command_exist() {
function command_exists() {
command -v "$1" > /dev/null 2>&1;
}
# Runs a command or spits out the output
function maybe_run() {
if command_exist "$1" ;then
if command_exists "$1" ;then
echo "> $*"
# shellcheck disable=2048,2086
eval $*
@ -56,13 +56,80 @@ function maybe_run() {
fi
}
# Determine if we should install a command using userspace commands
function should_install_user() {
if ! command_exists "$1" ;then
# Install in userspace if command doesn't exist
return 0
fi
local bin_path=""
bin_path="$(which "$1")"
# Install in user space if it's already installed in a subdir of the user
# home dir
if [[ ${bin_path}/ = ${HOME}/* ]] ;then
return 0
else
echo "WARNING: $1 is already installed by the system."
return 1
fi
}
# Runs the "right" pip for installing if there is no global package
function maybe_pip_install() {
# Filter for user path bins
local user_bins=()
for bin in "$@" ;do
if should_install_user "$bin" ;then
user_bins+=("$bin")
fi
done
# Short circuit if empty
if [ ${#user_bins[@]} -eq 0 ] ;then
return
fi
if command_exists pipx ;then
# Prefer pipx to keep environments isolated
pipx install "${user_bins[@]}"
else
if command_exists pip3 ;then
# If pip3 is there, use it to ensure we're using python 3
pip3 install --user --upgrade "${user_bins[@]}"
else
# Use pip and hope for the best
pip install --user --upgrade "${user_bins[@]}"
fi
fi
}
# Installs npm packages if there is no global package
function maybe_npm_install() {
# Filter for user path bins
local user_bins=()
for bin in "$@" ;do
if should_install_user "$bin" ;then
user_bins+=("$bin")
fi
done
# Short circuit if empty
if [ ${#user_bins[@]} -eq 0 ] ;then
return
fi
maybe_run npm install -g "${user_bins[@]}"
}
## Language servers
function install_language_servers() {
echo "### Installing language servers..."
# bash
if want_lang bash ;then
maybe_run npm install -g bash-language-server
maybe_npm_install bash-language-server
fi
# Kotlin
@ -70,17 +137,26 @@ function install_language_servers() {
# Python
if want_lang python ;then
maybe_run npm install -g pyright
maybe_npm_install pyright
fi
# Rust
if want_lang rust ;then
maybe_run rustup component add rustfmt rust-analysis rust-src clippy rust-analyzer
if ! command_exists rustup ;then
maybe_run release-gitter --git-url "https://github.com/rust-lang/rust-analyzer" \
--map-system Windows=pc-windows-msvc --map-system Linux=unknown-linux-gnu --map-system Darwin=apple-darwin \
--exec "'F={}; gzip -d /tmp/\$F && mv /tmp/\$(echo \$F|sed s/\.gz\$//) ~/bin/rust-analyzer && chmod +x ~/bin/rust-analyzer'" \
"rust-analyzer-{arch}-{system}.gz" /tmp/
fi
fi
# Go
if want_lang go ;then
maybe_run env GO111MODULE=on go install golang.org/x/tools/gopls@latest
if should_install_user gopls ;then
export GO111MODULE=on
maybe_run go install golang.org/x/tools/gopls@latest
fi
fi
echo ""
@ -92,33 +168,28 @@ function install_linters() {
# Python
if want_lang python ;then
maybe_run pip install --user --upgrade flake8
maybe_run pip install --user --upgrade mypy || echo "WARNING: mypy is py3 only"
maybe_run pip3 install --user --upgrade flake8 mypy
maybe_pip_install mypy || echo "WARNING: mypy is py3 only"
fi
# CSS
if want_lang css || want_lang web ;then
maybe_run npm install -g csslint
maybe_npm_install csslint
fi
# Vim
if want_lang vim || want_lang neovim ;then
maybe_run pip install --user --upgrade vim-vint
maybe_run pip3 install --user --upgrade vim-vint
maybe_pip_install vim-vint
fi
# YAML
if want_lang yaml ;then
maybe_run pip install --user --upgrade yamllint
maybe_run pip3 install --user --upgrade yamllint
maybe_pip_install yamllint
fi
# Text / Markdown
if want_lang text || want_lang prose ;then
maybe_run npm install -g alex write-good
maybe_run pip install --user --upgrade proselint
maybe_run pip3 install --user --upgrade proselint
maybe_npm_install alex write-good
maybe_pip_install proselint
fi
# Makefile
@ -135,22 +206,27 @@ function install_linters() {
# Lua
if want_lang lua || want_lang neovim ;then
maybe_run luarocks --local install luafilesystem
# Version pinned to version in pre-commit
if ! maybe_run lua -e "'require(\"lfs\")'" ;then
maybe_run luarocks --local install luafilesystem
fi
# Version pinned to version in pre-commit so we avoid global check
maybe_run luarocks --local install luacheck 1.1.0
fi
# Docker
if want_lang docker ;then
hadolint_arm64=arm64
if [ "$(uname -s)" == "Darwin" ]; then
hadolint_arm64=x86_64
if should_install_user hadolint ;then
local hadolint_arm64=arm64
if [ "$(uname -s)" == "Darwin" ] ;then
hadolint_arm64=x86_64
fi
maybe_run release-gitter --git-url "https://github.com/hadolint/hadolint" \
--map-arch aarch64=$hadolint_arm64 \
--map-arch arm64=$hadolint_arm64 \
--exec "'mv ~/bin/{} ~/bin/hadolint && chmod +x ~/bin/hadolint'" \
"hadolint-{system}-{arch}" ~/bin
fi
maybe_run release-gitter --git-url "https://github.com/hadolint/hadolint" \
--map-arch aarch64=$hadolint_arm64 \
--map-arch arm64=$hadolint_arm64 \
--exec "'mv ~/bin/{} ~/bin/hadolint && chmod +x ~/bin/hadolint'" \
"hadolint-{system}-{arch}" ~/bin
fi
# Terraform
@ -178,14 +254,12 @@ function install_fixers() {
# CSS/JS/HTML/JSON/YAML/Markdown/and more!
if want_lang javascript || want_lang html || want_lang css || want_lang web || want_lang json ;then
maybe_run npm install -g prettier
maybe_npm_install prettier
fi
# Python
if want_lang python ;then
maybe_run pip install --user --upgrade "'autopep8<1.7.0'" reorder-python-imports
maybe_run pip install --user --upgrade autopep8 reorder-python-imports black pyls-black python-lsp-black pyls-isort pyls-mypy || echo "WARNING: black is py3 only"
maybe_run pip3 install --user --upgrade black pyls-black python-lsp-black pyls-isort pyls-mypy autopep8 reorder-python-imports
maybe_pip_install black reorder-python-imports
fi
# Rust
@ -196,12 +270,13 @@ function install_fixers() {
# Lua
if want_lang lua || want_lang neovim ;then
# Version pinned to version in pre-commit
local stylua_version=0.17.1
local stylua_version=0.19.1
if ! release-gitter --git-url "https://github.com/JohnnyMorganz/StyLua" \
--version "v$stylua_version" \
--extract-files "stylua" \
--map-arch arm64=aarch64 \
--map-system Windows=windows --map-system Linux=linux --map-system Darwin=macos \
--extract-all --exec "chmod +x ~/bin/stylua" \
--exec "chmod +x ~/bin/stylua" \
"stylua-{system}-{arch}.zip" ~/bin ; then
maybe_run cargo install --version "$stylua_version" stylua
fi
@ -210,12 +285,21 @@ function install_fixers() {
echo ""
}
## Debuggers
function install_debuggers() {
# Python
if want_lang python ;then
maybe_pip_install debugpy
fi
}
function main() {
maybe_run pip3 install --user --upgrade release-gitter
maybe_pip_install release-gitter
install_language_servers
install_linters
install_fixers
install_debuggers
echo ""
echo "DONE"

View File

@ -1,5 +1,5 @@
" Maybe load init.lua
if has('nvim-0.5')
if has('nvim-0.6')
lua require('init')
else
set runtimepath+='~/.vim'

View File

@ -21,7 +21,7 @@ function _G.update_colors()
-- Set colorscheme based on env
local utils = require("utils")
local default_color = "solarized"
local default_color = "wombat_lush"
local env_color = utils.env_default("VIM_COLOR", default_color)
env_color = utils.env_default("NVIM_COLOR", env_color)

View File

@ -1,3 +1,7 @@
if vim.fn.has("nvim-0.6.0") ~= 1 then
print("ERROR: Requires nvim >= 0.6.0")
end
local o = vim.o
-- Helpers

View File

@ -7,16 +7,6 @@ if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
end
vim.cmd("packadd packer.nvim")
-- Configures dark-notify to use colors from my environment
local function config_dark_notify()
require("dark_notify").run({
onchange = function(_)
-- Defined in _colors
_G.update_colors()
end,
})
end
local packer = require("packer")
local packer_util = require("packer.util")
local use = packer.use
@ -28,7 +18,6 @@ packer.init({
[">=0.8.0"] = "latest-0.8",
[">=0.7.0"] = "latest-0.7",
[">=0.6.0"] = "latest-0.6",
[">=0.5.0"] = "latest",
}),
snapshot_path = packer_util.join_paths(vim.fn.stdpath("config"), "packer_snapshots"),
display = {
@ -56,7 +45,7 @@ end
-- Let Packer manage and lazyload itself
use({
"wbthomason/packer.nvim",
"https://github.com/wbthomason/packer.nvim",
cmd = {
"PackerClean",
"PackerCompile",
@ -75,9 +64,9 @@ use({
-- Colorschemes
use({
"vim-scripts/wombat256.vim",
"https://github.com/vim-scripts/wombat256.vim",
{
"ViViDboarder/wombat.nvim",
"https://github.com/ViViDboarder/wombat.nvim",
requires = {
{
"rktjmp/lush.nvim",
@ -88,47 +77,50 @@ use({
},
},
},
{ "ViViDboarder/wombuddy.nvim", requires = "tjdevries/colorbuddy.vim" },
{
"ishan9299/nvim-solarized-lua",
"https://github.com/ViViDboarder/wombuddy.nvim",
requires = "https://github.com/tjdevries/colorbuddy.vim",
},
{
"https://github.com/ishan9299/nvim-solarized-lua",
commit = utils.map_version_rule({
[">=0.7.0"] = utils.nil_val,
["<0.7.0"] = "faba49b",
}),
},
{
"folke/tokyonight.nvim",
"https://github.com/folke/tokyonight.nvim",
run = 'fish -c \'echo "set --path --prepend fish_themes_path "(pwd)"/extras" > ~/.config/fish/conf.d/tokyonight.fish\' || true', -- luacheck: no max line length
},
})
-- Auto and ends to some ifs and dos
use("tpope/vim-endwise")
use("https://github.com/tpope/vim-endwise")
-- Unix commands from vim? Yup!
use("tpope/vim-eunuch")
use("https://github.com/tpope/vim-eunuch")
-- Adds repeats for custom motions
use("tpope/vim-repeat")
use("https://github.com/tpope/vim-repeat")
-- Readline shortcuts
use("tpope/vim-rsi")
use("https://github.com/tpope/vim-rsi")
-- Surround motions
use("tpope/vim-surround")
use("https://github.com/tpope/vim-surround")
-- Better netrw
use("tpope/vim-vinegar")
use("https://github.com/tpope/vim-vinegar")
-- Easier jumping to lines
use("vim-scripts/file-line")
use("https://github.com/vim-scripts/file-line")
-- Auto ctags generation
use("ludovicchabant/vim-gutentags")
use("https://github.com/ludovicchabant/vim-gutentags")
-- Make it easier to discover some of my keymaps
use({
"folke/which-key.nvim",
"https://github.com/folke/which-key.nvim",
config = function()
require("plugins.whichkey").configure()
end,
@ -137,7 +129,7 @@ use({
-- Better commenting
use({
"tomtom/tcomment_vim",
"https://github.com/tomtom/tcomment_vim",
config = function()
require("utils").keymap_set("n", "//", ":TComment<CR>", { desc = "Toggle comment" })
require("utils").keymap_set("v", "//", ":TCommentBlock<CR>", { desc = "Toggle comment" })
@ -146,7 +138,7 @@ use({
-- Allow wrapping and joining of arguments across multiple lines
use({
"FooSoft/vim-argwrap",
"https://github.com/FooSoft/vim-argwrap",
config = function()
require("utils").keymap_set("n", "<Leader>a", "<cmd>ArgWrap<CR>", {
desc = "Wrap or unwrap arguments",
@ -156,10 +148,13 @@ use({
-- Adds git operations to vim
use({
"tpope/vim-fugitive",
-- HACK: Pinning to avoid neovim bug https://github.com/neovim/neovim/issues/10121
-- when used in status line.
tag = "v3.6",
"https://github.com/tpope/vim-fugitive",
tag = utils.map_version_rule({
[">=0.9.2"] = utils.nil_val,
-- HACK: Pinning to avoid neovim bug https://github.com/neovim/neovim/issues/10121
-- when used in status line.
["<0.9.2"] = "v3.6",
}),
config = function()
require("utils").keymap_set("n", "gb", "<cmd>Git blame<CR>", { desc = "Git blame" })
require("utils").keymap_set("n", "gc", "<cmd>Git commit<CR>", { desc = "Git commit" })
@ -171,7 +166,7 @@ use({
-- Quick toggling of Location and Quickfix lists
use({
"milkypostman/vim-togglelist",
"https://github.com/milkypostman/vim-togglelist",
config = function()
require("utils").keymap_set("n", "<F6>", ":call ToggleQuickfixList()<CR>", { desc = "Toggle quickfix" })
require("utils").keymap_set("n", "<F7>", ":call ToggleLocationList()<CR>", { desc = "Toggle location list" })
@ -180,7 +175,7 @@ use({
-- Find text everywhere!
use({
"mhinz/vim-grepper",
"https://github.com/mhinz/vim-grepper",
config = function()
require("plugins.grepper")
end,
@ -188,7 +183,7 @@ use({
-- Highlight inline colors
use({
"norcalli/nvim-colorizer.lua",
"https://github.com/norcalli/nvim-colorizer.lua",
config = function()
require("colorizer").setup()
end,
@ -196,19 +191,19 @@ use({
-- Custom status line
use({
"SmiteshP/nvim-gps",
requires = "nvim-treesitter/nvim-treesitter",
"https://github.com/SmiteshP/nvim-gps",
requires = "https://github.com/nvim-treesitter/nvim-treesitter",
disable = vim.fn.has("nvim-0.7.0") == 1,
})
-- Replaces gps for 0.7+
use({
"SmiteshP/nvim-navic",
requires = "neovim/nvim-lspconfig",
"https://github.com/SmiteshP/nvim-navic",
requires = "https://github.com/neovim/nvim-lspconfig",
disable = vim.fn.has("nvim-0.7.0") ~= 1,
})
use({
"nvim-lualine/lualine.nvim",
"https://github.com/nvim-lualine/lualine.nvim",
config = function()
require("plugins.lualine").config_lualine()
end,
@ -217,17 +212,19 @@ use({
-- On Mac, update colors when dark mode changes
use({
"cormacrelf/dark-notify",
"https://github.com/cormacrelf/dark-notify",
disable = not vim.g.is_mac,
-- Download latest release on install
run = "curl -s https://api.github.com/repos/cormacrelf/dark-notify/releases/latest | jq '.assets[].browser_download_url' | xargs curl -Ls | tar xz -C ~/.local/bin/", -- luacheck: no max line length
config = config_dark_notify,
requires = "nvim-lualine/lualine.nvim",
config = function()
require("plugins.darknotify")
end,
requires = "https://github.com/nvim-lualine/lualine.nvim",
})
-- Custom start screen
use({
"mhinz/vim-startify",
"https://github.com/mhinz/vim-startify",
config = function()
require("utils").require_with_local("plugins.startify")
end,
@ -237,7 +234,7 @@ use({
-- Configure language servers
use({
"neovim/nvim-lspconfig",
"https://github.com/neovim/nvim-lspconfig",
tag = utils.map_version_rule({
-- [">=0.8.0"] = utils.nil_val,
[">=0.7.0"] = utils.nil_val,
@ -246,12 +243,67 @@ use({
}),
})
-- Debug adapter protocol
use({
"https://github.com/mfussenegger/nvim-dap",
-- TODO: Move to lazy.nvim and allow it to load this only when the required debuggers are loaded
ft = { "python", "rust" },
})
use({
"https://github.com/rcarriga/nvim-dap-ui",
requires = { "https://github.com/mfussenegger/nvim-dap" },
after = "nvim-dap",
config = function()
require("dapui").setup({
icons = {
expanded = "-",
collapsed = "+",
current_frame = ">",
},
controls = {
icons = {
disconnect = "disconnect",
pause = "pause",
play = "play",
run_last = "last",
step_back = "back",
step_into = "into",
step_out = "out",
step_over = "over",
terminate = "term",
},
},
})
local dap, dapui = require("dap"), require("dapui")
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
end,
})
use({
"https://github.com/mfussenegger/nvim-dap-python",
requires = { "https://github.com/mfussenegger/nvim-dap" },
after = "nvim-dap",
config = function()
require("dap-python").setup()
end,
ft = "python",
})
-- Install language servers
use({
"williamboman/mason.nvim",
"https://github.com/williamboman/mason.nvim",
requires = {
"neovim/nvim-lspconfig",
"williamboman/mason-lspconfig.nvim",
"https://github.com/neovim/nvim-lspconfig",
"https://github.com/williamboman/mason-lspconfig.nvim",
},
-- Only supports >=0.7.0
disable = vim.fn.has("nvim-0.7.0") ~= 1,
@ -259,19 +311,19 @@ use({
-- Lua dev for vim
use({
"folke/neodev.nvim",
requires = "neovim/nvim-lspconfig",
"https://github.com/folke/neodev.nvim",
requires = "https://github.com/neovim/nvim-lspconfig",
})
-- Rust analyzer
use({
"simrat39/rust-tools.nvim",
"https://github.com/simrat39/rust-tools.nvim",
disable = vim.fn.has("nvim-0.7.0") ~= 1,
})
-- Better display of lsp diagnostics
use({
"folke/trouble.nvim",
"https://github.com/folke/trouble.nvim",
tag = utils.map_version_rule({
[">=0.7.2"] = "v2.*",
["<0.7.2"] = "v1.*",
@ -280,7 +332,7 @@ use({
-- Incremental lsp rename view
use({
"smjonas/inc-rename.nvim",
"https://github.com/smjonas/inc-rename.nvim",
config = function()
require("inc_rename").setup({
input_buffer_type = "dressing",
@ -292,48 +344,45 @@ use({
-- Generic linter/formatters in diagnostics API
use({
"jose-elias-alvarez/null-ls.nvim",
"https://github.com/jose-elias-alvarez/null-ls.nvim",
branch = utils.map_version_rule({
[">=0.8.0"] = utils.nil_val,
[">=0.7.0"] = "0.7-compat",
["<0.7.0"] = utils.nil_val, -- use pinned commits
["<0.7.0"] = utils.nil_val, -- use pinned commit
}),
commit = utils.map_version_rule({
[">=0.8.0"] = utils.nil_val,
[">=0.7.0"] = utils.nil_val, -- Use pinned branch
[">=0.6.0"] = "4b403d2d724f48150ded41189ae4866492a8158b",
[">=0.5.1"] = "739a98c12bedaa2430c4a3c08d1d22ad6c16513e",
[">=0.5.0"] = "3e7390735501d0507bf2c2b5c2e7a16f58deeb81",
}),
requires = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
requires = { "https://github.com/nvim-lua/plenary.nvim", "https://github.com/neovim/nvim-lspconfig" },
})
-- Writing
-- abolish/pencil
use({
"preservim/vim-pencil",
"https://github.com/preservim/vim-pencil",
cmd = { "Pencil" },
})
use({
"preservim/vim-textobj-sentence",
requires = "kana/vim-textobj-user",
"https://github.com/preservim/vim-textobj-sentence",
requires = "https://github.com/kana/vim-textobj-user",
})
use({
"junegunn/goyo.vim",
"https://github.com/junegunn/goyo.vim",
cmd = { "Goyo", "Zen" },
config = [[require("plugins.goyo-limelight")]],
requires = { "junegunn/limelight.vim", cmd = "Limelight" },
requires = { "https://github.com/junegunn/limelight.vim", cmd = "Limelight" },
})
-- Treesitter
use({
"nvim-treesitter/nvim-treesitter",
"https://github.com/nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
commit = utils.map_version_rule({
[">=0.8.0"] = utils.nil_val,
[">=0.7.0"] = "4cccb6f494eb255b32a290d37c35ca12584c74d0",
[">=0.6.0"] = "bc25a6a5",
[">=0.5.0"] = "a189323454d1215c682c7ad7db3e6739d26339c4",
}),
config = function()
require("utils").require_with_local("plugins.treesitter").setup()
@ -341,8 +390,8 @@ use({
})
--[[ TODO: Enable this as an alterantive or fallback for LSPs
use({
"nvim-treesitter/nvim-treesitter-refactor",
requires = "nvim-treesitter/nvim-treesitter",
"https://github.com/nvim-treesitter/nvim-treesitter-refactor",
requires = "https://github.com/nvim-treesitter/nvim-treesitter",
commit = utils.map_version_rule({
[">=0.7.0"] = utils.nil_val,
["<0.7.0"] = "75f5895",
@ -350,22 +399,23 @@ use({
})
--]]
use({
"nvim-treesitter/nvim-treesitter-textobjects",
requires = "nvim-treesitter/nvim-treesitter",
"https://github.com/nvim-treesitter/nvim-treesitter-textobjects",
requires = "https://github.com/nvim-treesitter/nvim-treesitter",
commit = utils.map_version_rule({
[">=0.7.0"] = utils.nil_val,
[">=0.8.0"] = utils.nil_val,
[">=0.7.0"] = "8673926519ea61069f9c1366d1ad1949316d250e",
["<0.7.0"] = "eca3bf30334f85259d41dc060d50994f8f91ef7d",
}),
})
-- Completion
use({
"L3MON4D3/LuaSnip",
"https://github.com/L3MON4D3/LuaSnip",
tag = "v1.*",
})
use({
"hrsh7th/nvim-cmp",
"https://github.com/hrsh7th/nvim-cmp",
config = function()
require("plugins.completion").config_cmp()
end,
@ -375,40 +425,40 @@ use({
}),
requires = {
{
"hrsh7th/cmp-nvim-lsp",
"https://github.com/hrsh7th/cmp-nvim-lsp",
after = "nvim-cmp",
commit = utils.map_version_rule({
[">=0.7.0"] = utils.nil_val,
["<0.7.0"] = "3cf38d9c957e95c397b66f91967758b31be4abe6",
}),
},
{ "hrsh7th/cmp-buffer", after = "nvim-cmp" },
{ "f3fora/cmp-spell", after = "nvim-cmp" },
{ "https://github.com/hrsh7th/cmp-buffer", after = "nvim-cmp" },
{ "https://github.com/f3fora/cmp-spell", after = "nvim-cmp" },
{
"saadparwaiz1/cmp_luasnip",
"https://github.com/saadparwaiz1/cmp_luasnip",
after = "nvim-cmp",
commit = utils.map_version_rule({
[">0.7.0"] = utils.nil_val,
[">=0.5.0"] = "b10829736542e7cc9291e60bab134df1273165c9",
}),
},
"L3MON4D3/LuaSnip",
"https://github.com/L3MON4D3/LuaSnip",
},
event = "InsertEnter *",
})
-- Add snippets
use({
"rafamadriz/friendly-snippets",
requires = "L3MON4D3/LuaSnip",
"https://github.com/rafamadriz/friendly-snippets",
requires = "https://github.com/L3MON4D3/LuaSnip",
after = "LuaSnip",
config = function()
require("luasnip.loaders.from_vscode").load()
require("luasnip.loaders.from_vscode").lazy_load()
end,
})
use({
"ray-x/lsp_signature.nvim",
"https://github.com/ray-x/lsp_signature.nvim",
config = function()
require("lsp_signature").setup({
extra_trigger_chars = { "(", "," },
@ -422,15 +472,16 @@ use({
-- Fuzzy Finder
use({
"nvim-telescope/telescope.nvim",
"https://github.com/nvim-telescope/telescope.nvim",
requires = {
"nvim-lua/plenary.nvim",
"nvim-lua/popup.nvim",
"nvim-telescope/telescope-file-browser.nvim",
"https://github.com/nvim-lua/plenary.nvim",
"https://github.com/nvim-lua/popup.nvim",
"https://github.com/nvim-telescope/telescope-file-browser.nvim",
},
tag = utils.map_version_rule({
-- Follow stable release tag
[">=0.7.0"] = "0.1.0",
[">=0.9.0"] = "0.1.*",
[">=0.7.0"] = "0.1.2",
[">=0.6.0"] = "nvim-0.6",
["<0.6.0"] = "nvim-0.5.1",
["==0.5.0"] = "nvim-0.5.0",
@ -441,10 +492,10 @@ use({
})
-- Filetypes
use("ViViDboarder/vim-forcedotcom")
use("hsanson/vim-android")
use("https://github.com/ViViDboarder/vim-forcedotcom")
use("https://github.com/hsanson/vim-android")
use({
"sheerun/vim-polyglot",
"https://github.com/sheerun/vim-polyglot",
config = function()
-- TODO: Replace with api calls when dropping 0.6
vim.cmd([[
@ -458,21 +509,22 @@ use({
-- Debuging nvim config
use({
"tweekmonster/startuptime.vim",
"https://github.com/tweekmonster/startuptime.vim",
cmd = { "StartupTime" },
})
-- Fancy todo highlighting
use({
"folke/todo-comments.nvim",
"https://github.com/folke/todo-comments.nvim",
requires = {
"nvim-lua/plenary.nvim",
"https://github.com/nvim-lua/plenary.nvim",
},
config = function()
require("plugins.todo")
end,
-- Tag and branch rule because old versions are supported on a branch while latest stable is a moving tag
tag = utils.map_version_rule({
[">=0.8.0"] = "stable",
[">=0.8.0"] = "v1.*",
["<0.8.0"] = utils.nil_val,
}),
branch = utils.map_version_rule({
@ -483,19 +535,89 @@ use({
-- Fancy notifications
use({
"rcarriga/nvim-notify",
"https://github.com/rcarriga/nvim-notify",
config = function()
require("plugins.notify")
end,
})
use({
"stevearc/dressing.nvim",
"https://github.com/stevearc/dressing.nvim",
branch = utils.map_version_rule({
[">=0.8.0"] = utils.nil_val,
["<0.8.0"] = "nvim-0.7",
}),
config = function()
require("dressing").setup({})
end,
})
-- Obsidian notes
-- This loads an Obsidian plugin for better vault interraction as well as auto pulls
-- and commits to my vault git repo. On iOS devices, I use Working Copy to sync the
-- repo and use Shortcuts to automate pulling on open and auto committing and pushing
-- after closing Obsidian.
use({
"https://github.com/epwalsh/obsidian.nvim",
requires = {
"https://github.com/nvim-lua/plenary.nvim",
{
-- Fork of https://github.com/declancm/git-scripts.nvim is used here
-- because it includes a few small fixes.
"https://github.com/vividboarder/git-scripts.nvim",
branch = "dev",
config = function()
local gs = require("git-scripts")
gs.setup({
-- Disable keymaps becasue I only use this for auto pull and auto commit
default_keymaps = false,
commit_on_save = true,
})
gs.async_pull()
end,
after = "obsidian.nvim",
},
},
tag = "v1.*",
config = function()
vim.g.vim_markdown_frontmatter = 1
require("obsidian").setup({
workspaces = {
{ name = "personal", path = "~/Documents/Obsidian" },
},
})
end,
event = {
"BufRead " .. vim.fn.expand("~") .. "/Documents/Obsidian/**.md",
"BufNewFile " .. vim.fn.expand("~") .. "/Documents/Obsidian/**.md",
},
})
-- Work things
-- Sourcegraph
use({
"https://github.com/sourcegraph/sg.nvim",
run = "nvim -l build/init.lua",
requires = {
"https://github.com/nvim-lua/plenary.nvim",
},
config = function()
require("sg").setup({
enable_cody = false,
-- Empty attach because I dont want to use default keymaps. Maybe I'll remap something later.
on_attach = function() end,
})
end,
cmd = {
"SourcegraphBuild",
"SourcegraphDownloadBinaries",
"SourcegraphInfo",
"SourcegraphLink",
"SourcegraphLogin",
"SourcegraphSearch",
},
})
-- Auto sync after bootstrapping on a fresh box
if packer_bootstrap ~= "" then
packer.sync()

View File

@ -18,6 +18,8 @@ function M.config_cmp()
{ name = "luasnip" },
{ name = "buffer" },
{ name = "spell" },
{ name = "obsidian" },
{ name = "obsidian_new" },
},
mapping = cmp.mapping.preset.insert({
-- Scroll docs with readline back - forward
@ -45,12 +47,16 @@ function M.config_cmp()
})
-- Add a plug mapping to use in C-Space binding
require("utils").keymap_set(
"i",
"<Plug>(cmp_complete)",
"<cmd>lua require('cmp').complete()<CR>",
{ desc = "Autocomplete" }
)
local utils = require("utils")
utils.keymap_set("i", "<Plug>(cmp_complete)", "<cmd>lua require('cmp').complete()<CR>", { desc = "Autocomplete" })
-- Maybe add obsidian and obsidian new. This is done here in case obsidian.nvim is loaded before cmp
utils.try_require("cmp_obsidian", function(cmp_obsidian)
cmp.register_source("obsidian", cmp_obsidian.new())
end)
utils.try_require("cmp_obsidian_new", function(cmp_obsidian_new)
cmp.register_source("obsidian_new", cmp_obsidian_new.new())
end)
end
return M

View File

@ -0,0 +1,6 @@
require("dark_notify").run({
onchange = function(_)
-- Defined in _colors
_G.update_colors()
end,
})

View File

@ -108,8 +108,8 @@ local function get_default_attach(override_capabilities)
{ desc = "Workspace: List folders" }
)
lsp_keymap("r", "<cmd>lua vim.lsp.buf.references()<CR>", { desc = "References" })
lsp_keymap("p", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", { desc = "Diagnostics: Go to previous" })
lsp_keymap("n", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", { desc = "Diagnostics: Go to next" })
lsp_keymap("p", "<cmd>lua vim.diagnostic.goto_prev()<CR>", { desc = "Previous diagnostic" })
lsp_keymap("n", "<cmd>lua vim.diagnostic.goto_next()<CR>", { desc = "Next diagnostic" })
-- Set insert keymap for signature help
utils.keymap_set(
@ -119,11 +119,41 @@ local function get_default_attach(override_capabilities)
{ buffer = bufnr, desc = "Show signature help" }
)
-- Some top level aliases or remaps
utils.keymap_set("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", { buffer = bufnr, desc = "Display hover" })
utils.keymap_set(
"n",
"gD",
"<Cmd>lua vim.lsp.buf.declaration()<CR>",
{ buffer = bufnr, desc = "Go to declaration" }
)
utils.keymap_set(
"n",
"gd",
"<Cmd>lua vim.lsp.buf.definition()<CR>",
{ buffer = bufnr, desc = "Go to definition" }
)
utils.keymap_set(
"n",
"<leader>rn",
"<cmd>lua vim.lsp.buf.rename()<CR>",
{ buffer = bufnr, desc = "Refactor rename" }
)
utils.keymap_set(
"n",
"[d",
"<cmd>lua vim.diagnostic.goto_prev()<CR>",
{ buffer = bufnr, desc = "Previous diagnostic" }
)
utils.keymap_set(
"n",
"]d",
"<cmd>lua vim.diagnostic.goto_next()<CR>",
{ buffer = bufnr, desc = "Next diagnostic" }
)
-- Older keymaps
--[[
buf_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
buf_set_keymap("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
buf_set_keymap("n", "<leader>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
buf_set_keymap("n", "<leader>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
@ -132,8 +162,6 @@ local function get_default_attach(override_capabilities)
buf_set_keymap("n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
buf_set_keymap("n", "<leader>e", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
buf_set_keymap("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
buf_set_keymap("n", "<leader>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
--]]
@ -251,9 +279,20 @@ function M.config_lsp()
local default_setup = { capabilities = capabilities, on_attach = default_attach }
-- Configure each server
lsp_config.bashls.setup(default_setup)
lsp_config.gopls.setup(default_setup)
lsp_config.pyright.setup(default_setup)
lsp_config.bashls.setup({
capabilities = capabilities,
on_attach = default_attach,
settings = {
bashIde = {
-- Disable shellcheck linting because we have it enabled in null-ls
-- Some machines I use aren't configured with npm so bashls cannot
-- be relied on as the sole source of shellcheck linting.
shellcheckPath = "",
},
},
})
-- Set up rust analyzer (preferred) or rls
-- TODO: Remove rls and all configuration for it when all machines are up to date
@ -261,12 +300,14 @@ function M.config_lsp()
-- Prefer rust-tools, if present
utils.try_require("rust-tools", function(rust_tools)
rust_tools.setup({
capabilities = capabilities,
on_attach = function(client, bufnr)
default_attach(client, bufnr)
-- TODO: override some bindings from rust-tools
-- Eg. rust_tools.hover_actions.hover_actions or rt.code_action_group.code_action_group
end,
server = {
capabilities = capabilities,
on_attach = function(client, bufnr)
default_attach(client, bufnr)
-- TODO: override some bindings from rust-tools
-- Eg. rust_tools.hover_actions.hover_actions or rt.code_action_group.code_action_group
end,
},
})
end, function()
lsp_config.rust_analyzer.setup({
@ -290,7 +331,12 @@ function M.config_lsp()
-- Configure neovim dev for when sumneko_lua is installed
utils.try_require("neodev", function(neodev)
neodev.setup({})
local config = {}
if utils.can_require("dapui") then
config.plugins = { "nvim-dap-ui" }
config.types = true
end
neodev.setup(config)
end)
-- Auto setup mason installed servers
@ -300,7 +346,7 @@ function M.config_lsp()
if lsp_config["util"] and lsp_config.util["available_servers"] then
already_setup = lsp_config.util.available_servers()
else
-- HACK: For lspconfig versions lower than 0.1.4
-- HACK: For lspconfig versions lower than 0.1.4, which is required for nvim <0.7.0
already_setup = lsp_config.available_servers()
end
local needs_setup = vim.tbl_filter(function(server)
@ -309,7 +355,21 @@ function M.config_lsp()
-- Setup each server with default config
vim.tbl_map(function(server)
lsp_config[server].setup(default_setup)
if server == "lua_ls" then
-- Disable formatting with lua_ls because I use luacheck
local config = vim.tbl_extend("force", default_setup, {
settings = {
Lua = {
format = {
enable = false,
},
},
},
})
lsp_config[server].setup(config)
else
lsp_config[server].setup(default_setup)
end
end, needs_setup)
end)

View File

@ -35,6 +35,16 @@ function M.trailing_whitespace()
return ""
end
-- Plugin to print name of current CSV column
M.csv_col = {
function()
return vim.fn.CSVCol(1)
end,
cond = function()
return vim.bo.filetype == "csv" and vim.fn.exists("*CSVCol") == 1
end,
}
-- Configure lualine witha provided theme
function M.config_lualine(theme_name)
-- Theme name transformations
@ -102,7 +112,7 @@ function M.config_lualine(theme_name)
},
},
lualine_b = { "FugitiveHead", "diff" },
lualine_c = { { "filename", path = 1 }, code_loc },
lualine_c = { { "filename", path = 1 }, code_loc, M.csv_col },
lualine_x = { M.custom_ffenc, "filetype" },
lualine_y = { "progress", "location" },
lualine_z = {

View File

@ -9,7 +9,7 @@ local function disable_formatter_filetypes_for_existing_servers(sources, preserv
if lsp_config["util"] and lsp_config.util["available_servers"] then
available_servers = lsp_config.util.available_servers()
else
-- HACK: For lspconfig versions lower than 0.1.4
-- HACK: For lspconfig versions lower than 0.1.4, which is required for nvim <0.7.0
available_servers = lsp_config.available_servers()
end
vim.tbl_map(function(server)
@ -48,6 +48,8 @@ function M.configure(options)
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.trim_whitespace,
null_ls.builtins.formatting.trim_newlines,
-- Ansible
null_ls.builtins.diagnostics.ansiblelint.with({ filetypes = { "yaml.ansible" } }),
-- Fish
null_ls.builtins.formatting.fish_indent,
-- Python
@ -59,6 +61,7 @@ function M.configure(options)
-- Text
null_ls.builtins.code_actions.proselint,
null_ls.builtins.diagnostics.proselint,
null_ls.builtins.diagnostics.alex,
null_ls.builtins.diagnostics.write_good.with({
extra_args = { "--no-adverb" },
diagnostics_postprocess = function(diagnostic)
@ -74,33 +77,11 @@ function M.configure(options)
null_ls.builtins.diagnostics.hadolint,
}
-- HACK: Support for <0.6
if vim.fn.has("nvim-0.6.0") == 1 then
vim.list_extend(sources, {
-- Text
null_ls.builtins.diagnostics.alex,
-- Ansible
null_ls.builtins.diagnostics.ansiblelint.with({ filetypes = { "yaml.ansible" } }),
})
else
-- Sources I use added or modified after 0.5.0 compatability was broken
vim.list_extend(sources, {
require("plugins.null-ls.linters").alex,
require("plugins.null-ls.linters").ansiblelint,
})
end
sources = disable_formatter_filetypes_for_existing_servers(sources, { "python", "lua" })
-- Setup or configure null_ls
if null_ls["setup"] ~= nil then
options.sources = sources
null_ls.setup(options)
else
-- HACK: Handle old versions of null_ls for vim < 0.6 that don't support `setup`
null_ls.config({ sources = sources })
require("lspconfig")["null-ls"].setup(options)
end
options.sources = sources
null_ls.setup(options)
end)
end

View File

@ -1,71 +0,0 @@
local M = {}
local null_ls = require("null-ls")
local helpers = require("null-ls.helpers")
M.alex = {
name = "alex",
method = null_ls.methods.DIAGNOSTICS,
filetypes = { "markdown" },
generator = null_ls.generator({
command = "alex",
args = { "--stdin", "--quiet" },
to_stdin = true,
from_stderr = true,
format = "line",
check_exit_code = function(code)
return code <= 1
end,
on_output = helpers.diagnostics.from_patterns({
{
pattern = [[ *(%d+):(%d+)-(%d+):(%d+) *(%w+) *(.+) +[%w]+ +([-%l]+)]],
groups = { "row", "col", "end_row", "end_col", "severity", "message", "code" },
},
}),
}),
}
M.ansiblelint = {
name = "ansiblelint",
method = null_ls.methods.DIAGNOSTICS,
filetypes = { "yaml.ansible" },
generator = null_ls.generator({
command = "ansible-lint",
to_stdin = true,
ignore_stderr = true,
args = { "-f", "codeclimate", "-q", "--nocolor", "$FILENAME" },
format = "json",
check_exit_code = function(code)
return code <= 2
end,
multiple_files = true,
on_output = function(params)
local severities = {
blocker = helpers.diagnostics.severities.error,
critical = helpers.diagnostics.severities.error,
major = helpers.diagnostics.severities.error,
minor = helpers.diagnostics.severities.warning,
info = helpers.diagnostics.severities.information,
}
params.messages = {}
for _, message in ipairs(params.output) do
local col = nil
local row = message.location.lines.begin
if type(row) == "table" then
row = row.line
col = row.column
end
table.insert(params.messages, {
row = row,
col = col,
message = message.check_name,
severity = severities[message.severity],
filename = message.location.path,
})
end
return params.messages
end,
}),
}
return M

View File

@ -20,53 +20,46 @@ local function config_telescope()
layout_strategy = "flex",
},
})
local utils = require("utils")
utils.try_require("which-key", function(wk)
wk.register({
["<C-t>"] = { "<cmd>lua require('telescope.builtin').find_files()<CR>", "Find files" },
})
wk.register({
b = { "<cmd>lua require('telescope.builtin').buffers()<CR>", "Find buffers" },
t = { "<cmd>lua require('telescope.builtin').current_buffer_tags()<CR>", "Find buffer tags" },
["*"] = { "<cmd>lua require('telescope.builtin').grep_string()<CR>", "Find buffers" },
f = {
b = { "<cmd>lua require('telescope.builtin').buffers()<CR>", "Find buffers" },
f = { "<cmd>lua require('telescope.builtin').find_files()<CR>", "Find file" },
g = { "<cmd>lua require('telescope.builtin').live_grep()<CR>", "Live grep" },
h = { "<cmd>lua require('telescope.builtin').help_tags()<CR>", "Find help tags" },
l = { "<cmd>lua require('telescope.builtin').resume()<CR>", "Resume finding" },
t = { "<cmd>lua require('telescope.builtin').current_buffer_tags()<CR>", "Find buffer tags" },
T = { "<cmd>lua require('telescope.builtin').tags()<CR>", "Find tags" },
},
}, {
prefix = "<leader>",
})
end, function()
local opts = { silent = true, noremap = true }
vim.api.nvim_set_keymap("n", "<C-t>", "<cmd>lua require('telescope.builtin').find_files()<CR>", opts)
vim.api.nvim_set_keymap("n", "<leader>ff", "<cmd>lua require('telescope.builtin').find_files()<CR>", opts)
vim.api.nvim_set_keymap("n", "<leader>fl", "<cmd>lua require('telescope.builtin').resume()<CR>", opts)
vim.api.nvim_set_keymap("n", "<leader>fh", "<cmd>lua require('telescope.builtin').help_tags()<CR>", opts)
vim.api.nvim_set_keymap("n", "<leader>b", "<cmd>lua require('telescope.builtin').buffers()<CR>", opts)
vim.api.nvim_set_keymap("n", "<leader>fb", "<cmd>lua require('telescope.builtin').buffers()<CR>", opts)
vim.api.nvim_set_keymap(
"n",
"<leader>t",
"<cmd>lua require('telescope.builtin').current_buffer_tags()<CR>",
opts
)
vim.api.nvim_set_keymap("n", "<leader>ft", "<cmd>lua require('telescope.builtin').tags()<CR>", opts)
vim.api.nvim_set_keymap("n", "<leader>fg", "<cmd>lua require('telescope.builtin').live_grep()<CR>", opts)
vim.api.nvim_set_keymap("n", "<leader>*", "<cmd>lua require('telescope.builtin').grep_string()<CR>", opts)
-- Better spelling replacement for word under cursor
vim.api.nvim_set_keymap(
"n",
"<leader>s",
"<cmd>lua require('telescope.builtin').spell_suggest(require('telescope.themes').get_cursor())<CR>",
opts
local utils = require("utils")
utils.keymap_set("n", "<C-t>", "<cmd>lua require('telescope.builtin').find_files()<CR>", { desc = "Find files" })
utils.keymap_set("n", "<leader>b", "<cmd>lua require('telescope.builtin').buffers()<CR>", { desc = "Find buffers" })
utils.keymap_set(
"n",
"<leader>t",
"<cmd>lua require('telescope.builtin').current_buffer_tags()<CR>",
{ desc = "Find buffer tags" }
)
utils.keymap_set(
"n",
"<leader>*",
"<cmd>lua require('telescope.builtin').grep_string()<CR>",
{ desc = "Find string under cursor" }
)
-- Better spelling replacement for word under cursor
utils.keymap_set(
"n",
"<leader>s",
"<cmd>lua require('telescope.builtin').spell_suggest(require('telescope.themes').get_cursor())<CR>",
{ desc = "Spell check" }
)
local finder_keymap = utils.curry_keymap("n", "<leader>f")
finder_keymap("b", "<cmd>lua require('telescope.builtin').buffers()<CR>", { desc = "Find buffers" })
finder_keymap("f", "<cmd>lua require('telescope.builtin').find_files()<CR>", { desc = "Find file" })
finder_keymap("g", "<cmd>lua require('telescope.builtin').live_grep()<CR>", { desc = "Live grep" })
finder_keymap("h", "<cmd>lua require('telescope.builtin').help_tags()<CR>", { desc = "Find help tags" })
finder_keymap("l", "<cmd>lua require('telescope.builtin').resume()<CR>", { desc = "Resume finding" })
finder_keymap("t", "<cmd>lua require('telescope.builtin').current_buffer_tags()<CR>", { desc = "Find buffer tags" })
finder_keymap("T", "<cmd>lua require('telescope.builtin').tags()<CR>", { desc = "Find tags" })
if utils.can_require("sg.telescope") then
finder_keymap(
"G",
"<cmd>lua require('sg.telescope').fuzzy_search_results()<CR>",
{ desc = "Search Sourcegraph" }
)
end)
end
load_extensions()
end

View File

@ -15,6 +15,8 @@ M.ensure_installed = {
"kotlin",
"lua",
"make",
"markdown",
"markdown_inline",
"python",
"rust",
"scala",

View File

@ -1,182 +0,0 @@
{
"LuaSnip": {
"commit": "1843932"
},
"cmp-buffer": {
"commit": "3022dbc"
},
"cmp-nvim-lsp": {
"commit": "affe808"
},
"cmp-spell": {
"commit": "5602f1a"
},
"cmp_luasnip": {
"commit": "a9de941"
},
"colorbuddy.vim": {
"commit": "cdb5b06"
},
"dark-notify": {
"commit": "891adc0"
},
"file-line": {
"commit": "67c3590"
},
"friendly-snippets": {
"commit": "e5a16f9"
},
"goyo.vim": {
"commit": "d0bb582"
},
"impatient.nvim": {
"commit": "b842e16"
},
"limelight.vim": {
"commit": "86aaec1"
},
"lsp_signature.nvim": {
"commit": "e65a638"
},
"lua-dev.nvim": {
"commit": "f5c3193"
},
"lualine.nvim": {
"commit": "3cf4540"
},
"lush.nvim": {
"commit": "6b9f399"
},
"null-ls.nvim": {
"commit": "de75168"
},
"nvim-cmp": {
"commit": "b588569"
},
"nvim-colorizer.lua": {
"commit": "36c610a"
},
"nvim-gps": {
"commit": "f4734df"
},
"nvim-lsp-installer": {
"commit": "ae913cb"
},
"nvim-lspconfig": {
"commit": "99596a8"
},
"nvim-notify": {
"commit": "cf5dc4f"
},
"nvim-solarized-lua": {
"commit": "faba49b"
},
"nvim-treesitter": {
"commit": "a1893234"
},
"nvim-treesitter-refactor": {
"commit": "75f5895"
},
"nvim-treesitter-textobjects": {
"commit": "6dcd228"
},
"packer.nvim": {
"commit": "b32b982"
},
"plenary.nvim": {
"commit": "a3dafaa"
},
"popup.nvim": {
"commit": "b7404d3"
},
"rust.vim": {
"commit": "4aa69b8"
},
"startuptime.vim": {
"commit": "dfa57f5"
},
"tcomment_vim": {
"commit": "e77e1bf"
},
"telescope-file-browser.nvim": {
"commit": "00a814a"
},
"telescope.nvim": {
"commit": "b79cd6c"
},
"todo-comments.nvim": {
"commit": "98b1ebf"
},
"tokyonight.nvim": {
"commit": "8223c97"
},
"trouble.nvim": {
"commit": "da61737"
},
"vim-android": {
"commit": "8911f86"
},
"vim-argwrap": {
"commit": "feaba6b"
},
"vim-endwise": {
"commit": "4e5c835"
},
"vim-eunuch": {
"commit": "63da2dd"
},
"vim-forcedotcom": {
"commit": "a30ba7e"
},
"vim-fugitive": {
"commit": "b411b75"
},
"vim-grepper": {
"commit": "2b93535"
},
"vim-gutentags": {
"commit": "b77b8fa"
},
"vim-pencil": {
"commit": "5b4110d"
},
"vim-polyglot": {
"commit": "38282d58"
},
"vim-repeat": {
"commit": "24afe92"
},
"vim-rsi": {
"commit": "4c673fb"
},
"vim-startify": {
"commit": "81e36c3"
},
"vim-surround": {
"commit": "bf3480d"
},
"vim-textobj-sentence": {
"commit": "c5dd562"
},
"vim-textobj-user": {
"commit": "41a675d"
},
"vim-togglelist": {
"commit": "48f0d30"
},
"vim-vinegar": {
"commit": "bb1bcdd"
},
"which-key.nvim": {
"commit": "bd4411a"
},
"wombat.nvim": {
"commit": "96989b1"
},
"wombat256.vim": {
"commit": "8734ba4"
},
"wombuddy.nvim": {
"commit": "29deb8f"
}
}

View File

@ -0,0 +1 @@
neovim/packer_snapshots/latest-0.9

View File

@ -1,18 +1,18 @@
{
"LuaSnip": {
"commit": "1843932"
"commit": "500981f"
},
"cmp-buffer": {
"commit": "3022dbc"
},
"cmp-nvim-lsp": {
"commit": "affe808"
"commit": "44b16d1"
},
"cmp-spell": {
"commit": "5602f1a"
"commit": "32a0867"
},
"cmp_luasnip": {
"commit": "a9de941"
"commit": "05a9ab2"
},
"colorbuddy.vim": {
"commit": "cdb5b06"
@ -20,140 +20,152 @@
"dark-notify": {
"commit": "891adc0"
},
"dressing.nvim": {
"commit": "f16d758"
},
"file-line": {
"commit": "67c3590"
},
"friendly-snippets": {
"commit": "e5a16f9"
"commit": "43727c2"
},
"git-scripts.nvim": {
"commit": "2f7c075"
},
"goyo.vim": {
"commit": "d0bb582"
"commit": "fa0263d"
},
"impatient.nvim": {
"commit": "b842e16"
"commit": "47302af"
},
"limelight.vim": {
"commit": "86aaec1"
},
"lsp_signature.nvim": {
"commit": "e65a638"
},
"lua-dev.nvim": {
"commit": "f5c3193"
"commit": "1fba8f4"
},
"lualine.nvim": {
"commit": "3cf4540"
"commit": "2248ef2"
},
"lush.nvim": {
"commit": "6b9f399"
"commit": "966aad1"
},
"mason-lspconfig.nvim": {
"commit": "ab640b3"
},
"mason.nvim": {
"commit": "41e75af"
},
"neodev.nvim": {
"commit": "b2881ee"
},
"null-ls.nvim": {
"commit": "de75168"
"commit": "6cc5477"
},
"nvim-cmp": {
"commit": "b588569"
"commit": "0b751f6"
},
"nvim-colorizer.lua": {
"commit": "36c610a"
},
"nvim-gps": {
"commit": "f4734df"
},
"nvim-lsp-installer": {
"commit": "ae913cb"
},
"nvim-lspconfig": {
"commit": "99596a8"
"commit": "4834708"
},
"nvim-navic": {
"commit": "0ffa7ff"
},
"nvim-notify": {
"commit": "cf5dc4f"
"commit": "e4a2022"
},
"nvim-solarized-lua": {
"commit": "faba49b"
"commit": "7bd46fa"
},
"nvim-treesitter": {
"commit": "a1893234"
},
"nvim-treesitter-refactor": {
"commit": "75f5895"
"commit": "4cccb6f4"
},
"nvim-treesitter-textobjects": {
"commit": "6dcd228"
"commit": "8673926"
},
"obsidian.nvim": {
"commit": "0f16bb4"
},
"packer.nvim": {
"commit": "b32b982"
"commit": "ea0cc3c"
},
"plenary.nvim": {
"commit": "a3dafaa"
"commit": "5001291"
},
"popup.nvim": {
"commit": "b7404d3"
},
"rust.vim": {
"commit": "4aa69b8"
"rust-tools.nvim": {
"commit": "0cc8ada"
},
"sg.nvim": {
"commit": "4137856"
},
"startuptime.vim": {
"commit": "dfa57f5"
},
"tcomment_vim": {
"commit": "e77e1bf"
"commit": "90eaf75"
},
"telescope-file-browser.nvim": {
"commit": "00a814a"
"commit": "f41675f"
},
"telescope.nvim": {
"commit": "b79cd6c"
"commit": "7011eaa"
},
"todo-comments.nvim": {
"commit": "98b1ebf"
"commit": "7b8f174"
},
"tokyonight.nvim": {
"commit": "8223c97"
"commit": "f247ee7"
},
"trouble.nvim": {
"commit": "da61737"
"commit": "f1168fe"
},
"vim-android": {
"commit": "8911f86"
"commit": "26990f9"
},
"vim-argwrap": {
"commit": "feaba6b"
"commit": "b532cb6"
},
"vim-endwise": {
"commit": "4e5c835"
"commit": "e714ac3"
},
"vim-eunuch": {
"commit": "63da2dd"
"commit": "67f3dd3"
},
"vim-forcedotcom": {
"commit": "a30ba7e"
},
"vim-fugitive": {
"commit": "b411b75"
"commit": "5a24c25"
},
"vim-grepper": {
"commit": "2b93535"
},
"vim-gutentags": {
"commit": "b77b8fa"
"commit": "aa47c5e"
},
"vim-pencil": {
"commit": "5b4110d"
"commit": "6d70438"
},
"vim-polyglot": {
"commit": "38282d58"
"commit": "bc8a81d"
},
"vim-repeat": {
"commit": "24afe92"
},
"vim-rsi": {
"commit": "4c673fb"
"commit": "4554063"
},
"vim-startify": {
"commit": "81e36c3"
"commit": "4e089df"
},
"vim-surround": {
"commit": "bf3480d"
"commit": "3d188ed"
},
"vim-textobj-sentence": {
"commit": "c5dd562"
@ -168,7 +180,7 @@
"commit": "bb1bcdd"
},
"which-key.nvim": {
"commit": "bd4411a"
"commit": "ce741eb"
},
"wombat.nvim": {
"commit": "96989b1"

View File

@ -1,144 +1,162 @@
{
"LuaSnip": {
"commit": "51ebb4b"
"commit": "a7a4b46"
},
"cmp-buffer": {
"commit": "3022dbc"
},
"cmp-nvim-lsp": {
"commit": "0e6b2ed"
"commit": "5af77f5"
},
"cmp-spell": {
"commit": "60584cb"
"commit": "32a0867"
},
"cmp_luasnip": {
"commit": "1809552"
"commit": "05a9ab2"
},
"colorbuddy.vim": {
"commit": "cdb5b06"
"commit": "9e96ccd"
},
"dark-notify": {
"commit": "891adc0"
},
"dressing.nvim": {
"commit": "18e5beb"
},
"file-line": {
"commit": "67c3590"
},
"friendly-snippets": {
"commit": "0dd6114"
"commit": "dcd4a58"
},
"git-scripts.nvim": {
"commit": "2f7c075"
},
"goyo.vim": {
"commit": "fa0263d"
},
"inc-rename.nvim": {
"commit": "fb1b746"
"commit": "6f9b5f9"
},
"limelight.vim": {
"commit": "86aaec1"
},
"lsp_signature.nvim": {
"commit": "17ff7a4"
"commit": "c6aeb2f"
},
"lualine.nvim": {
"commit": "05d78e9"
"commit": "b5e8bb6"
},
"lush.nvim": {
"commit": "fb148c0"
"commit": "bc12f01"
},
"mason-lspconfig.nvim": {
"commit": "f0ce33f"
"commit": "9dfcf20"
},
"mason.nvim": {
"commit": "7d7efc7"
"commit": "751b1fc"
},
"neodev.nvim": {
"commit": "358f11c"
"commit": "ce9a2e8"
},
"null-ls.nvim": {
"commit": "c89333e"
"commit": "0010ea9"
},
"nvim-cmp": {
"commit": "fc0f694"
"commit": "97dc716"
},
"nvim-colorizer.lua": {
"commit": "36c610a"
},
"nvim-dap": {
"commit": "405df1d"
},
"nvim-dap-python": {
"commit": "66560f0"
},
"nvim-dap-ui": {
"commit": "edfa93f"
},
"nvim-lspconfig": {
"commit": "255e07c"
"commit": "6e5c78e"
},
"nvim-navic": {
"commit": "15704c6"
"commit": "8649f69"
},
"nvim-notify": {
"commit": "f3024b9"
"commit": "5371f4b"
},
"nvim-solarized-lua": {
"commit": "7bd46fa"
"commit": "d69a263"
},
"nvim-treesitter": {
"commit": "56c6352"
},
"nvim-treesitter-refactor": {
"commit": "65ad2ec"
"commit": "f848872"
},
"nvim-treesitter-textobjects": {
"commit": "95b76b9"
"commit": "d2a4ffc"
},
"obsidian.nvim": {
"commit": "c5c4088"
},
"packer.nvim": {
"commit": "1d0cf98"
"commit": "ea0cc3c"
},
"plenary.nvim": {
"commit": "499e074"
"commit": "8aad439"
},
"popup.nvim": {
"commit": "b7404d3"
},
"rust.vim": {
"commit": "889b9a7"
"rust-tools.nvim": {
"commit": "6761879"
},
"sg.nvim": {
"commit": "8d7735b"
},
"startuptime.vim": {
"commit": "dfa57f5"
},
"tcomment_vim": {
"commit": "b4930f9"
"commit": "48ab639"
},
"telescope-file-browser.nvim": {
"commit": "6cf29d5"
"commit": "5ee5002"
},
"telescope.nvim": {
"commit": "b79cd6c"
"commit": "b22e6f6"
},
"todo-comments.nvim": {
"commit": "09b0b17"
"commit": "a7e39ae"
},
"tokyonight.nvim": {
"commit": "161114b"
"commit": "9bf9ec5"
},
"trouble.nvim": {
"commit": "324c977"
"commit": "b9cf677"
},
"vim-android": {
"commit": "8911f86"
"commit": "26990f9"
},
"vim-argwrap": {
"commit": "feaba6b"
"commit": "f3e26a5"
},
"vim-endwise": {
"commit": "e714ac3"
"commit": "3719ffd"
},
"vim-eunuch": {
"commit": "291ef1f"
"commit": "8fb3904"
},
"vim-forcedotcom": {
"commit": "a30ba7e"
},
"vim-fugitive": {
"commit": "5f0d280"
"commit": "a83135b"
},
"vim-grepper": {
"commit": "2b93535"
"commit": "485d349"
},
"vim-gutentags": {
"commit": "1337b18"
"commit": "aa47c5e"
},
"vim-pencil": {
"commit": "6d70438"
@ -153,7 +171,7 @@
"commit": "4554063"
},
"vim-startify": {
"commit": "81e36c3"
"commit": "4e089df"
},
"vim-surround": {
"commit": "3d188ed"
@ -171,7 +189,7 @@
"commit": "bb1bcdd"
},
"which-key.nvim": {
"commit": "e271c28"
"commit": "4433e5e"
},
"wombat.nvim": {
"commit": "96989b1"

View File

@ -7,7 +7,7 @@ let g:ale_lint_on_enter = 0
" NOTE: Some of these are installed when bootstrapping environment, outside of vim setup
let g:ale_linters = {
\ 'go': ['gopls', 'golint', 'golangci-lint'],
\ 'python': ['pyls', 'mypy'],
\ 'python': ['pyright', 'mypy'],
\ 'rust': ['rls', 'cargo'],
\ 'sh': ['language_server', 'shell', 'shellcheck'],
\ 'text': ['proselint', 'alex'],