Compare commits

...

452 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
ViViDboarder 03df97c0d2 Disable prefer stylua to lua_ls formatter 2023-06-13 16:14:25 -07:00
ViViDboarder 7c6369ba98 Add dressing for increname 2023-06-13 16:08:42 -07:00
ViViDboarder 17c3e9b5b7 Pin trouble to stable major versions 2023-06-13 16:08:07 -07:00
ViViDboarder e6b2f2bf86 Pin to stable 1.0 releases of which-key 2023-06-13 16:07:50 -07:00
ViViDboarder 07a3512dbd Use stable rustup and shellcheck from alpine 2023-06-13 15:12:50 -07:00
ViViDboarder 7f9c6a92b3 Use untagged version of nvim-lspconfig on latest nvim for lua_lsp support 2023-06-13 15:00:42 -07:00
ViViDboarder 21de929b35 Switch from rls to rust-analyzer and from rust.vim to rust-tools.nvim
This includes some transition support for both rls and rust-analyzer
that should eventually be removed.
2023-06-13 14:59:41 -07:00
ViViDboarder b0e8fe7743 Add personal user bin path 2023-06-12 17:14:17 -07:00
ViViDboarder c81a897384 Triple quote string for golangci-lint 2023-06-12 14:40:35 -07:00
ViViDboarder 5bcd6af235 Fix navic in lualine 2023-06-12 12:31:15 -07:00
ViViDboarder 4c65a9dfaa Update extract of golangci-lint 2023-06-12 11:07:43 -07:00
ViViDboarder 56c03f30c5 Remove debug messages from install-language-servers.sh 2023-06-12 11:07:08 -07:00
ViViDboarder 3f444b9dc1 Fixes for nvim 0.6 2023-06-12 09:13:48 -07:00
ViViDboarder 6435692fc3 Pin fugitive to avoid neovim bug 2023-06-10 14:48:40 -07:00
ViViDboarder e36656e67d Update hooks and pin stylua and luacheck to match pre-commit 2023-06-09 13:20:28 -07:00
ViViDboarder 8404ef0005 Clean pre-commit checks a little bit 2023-06-09 13:12:02 -07:00
ViViDboarder fd5e698787 Install luafilesystem with luacheck 2023-06-09 13:06:23 -07:00
ViViDboarder 0e446b86d1 Now using v0.7+ API functions in many places
This preserves backwards compatibility still, but that will be removed at
some point when dropping .6. At that point, another refactor can
simplify many of the functions used.
2023-06-09 12:30:30 -07:00
ViViDboarder 72ba9591e7 Use new neovim api for augroup, autocommands, and user commands
Also starts using WhichKey for more thigns, but in a very basic way.
This part should probably be refactored and tested when devising a
standard way to do mappings with descriptions.
2023-06-07 16:26:52 -07:00
ViViDboarder 2e95001b5b Remove ale config from Neovim config 2023-06-02 10:39:52 -07:00
ViViDboarder baf3b0183f Update all 0.8 packages to latest unpinned versions 2023-06-02 08:35:56 -07:00
ViViDboarder 3dd3134d30 Small bump of 0.8 versions 2023-06-02 08:32:08 -07:00
ViViDboarder b4cb73b4e4 Update for nvim 0.9+ 2023-06-01 17:12:18 -07:00
ViViDboarder 625879cacb Fix loading of treesitter config 2023-06-01 16:52:12 -07:00
ViViDboarder 5b3f3f51b4 User newer alpine and clean Dockerfile
No longer need python-language-server dependencies or edge neovim
2023-05-22 17:13:54 -07:00
ViViDboarder d4c573263c Fix arm linux language server installs
Some machines return aarch64 which needs to map to arm64 for some packages
2023-05-22 17:13:17 -07:00
ViViDboarder 8dd18623e4 Remove python-language-server 2023-05-22 17:12:38 -07:00
ViViDboarder c56293489b Allow installing a subset of language support 2023-05-22 12:13:45 -07:00
ViViDboarder 37714095b4 Set snapshot based on vim version 2023-03-08 14:39:00 -08:00
ViViDboarder fc47ec9051 Fix permissions on golangci-lint 2022-11-03 15:21:16 -07:00
ViViDboarder cef387aa4a Use fixed version of stylua
Should account for system inconsistencies
2022-11-02 17:06:41 -07:00
ViViDboarder 68d61b1d0b Fix <0.8 after update 2022-11-02 17:04:48 -07:00
ViViDboarder 61171df4a8 Update with nvim 0.8 support 2022-11-02 16:57:26 -07:00
ViViDboarder cad8b97da4 Fix installs on arm mac with python2 2022-11-02 14:12:54 -07:00
ViViDboarder 9d3c630211 Update dictionary 2022-11-02 12:42:02 -07:00
ViViDboarder b259a7bf53 Fix some linting issues 2022-11-02 12:42:02 -07:00
ViViDboarder 9c8c290f84 Clean up lsp config 2022-11-02 12:42:02 -07:00
ViViDboarder d20e4a2645 Add terraform linting (tflint and tfsec)
Also minor updates to all github release installers
2022-11-02 12:30:39 -07:00
ViViDboarder 3d6071d222 Use new neodev config (only works for 0.7)
There is no check here because Mason won't even install the LSP for 0.6
versions.
2022-10-25 09:35:42 -07:00
ViViDboarder 8277be8360 neovim: add is_gui global for neovide 2022-10-14 15:36:25 -07:00
ViViDboarder eb0320fe77 Fix nvim 0.6.0 support for null-ls and mason 2022-10-14 15:31:03 -07:00
ViViDboarder 4e906222ea Pin impatient for old nvim versions 2022-10-14 15:30:05 -07:00
ViViDboarder e02f9d9c66 Update stylua install 2022-10-14 15:30:05 -07:00
ViViDboarder 9380fc627e Use correct package for lspconfig 2022-10-14 14:48:08 -07:00
ViViDboarder 85822d8c08 Fix bug with notify plugin setup 2022-10-14 14:41:14 -07:00
ViViDboarder a22d1b9244 null-ls: Use builtin versions of alex and ansiblelint if possible
Fallback support to nvim <0.6.0 still present
2022-10-14 13:59:53 -07:00
ViViDboarder 6f02ac53db Add version guidance to README.md 2022-10-14 13:58:16 -07:00
ViViDboarder 9bb414e017 Docker: Update alpine base for newer environment 2022-09-08 13:03:22 -07:00
ViViDboarder ef91367f38 Fix installation of golangci-lint and stylua on m1 macs 2022-09-08 13:03:20 -07:00
ViViDboarder 548883eb7b Remove version from stylua template 2022-09-08 13:02:13 -07:00
ViViDboarder 597d0142d6 Fix linting 2022-09-08 12:23:52 -07:00
ViViDboarder d33415ee73 Switch to mason for installing new lsps 2022-09-08 12:23:41 -07:00
ViViDboarder 516e5386ef Switch to system stylua so it uses the same thing as Neovim 2022-09-08 12:23:06 -07:00
ViViDboarder 8b6ae9a87a Update signs for kitty 2022-08-31 12:09:15 -07:00
ViViDboarder 89c4d40068 Update latest tag for current version 2022-08-31 11:46:20 -07:00
ViViDboarder 759b797f25 Update and tag breaking versions 2022-08-31 11:45:26 -07:00
ViViDboarder ba6d69e6a7 Add additional comments for emoji signs for Kitty 2022-08-31 11:23:03 -07:00
ViViDboarder f9e2976d9f Don't use inc-rename on nvim 0.7 because it's not supported 2022-08-31 11:22:37 -07:00
ViViDboarder b3d96c0ddc Add some more words to spelling 2022-06-16 12:50:59 -07:00
ViViDboarder b846cfc6b9 Add path to lualine 2022-06-16 12:50:49 -07:00
ViViDboarder 9a1ac596b2 Update vim plugins to fix fugitive
Could possibly roll back other plugins
2022-06-08 19:47:22 -07:00
ViViDboarder b7e3bfd460 Use non-emoji signs for kitty 2022-06-08 13:14:57 -07:00
ViViDboarder 3df8f355dd Update dictionary 2022-06-07 09:53:10 -07:00
ViViDboarder 978d20d4e9 Add incremental rename 2022-06-07 09:53:10 -07:00
ViViDboarder ae4cb15f72 Pin a bunch of 0.7.0 breaking commits 2022-06-07 09:53:10 -07:00
ViViDboarder 219b8fac43 Switch back to official packer now that my fix is merged 2022-06-07 09:53:10 -07:00
ViViDboarder ef18e73af1 Ignore jk` whichkey.lua triggers 2022-05-24 16:41:22 -07:00
ViViDboarder 36853b6b2f Fix fugitive commands 2022-05-10 12:06:07 -07:00
ViViDboarder ded3cec4a9 Pin 0.6 versions of telescope 2022-04-29 12:31:45 -07:00
ViViDboarder 6be2309fdc Fix cmp mappings 2022-04-21 13:03:22 -07:00
ViViDboarder 6161750843 Switch to my Packer fork
Current Packer release seems to be unmaintained in favor of
ongoing development of a v2. This fork has a bug fix for snasphotting
2022-04-19 10:01:33 -07:00
ViViDboarder 08308c78ce Update snapshot again 2022-04-18 17:16:38 -07:00
ViViDboarder 21a4b791d9 Add more spelling 2022-04-18 17:06:41 -07:00
ViViDboarder 3849838817 Update snapshot 2022-04-18 17:06:41 -07:00
ViViDboarder 617bbf780f Fix nil values in commit and tag tables 2022-04-18 17:05:26 -07:00
ViViDboarder 0ccfe90fac Keep backup dir 2022-03-21 15:56:08 -07:00
ViViDboarder 960aad79e1 Add some jargon to dictionary 2022-03-21 15:53:49 -07:00
ViViDboarder 1482ccedb1 Update snapshot 2022-03-01 12:31:33 -08:00
ViViDboarder dc2a528c06 Format lua on save 2022-03-01 12:30:36 -08:00
ViViDboarder ddb7721048 Update diagnostic float to show on cursor hover rather than line
This was showing the window at inconvenient times before and now will be
based on the cursor position being on a diagnostic.
2022-03-01 12:29:54 -08:00
ViViDboarder 02b0cb76bd Fix some highlighting 2022-03-01 12:29:09 -08:00
ViViDboarder 2eba3d8bc6 Add signature help 2022-03-01 12:27:15 -08:00
ViViDboarder eebddac3de Remove lspsaga 2022-03-01 12:21:58 -08:00
ViViDboarder 68f5edb072 Update README 2022-02-28 16:45:21 -08:00
ViViDboarder ec6601ff2a Clean up install and uninstall 2022-02-28 16:38:45 -08:00
ViViDboarder 0cb37ef1dc Update plugins 2022-02-28 16:33:56 -08:00
ViViDboarder efedec3d59 Update dict 2022-02-28 16:32:58 -08:00
ViViDboarder 3dabf98e5b Update writegood config
Skip adverb warnings and try to make everything a WARN severity, but this doesn't work
2022-02-28 16:32:42 -08:00
ViViDboarder a4119cae0f Sort json 2022-02-28 16:32:15 -08:00
ViViDboarder d368e0eaf6 Add json sorting pre-commit hook 2022-02-28 16:31:56 -08:00
ViViDboarder d8cf78b4e4 Fix indent 2022-02-25 11:10:28 -08:00
ViViDboarder 204fd57199 Remove ale from lua 2022-02-25 11:09:53 -08:00
ViViDboarder 43ef210795 Add PackerSnapshot commands to autoload 2022-02-25 11:07:07 -08:00
ViViDboarder 19752d45a6 Add latest snapshot 2022-02-25 11:04:46 -08:00
ViViDboarder 53efd0ff51 Add snapshotting 2022-02-25 11:03:05 -08:00
ViViDboarder 08a50b1621 Select completion by default 2022-02-25 09:10:12 -08:00
ViViDboarder ace8f98428 Fix gomod filetype detection 2022-02-25 09:10:04 -08:00
ViViDboarder 68d5b9b62e Add snippets 2022-02-25 09:09:51 -08:00
ViViDboarder 7b9a4fe2a2 Remove commented out plugins 2022-02-25 09:09:40 -08:00
ViViDboarder 1aaba4f1c6 Handle missing env variables 2022-01-27 19:31:37 -08:00
ViViDboarder a2a1326258 Set fallback backupdir paths 2022-01-27 12:32:42 -08:00
ViViDboarder 6efc54a754 Comment nvim term colors stuff 2022-01-26 14:28:36 -08:00
ViViDboarder a0e8fc8310 Set backup on for neovim 2022-01-26 14:28:14 -08:00
ViViDboarder 58f049382e Only add telescope lsp mappings if available 2022-01-24 15:39:02 -08:00
ViViDboarder da77afdfb3 Fix null-ls formatter conflict 2022-01-21 21:22:27 -08:00
ViViDboarder 1e0ae56e92 remove golangci-lint from Dockerfile because its in language server install script 2022-01-21 10:53:17 -08:00
ViViDboarder ddbe6a4a71 make sure spaces aren't expanded on hadolint install 2022-01-21 10:52:04 -08:00
ViViDboarder f87a811716 Add compiled spell 2022-01-21 09:36:49 -08:00
ViViDboarder 4730db4507 Add some more words to spelling 2022-01-21 09:21:31 -08:00
ViViDboarder 139a779ba0 Add hadolint binary install 2022-01-21 09:21:17 -08:00
ViViDboarder edc6cc173e Add telescope file_browser 2022-01-13 13:17:15 -08:00
ViViDboarder e44c226a70 Enable <cmd>Telescope notify 2022-01-13 12:57:50 -08:00
ViViDboarder 784fee4cef Add more treesitter parsers 2022-01-13 12:57:27 -08:00
ViViDboarder a307c7e930 Refactor null-ls again, again
Avoid removing filetypes for non-formatters and extract into method
2022-01-12 14:56:08 -08:00
ViViDboarder 0c05f9db2a Refactor null-ls again
Now building a list of filetypes that already have language servers
configured and then excluding those filetypes from null-ls.

There is an override where they can be forced enabled for language
servers that may not have a formatter or where the null-ls formatter is
preferred. Eg. Python where I want to format with black.
2022-01-12 14:35:07 -08:00
ViViDboarder aef826f76b Undo swapped_map grouping 2022-01-12 10:06:21 -08:00
ViViDboarder 5a81e7d33c Rewrite keymaps for lsp 2022-01-12 09:59:29 -08:00
ViViDboarder 90581a444b Refactor null-ls and remove conflicted formatting 2022-01-12 09:21:57 -08:00
ViViDboarder 64583bf41d Add write-good diagnostics 2022-01-12 09:21:08 -08:00
ViViDboarder f352983d65 Move StyLua config from args to file 2022-01-10 14:58:29 -08:00
ViViDboarder ec110edaff Make notifications prettier 2022-01-10 14:53:26 -08:00
ViViDboarder f99002e303 Move hadolint to null-ls 2022-01-10 14:53:16 -08:00
ViViDboarder 7ba165af78 Fix prettier typo 2022-01-10 14:52:35 -08:00
ViViDboarder ae6ccdc96a Move as much as possible from ALE to null-ls 2022-01-10 14:41:08 -08:00
ViViDboarder 6475f422ac Switch text editing from ALE to null-ls 2022-01-10 14:38:24 -08:00
ViViDboarder e77a79e662 Add golangci-lint install 2022-01-10 12:42:02 -08:00
ViViDboarder e3edf33316 Use release-gitter to get StyLua
Makes installation much faster
2022-01-10 12:42:02 -08:00
ViViDboarder cf97331465 Add function for wrapping prefixed keymap groups 2022-01-10 10:47:51 -08:00
ViViDboarder 6d2acddc56 Fix supported feature check 2022-01-10 10:47:11 -08:00
ViViDboarder 44b7b000df switch telescope pins to tags 2022-01-08 21:50:06 -08:00
ViViDboarder 4c6c3041f0 use lsp for tags and formatting when available 2022-01-07 06:52:15 -08:00
ViViDboarder 5b56491ea7 Make linter happy 2022-01-06 21:15:06 -08:00
ViViDboarder 06b29db645 Add new function for mapping versoins to last supported commits 2022-01-06 21:14:18 -08:00
ViViDboarder 36a3ed3bfd Cleanup Docker stuff 2022-01-06 14:50:04 -08:00
ViViDboarder c2f290bb97 Replace grepper <leader>* and instead use telescope
Also adding a  bunch of new telescope bindings
2022-01-03 21:27:53 -08:00
ViViDboarder e43a43500e Add bindings for fugitive 2022-01-03 21:27:13 -08:00
ViViDboarder 980dd9d1f5 Update format for argwrap binding 2022-01-03 21:26:45 -08:00
ViViDboarder fdc27ee719 Remove extra print on lua ls 2022-01-03 21:26:26 -08:00
ViViDboarder 62d43d5096 Update pre-commit hooks 2022-01-02 22:50:58 -08:00
ViViDboarder 27eccf2b51 Add luadev for nvim lsp support 2022-01-02 22:44:02 -08:00
ViViDboarder 5a1a907529 Fix snippet expansion 2022-01-02 22:43:24 -08:00
ViViDboarder b48edf86de Clean up Docker comments 2022-01-02 22:24:13 -08:00
ViViDboarder 77266fe95f Add 0.6 in Docker 2022-01-02 22:23:07 -08:00
ViViDboarder 150a9b36d8 Add pre 0.6 support for null-ls 2022-01-02 22:13:15 -08:00
ViViDboarder 5543af4bbc Get Docker install permissions working and TS 2022-01-02 22:06:47 -08:00
ViViDboarder ed6640e8e1 Remove message when nvim-lsp-installer is not installed 2022-01-02 07:43:31 -08:00
ViViDboarder c01d2445ba Add snippet support 2022-01-02 07:43:31 -08:00
ViViDboarder 4b6d7a3efc Add todo-comments 2022-01-02 07:43:31 -08:00
ViViDboarder 40b88432f8 Add nvim-lsp-installer
Might end up using this to install LSPs. Just playing with it for now.
2021-12-31 17:32:33 -08:00
ViViDboarder 175c271d90 Fix trouble icons 2021-12-31 17:31:46 -08:00
ViViDboarder f766f82b2a Only build amd64 2021-12-17 17:22:16 -08:00
ViViDboarder c21fd30312 Add ability to ignore failed installs 2021-12-17 11:25:06 -08:00
Ian e782544db9
Remove linux/arm builds 2021-12-17 10:17:54 -08:00
ViViDboarder 37a89b59f0 Forgot PackerBootstrap doesn't run sync if it's already been run 2021-12-16 21:34:07 -08:00
ViViDboarder b1fa9733ef Bootstrap packer installs with new neovim config 2021-12-16 21:30:06 -08:00
ViViDboarder 07ca6b6ddf Some os seem to think of symblink as file vs dir 2021-12-16 21:30:06 -08:00
ViViDboarder 8eb0d63ec0 Fix rustup attempt on arm 2021-12-16 21:07:49 -08:00
ViViDboarder 7861b3c4e5 Fix shellcheck install failure on arm 2021-12-16 21:05:42 -08:00
ViViDboarder ed73884345 Update Dockerfile and related Docker scripts
Now working nvim in Docker!
2021-12-16 20:52:09 -08:00
ViViDboarder d004dbee79 Fix loading of lsp files on first load before install 2021-12-16 20:52:09 -08:00
ViViDboarder 718dcc79e6 Fix colorscheme setting on first load 2021-12-16 20:52:09 -08:00
ViViDboarder a1f9fdc430 Comment out checkmake since it doesn't install with go install 2021-12-16 20:52:09 -08:00
ViViDboarder 3051f0b294 Run stylua again 2021-12-16 14:43:02 -08:00
ViViDboarder 7b3f69cf66 Update bindings for formatting and range formatting with an lsp prefix (l) 2021-12-16 14:42:07 -08:00
ViViDboarder 1eee1c727f Use new method of setup for null-ls that doesn't use lspconfig 2021-12-16 14:42:07 -08:00
ViViDboarder 1c9990750b Add a try_require utility rather than checking packer 2021-12-16 14:42:07 -08:00
ViViDboarder e11ba17d15 Configure packer floating window 2021-12-16 14:42:07 -08:00
ViViDboarder 720f8c41ec Run stylua again 2021-12-15 15:33:04 -08:00
ViViDboarder cdc06953d2 Use null-ls vs ale for lua 2021-12-15 15:32:33 -08:00
ViViDboarder 24f2e9b645 Add some escape sequences for tmux true color 2021-12-15 15:28:58 -08:00
ViViDboarder eca001d4d7 Improve color setting in nvim 2021-12-15 15:28:58 -08:00
ViViDboarder 6b8a4d39db Disable dark-notify on non-mac 2021-12-15 15:28:14 -08:00
ViViDboarder d98e4fac72 Run stylua on everything 2021-12-15 09:37:51 -08:00
ViViDboarder d9a1d9b799 Add stylua hook 2021-12-15 09:37:19 -08:00
ViViDboarder 24b740fe86 Install luacheck locally 2021-12-15 09:36:50 -08:00
ViViDboarder 212b3cbdc7 Add stylua fixer to null-ls 2021-12-15 09:22:20 -08:00
ViViDboarder 46cfa8337e Remove completion-nvim 2021-12-15 08:44:21 -08:00
ViViDboarder eca378ce64 Update comments to make package pinning clearer 2021-12-15 08:43:34 -08:00
ViViDboarder a105a310a2 Fix luacheck globals 2021-12-15 08:43:12 -08:00
ViViDboarder c6e7e756d0 Don't error when trying to handle older diagnostic api 2021-12-15 08:33:09 -08:00
ViViDboarder 83590865a5 Prevent cursor hold errors with changed api 2021-12-14 16:20:16 -08:00
ViViDboarder 052f75718d Better handling of nvim .5 vs .6 2021-12-14 16:20:07 -08:00
ViViDboarder ca13faf07a Actually update luacheck with vim global 2021-12-13 17:47:28 -08:00
ViViDboarder e0900785a1 Add pyright to Docker neovim 2021-12-13 17:46:41 -08:00
ViViDboarder b5930ba12b Update spelling 2021-12-13 17:46:41 -08:00
ViViDboarder 27c068faca Update null_ls from config to setup 2021-12-13 17:46:41 -08:00
ViViDboarder 079808942b Add zen plugins 2021-12-13 17:46:41 -08:00
ViViDboarder 04b0f7b5f8 Add vim global for luacheck 2021-12-10 17:15:22 -08:00
ViViDboarder 04bbeac02b Fix cmp loading order 2021-12-10 17:10:40 -08:00
ViViDboarder 0e30786617 Add trouble 2021-12-10 17:10:28 -08:00
ViViDboarder aa8ed67173 Add impatient back 2021-12-10 17:10:09 -08:00
ViViDboarder d42d58a45d Add whichkey 2021-12-10 16:54:37 -08:00
ViViDboarder 3490deeb18 Fix c-space mapping for cmp 2021-12-10 16:54:29 -08:00
ViViDboarder 70c31d66eb Refactor plugin loading
Make Packer lazy loaded and move lsp config into plugin rather than from packer
2021-12-10 12:04:13 -08:00
ViViDboarder f4a7db3ea1 Only exclude packer compiled 2021-12-10 12:02:11 -08:00
ViViDboarder 8d1ac8ac5c Update for new lualine change 2021-12-09 19:12:14 -08:00
ViViDboarder 505143f5e3 Make sure reference to ui function exists before calling 2021-12-09 09:20:06 -08:00
ViViDboarder 84497d7009 Fix range formatting 2021-12-08 22:31:04 -08:00
ViViDboarder aa9c37859f Move lsp ui config to prevent errors 2021-12-08 22:30:45 -08:00
ViViDboarder bf2c6d2b5b Add comment about disabling lspsaga 2021-12-08 22:14:04 -08:00
ViViDboarder 7eaf0ee267 Add gps 2021-12-08 22:13:53 -08:00
ViViDboarder 45f840144e Clean up some unused stuff 2021-12-08 22:13:16 -08:00
ViViDboarder e4a96890d3 Add impatient to speed up lua 2021-12-08 22:12:46 -08:00
ViViDboarder 5ed31c83b0 Readability improvement 2021-12-08 17:13:45 -08:00
ViViDboarder 8e5aa3158b Make built in lsp prettier (replace lspsaga? 2021-12-08 17:13:32 -08:00
ViViDboarder 45e32b07bf Remove python from ale and add to null-ls 2021-12-08 17:12:33 -08:00
ViViDboarder d811700154 Fix pyright install 2021-12-08 17:12:01 -08:00
ViViDboarder 371573e468 Simplify lsp setup 2021-12-08 15:59:45 -08:00
ViViDboarder 9092219d2c Make Lspsaga optional
Issues with 0.6.0
2021-12-08 15:55:31 -08:00
ViViDboarder b8b502298e Use null-ls for liniting where available 2021-12-08 15:28:12 -08:00
ViViDboarder 89cb90a6aa Update lsp config for lspsaga 2021-12-07 16:15:30 -08:00
ViViDboarder 3fdacaf932 Use rls instead of rust_analyzer 2021-12-07 16:15:30 -08:00
ViViDboarder 02d7c26c98 Use new method of installing go packages 2021-12-07 16:15:30 -08:00
ViViDboarder 9778c8c5fa Add luasnip and lsp snippit support 2021-12-01 09:49:21 -08:00
ViViDboarder 38a0919865 Force theme switch 2021-12-01 09:48:53 -08:00
ViViDboarder 4fb61693a8 Add luacheck to lang servers and pre-commit 2021-11-10 18:03:27 -08:00
ViViDboarder 00d580eb1b Add textobj dependencies for text files 2021-11-09 12:34:46 -08:00
ViViDboarder 4499dab62b Begin switch to new, new lualine repo 2021-10-26 10:20:28 -07:00
ViViDboarder c4d688ef51 Switch to newer lualine fork 2021-10-21 10:24:28 -07:00
ViViDboarder 8bc5c38067 Update comments for util attribution 2021-09-30 11:01:05 -07:00
ViViDboarder f07fe8fad0 nvim: update go linting with ale 2021-09-30 11:01:05 -07:00
ViViDboarder 24eb10eb7a nvim: Add grepper back 2021-09-30 11:01:03 -07:00
ViViDboarder 9e9defe4e2 nvim: Update commented out fugitive cmds 2021-09-30 11:00:59 -07:00
ViViDboarder 4a5d7fce1e nvim: use nvim-cmp for completion 2021-09-30 11:00:56 -07:00
ViViDboarder 48af6cc3ef nvim: Add better support for lsp via omnifunc
Only reason I'm not using this is that there is no floating preview window
2021-09-30 11:00:44 -07:00
ViViDboarder 6baa4feab0 nvim: Use pyrite 2021-09-30 11:00:40 -07:00
ViViDboarder e8bc313d4f nvim: Update ignore folders 2021-09-30 11:00:34 -07:00
ViViDboarder ae43e89920 Fix runtime for older neovim to use vim dir 2021-09-28 09:30:00 -07:00
ViViDboarder 155e61da51 Detect wombat variants for lualine 2021-09-27 18:00:17 -07:00
ViViDboarder 627569ae46 Clean up colors 2021-09-27 17:48:05 -07:00
ViViDboarder cd39a215cf Add better writing mode with Pencil 2021-09-27 17:45:04 -07:00
ViViDboarder 2b920d1230 Fix lualine theme loading
Colors were being set before plugin loading causing lualine to not init.
This change tells lualine to init after load with the current
colorscheme.
2021-09-18 19:49:45 -07:00
ViViDboarder bdf4a23491 Add make key binding 2021-09-18 16:39:56 -07:00
ViViDboarder 453a25f5da Add Rg and Grep commands for Telescope 2021-09-16 13:32:53 -07:00
ViViDboarder 7afc5f9903 Refactor colorscheme updating
Also add a util for plugin load checks
2021-09-16 13:32:29 -07:00
ViViDboarder 9bbe68013b Run some linting on nvim lua 2021-09-15 18:13:17 -07:00
ViViDboarder 4d4b6134d0 Add tokyonight colorscheme 2021-09-09 16:23:34 -07:00
ViViDboarder 098ef45271 Go back to only format on save for rust and go 2021-09-09 16:09:38 -07:00
ViViDboarder da356bba97 Add spell for neovim (maybe link this?) 2021-09-09 16:09:20 -07:00
ViViDboarder 4097ef493c Add spelling completion shortcut 2021-09-09 16:05:45 -07:00
ViViDboarder b194e639fd Neovim lua: Refactor more plugin loading and add better language support 2021-09-01 10:03:05 -07:00
ViViDboarder 1ac22e81b2 Set fuzzy lsp bindings based on installed packages 2021-08-25 16:28:24 -07:00
ViViDboarder 21c33a47f8 Disable fzf 2021-08-25 16:28:03 -07:00
ViViDboarder 954738573d Refactor a bunch of lua configs out
This is a WIP with telescope and fzf
2021-08-25 16:21:50 -07:00
ViViDboarder d283258689 Better lsp and completion
Remove treesitter completion for now and use black config?
2021-08-24 16:13:10 -07:00
ViViDboarder 497c580c12 Add startify config and local require 2021-08-24 16:12:40 -07:00
ViViDboarder d87d6c8d6a Add plugin comments 2021-08-24 16:11:46 -07:00
ViViDboarder 09fd4d640d Move location to different lualine section 2021-08-24 16:11:23 -07:00
ViViDboarder 74675dcba2 Enable mouse support 2021-08-24 16:11:02 -07:00
ViViDboarder 05f57cff6c Add python-lsp-black, pyls-isort, and pyls-mypy 2021-08-24 16:10:37 -07:00
ViViDboarder ae8d912323 Mark that python-lsp-server is py3 only 2021-08-24 10:41:45 -07:00
ViViDboarder edd5181964 Begin refactor of lua configs 2021-08-24 10:38:14 -07:00
ViViDboarder a293e22eb0 Update language servers
Adding pylsp for lspconfig

Adding gopls since Nvim 0.5 is not using vim-go
2021-08-24 09:59:24 -07:00
ViViDboarder 07659f2aaf Begin adding lua configs for neovim 2021-08-24 09:56:36 -07:00
ViViDboarder 75261eb20a Add saving and loading of plug snapshots 2021-08-24 09:56:36 -07:00
ViViDboarder 41ef5dc30f Simplify plugin config
Remove all the ide toggle flags. I wasn't using them
2021-08-24 09:56:36 -07:00
ViViDboarder eca03d227c Update go fixers to use ale 2021-08-24 09:56:36 -07:00
ViViDboarder 1dbde430c2 Upgrade python packages and add pyls-black 2021-07-26 16:37:54 -07:00
ViViDboarder 1dc2a9d34d Add Docker builds 2021-06-13 18:34:13 -07:00
ViViDboarder f18eba7148 Use clippy when linting rust files 2021-06-13 18:31:30 -07:00
ViViDboarder 9dd7947823 Update build platforms 2021-06-13 18:31:14 -07:00
ViViDboarder 19d082d26d Add support for running in a Docker image 2021-06-09 10:23:48 -07:00
ViViDboarder 0a7865275f Better detection of sh when bash is present 2021-06-09 10:22:53 -07:00
ViViDboarder ba11b4e68e Update setup script to allow partial setups
Also remove pip install of python neovim because this is done with
os package managers now
2021-06-09 10:22:27 -07:00
ViViDboarder 2a1b012ee9 Fix indentation on lang server installs 2021-06-09 10:19:03 -07:00
ViViDboarder 4e49d8b2d1 Move go fmt on safe to ale config
Also move Ale config to a dedicated file
2021-04-30 11:27:39 -07:00
ViViDboarder 2b60626ed3 Only set background color if it's changing 2021-04-30 11:26:06 -07:00
ViViDboarder 88f5da156e Use bash as vim shell if available 2021-04-30 11:25:35 -07:00
ViViDboarder 302d5816dd Detect ansible playbooks based on path 2021-01-13 09:22:06 -08:00
ViViDboarder 9384d9b0c6 Replace gometalinter with golangci-lint 2021-01-13 09:21:04 -08:00
ViViDboarder fd8c3e8a75 Add spell auto complete from normal mode 2021-01-13 09:20:37 -08:00
ViViDboarder 703f9d02b2 Update python linting 2020-11-04 22:13:05 -08:00
ViViDboarder 724860a098 Fix markdown file comment 2020-11-04 22:12:23 -08:00
ViViDboarder 844c00809f Fix snapshot loading and update plugins 2020-10-23 13:52:12 -07:00
ViViDboarder 2d05d62bd5 Add SimpylFold for python folding 2020-10-23 13:51:24 -07:00
ViViDboarder dedd400ccf Update indenting lists in markdown
This is more intuative to me
2020-10-23 13:48:43 -07:00
ViViDboarder d2717e751d Add trailing comma when wrapping Go functions 2020-04-07 09:47:22 -07:00
ViViDboarder c8f77b1b3b Dramatically simplify python plugins
This does take away a little functionality, but doesn't seem so bad
right now
2020-02-21 17:11:08 -08:00
ViViDboarder f50cdda385 Clean plugins rc a bit
Reorganize things
2020-02-21 17:09:42 -08:00
ViViDboarder 90b505bb34 Improve autocomplete a bit
Would still be good to add nvim native lsp
2020-02-21 17:07:50 -08:00
ViViDboarder 1d0cf22333 Make default shell sh rather than bash
Slightly better compatibility, but probably no change
2020-02-21 17:03:16 -08:00
ViViDboarder e085795b92 Clean up plugins further
Switch most languages to vim-polyglot
2020-02-05 10:22:03 -08:00
ViViDboarder 9397bdafbd Fix echo when failing to install black on Py2 2019-12-30 11:06:13 -08:00
ViViDboarder 0ac1019486 Update language server install to fix pip and add rustfmt 2019-11-20 15:19:14 -08:00
ViViDboarder acf484c4bd Make cover some edge cases of vim 2019-11-02 00:19:22 +00:00
ViViDboarder 4b4c141ee5 Refactor colorscheme settings to better support GUI
This fixes an issue with themes that don't support dark/light
backgrounds as well as overrides the defaults for GUI apps.

It also switches to a faster method of detecting system dark mode on
macOS
2019-11-01 15:07:29 -07:00
ViViDboarder 348d2fabc6 Add support for rg FZF search through file text 2019-11-01 15:07:19 -07:00
ViViDboarder 54d9793902 Add shortcut for ALEFix 2019-11-01 15:06:54 -07:00
ViViDboarder 8b23380279 Update markdown indentation
Set it to two spaces to better differentiate a list and code
2019-11-01 15:06:19 -07:00
ViViDboarder 36eb348b43 Formatting for install-ls.sh 2019-10-29 17:33:14 -07:00
ViViDboarder 808804d0ac Add command for easy spelling 2019-10-29 16:35:54 -07:00
ViViDboarder 2c3d439df4 Update target for installing lang servers, linters, fixers 2019-10-29 14:55:44 -07:00
ViViDboarder 970d43a694 Remove neomake and syntastic 2019-10-29 12:34:50 -07:00
ViViDboarder ba6ea9e84b Prettify README.md using new linters/fixers 2019-10-29 12:33:29 -07:00
ViViDboarder cf9a69eede Install and configure new text linters 2019-10-29 12:33:08 -07:00
ViViDboarder 6d67d84fc5 Update fixers and sort linters 2019-10-28 16:30:34 -07:00
ViViDboarder 53209bff90 Update YAML indent
Making it 2 spaces to make indentation a bit cleaner when displaying lists
2019-10-28 09:20:25 -07:00
ViViDboarder 1e7156d172 Add fixer for markdown to trim trailing whitespace 2019-10-24 16:22:46 -07:00
ViViDboarder e9bd22b73c Update pre-commit versions 2019-10-24 14:29:16 -07:00
ViViDboarder 5fdc11ff93 Update hook installation 2019-10-24 14:16:01 -07:00
ViViDboarder 51bbd2dcef Add plugin snapshots to make setup more predictable 2019-10-24 14:15:34 -07:00
ViViDboarder 8d0b6c26fe Catch error on first load where colorscheme may be missing 2019-10-24 14:12:44 -07:00
ViViDboarder c16f793fb8 Pass lint 2019-10-24 13:58:45 -07:00
ViViDboarder 4cf4f83897 Add some ft settings for fish files 2019-10-24 13:47:56 -07:00
ViViDboarder 556b8baeae Remove unused rc files 2019-10-24 13:47:40 -07:00
ViViDboarder ad7da3997d Merge branch 'master' into slim-vim 2019-10-24 13:28:19 -07:00
ViViDboarder bc1ac5ff71 Improve vint compliance 2019-10-24 13:27:01 -07:00
ViViDboarder f2a766d1e6 Add pre-commit to run vint 2019-10-24 12:40:36 -07:00
ViViDboarder 6a51d76881 WIP: Switch to ALE with a few LS setup 2019-10-24 12:40:10 -07:00
ViViDboarder 2b6b13fcda Add pre-commit to run vint 2019-10-24 12:39:27 -07:00
ViViDboarder 16d6dd2ce5 Update IDE like features to be behind variable toggles
Also get's rid of neocomplete in favor of deoplete for vim8 as well and
neocomplecache as a fallback
2019-10-21 16:27:34 -07:00
ViViDboarder 57e5f83dc8 Update init to be more useful
Add more comments to better understand what's going on as well as
add some more variables to better determine which plugins to enable
2019-10-21 16:26:35 -07:00
ViViDboarder e08135fe1f Update colorschemes to a better layout 2019-10-21 16:00:11 -07:00
ViViDboarder 62c65e5d73 Add rg to ctrlp configs 2019-10-21 15:58:04 -07:00
ViViDboarder 2a07143e43 Move vimproc to neocomplcache init
This is the only thing it's used for really

I think all that depend on this are now gone
2019-10-21 15:55:02 -07:00
ViViDboarder fbab69f00e Remove neoterm
I never really use it
2019-10-21 15:51:18 -07:00
ViViDboarder aa0686208b Add back equivalent async TagsUpdate command with Gutentags 2019-10-21 15:50:10 -07:00
ViViDboarder fde09749bf Add vim8 terminal commands in addition to existing neovim 2019-10-21 15:49:49 -07:00
ViViDboarder cb1ff9c78a Remove vim-dispatch
This isn't really needed as Gutentags can update tags async and other
build and linting tools like ALE or coc.nvim will do async.
2019-10-21 10:58:25 -07:00
ViViDboarder 382c3bf129 Update Grepper for better searching 2019-10-21 10:50:19 -07:00
ViViDboarder b2c84bf38f Consolidate init rc files 2019-10-21 10:49:27 -07:00
ViViDboarder 9e4dfcafce Make .gitignore work better with Ag 2019-10-21 10:40:13 -07:00
ViViDboarder 2955787cf2 WIP: Add a buncha TODOs 2019-10-16 09:49:04 -07:00
ViViDboarder 42d33b9f48 Ignore /vim/view/ 2019-10-16 09:25:48 -07:00
ViViDboarder 4e437e9f59 Add auto switching vim colors based on macOS theme 2019-10-16 09:24:17 -07:00
ViViDboarder b79938f0be Add function and command for setting colorscheme based on dark mode 2019-07-02 17:08:17 -07:00
ViViDboarder a5fad0152b Add rust swift and typescript 2019-04-11 13:04:32 -07:00
ViViDboarder f329bc8e27 Show git authors in FZF commits 2018-06-13 13:19:42 -07:00
ViViDboarder 78b781b859 Oni support 2018-06-13 13:19:22 -07:00
ViViDboarder a0684794e9 Consolidate keymapping 2018-06-13 13:18:21 -07:00
ViViDboarder da8a4a5d57 Increase goyo width 2017-11-17 18:11:06 -08:00
ViViDboarder fe330eecf7 Update makefile to handle updates 2017-11-13 19:28:07 -08:00
ViViDboarder b4b6db5191 Drop buffet for CtrlP and FZF
Fixes #7
2017-11-13 19:05:26 -08:00
ViViDboarder e541c7f90c Only load ctrlp if fzf command is missing 2017-11-13 19:03:12 -08:00
ViViDboarder 6269785d63 Change maps from CtrlP to FZF
Set up FZF bindings if ctrlp not loaded
2017-11-08 16:23:04 -08:00
ViViDboarder 6e2ff67d48 Trim airline size 2017-11-08 16:10:27 -08:00
ViViDboarder b899f3f379 Improve colorscheme and gui detection 2017-11-08 16:10:27 -08:00
ViViDboarder 8f93dd590d Fix deoplete preview window closing 2017-11-08 16:10:27 -08:00
ViViDboarder 729a912244 Lazy load everything! 2017-11-08 16:10:11 -08:00
ViViDboarder 1ab61dcbf7 Supress vimgo warning for lower vim versions 2017-11-08 13:55:33 -08:00
ViViDboarder 09c2e48b7f Move airline plugins into airline file 2017-11-08 13:55:30 -08:00
ViViDboarder 843e531fda Add neomake makers for pytest and tox 2017-11-08 13:55:28 -08:00
ViViDboarder c530562b12 Add tox and tig commands for Neovim with Neoterm
Maybe todo: add to vim8 and remove plugin dependency
2017-11-08 13:55:26 -08:00
ViViDboarder ba6c42657a Try deoplete before neocomplete 2017-11-08 13:55:23 -08:00
ViViDboarder 08844a251e Add smartsource for init.rc.vim 2017-11-08 13:55:13 -08:00
ViViDboarder c3774255ad Use Neomake instead of Syntastic on vim8+
Fixes #2
2017-10-25 10:45:15 -07:00
ViViDboarder a869f13c7f Add update script
Closes #6
2017-10-25 10:40:07 -07:00
ViViDboarder 2061f3b219 Fix deoplete completion 2017-10-25 10:30:12 -07:00
ViViDboarder 6cb6db86bc Update neomake url 2017-10-24 20:50:38 -07:00
ViViDboarder 63f04cc857 Remove incsearch for now and remeove some busted python stuff 2017-08-23 11:34:33 -07:00
ViViDboarder fbf0df53f7 Make vim-scripts explicit 2017-05-30 17:01:51 -07:00
ViViDboarder a51e3655a2 Improve deoplete and python loading 2017-05-30 14:10:55 -07:00
ViViDboarder 58a1a42b3d Add shortcut for Zen 2017-01-23 12:32:17 -08:00
ViViDboarder 9867116073 Add Ag command back 2017-01-23 12:30:17 -08:00
ViViDboarder c24f602769 Add toml support 2017-01-23 12:30:17 -08:00
ViViDboarder 5a71a92b06 Update install script to be faster
Install nvim plugins first since it's parallel
Skip UpdateRemotePlugins as each plugin should do it with vim-plug
Automate install of neovim python module
2017-01-05 17:35:12 -08:00
ViViDboarder 4f41d766a8 Big cleanup of plugin config to make it more straightforward
Also added Goyo
2017-01-05 17:25:54 -08:00
ViViDboarder a23a9b85e4 Ignore more files in tmp 2016-11-15 09:29:20 -08:00
ViViDboarder 89404652c9 Update python-mode settings 2016-11-15 09:28:30 -08:00
ViViDboarder e0f5eb2044 Clean up plugin file 2016-11-15 09:25:41 -08:00
ViViDboarder 7646ca8993 Add fzf.vim and mappings for vim-go
Also add back commented out tmuxline so it can be toggled on certain machines
2016-11-15 09:16:03 -08:00
ViViDboarder 60383b6a09 Small cleaning of plugins 2016-11-15 09:14:57 -08:00
ViViDboarder 686c6d6547 Add version check for gutentags 2016-05-20 16:17:42 -07:00
ViViDboarder af75cd6000 Update install instructions 2016-05-03 11:58:11 -07:00
ViViDboarder 2041fa4cfe Update readme 2016-05-03 11:56:09 -07:00
ViViDboarder 37d3411a64 Less lag when searching ctrlp 2016-05-03 11:42:58 -07:00
ViViDboarder 362ffced8f Add kotlin support 2016-05-03 11:42:44 -07:00
ViViDboarder 61f9c512f5 Massive CtrlP improvements 2016-03-24 12:14:39 -07:00
ViViDboarder 77ecc753e9 Change leader to space 2016-03-24 10:42:20 -07:00
ViViDboarder a5a0c7be64 Clean init file 2016-03-24 10:42:09 -07:00
ViViDboarder 36941a0b26 Update vim-airline 2016-03-24 10:41:49 -07:00
ViViDboarder 3d457e90df Update vim-grepper settings and add new motions 2016-03-24 10:41:23 -07:00
ViViDboarder 9bc754361e More deoplete plugins 2016-03-24 10:41:02 -07:00
ViViDboarder 72e12c5ee3 Add deoplete configuration 2015-12-15 17:58:03 -08:00
ViViDboarder 11833a5df4 Fix gui settings for Neovim.app 2015-12-04 11:19:50 -08:00
ViViDboarder 5334b59979 Add XDG Config to clean target 2015-11-17 21:42:01 -08:00
ViViDboarder a4f7e8a8b2 Fix viminfo 2015-11-07 11:43:21 -08:00
ViViDboarder c1b5cc90af Move shebang to top of bootstrap script 2015-10-28 10:54:46 -07:00
ViViDboarder ca93dafc60 Only use Neoterm on Neovim 2015-10-28 10:52:03 -07:00
ViViDboarder 8dce970b22 Ag cleanup 2015-10-28 10:51:47 -07:00
ViViDboarder be0a6c50d2 Fix bootstrapping of neovim 2015-10-28 10:50:01 -07:00
ViViDboarder 25eea9537e Update bootstrap script for new nvim config 2015-10-27 22:56:35 -07:00
ViViDboarder 7221f87639 Neoterm stuff only for nvim 2015-10-26 10:25:25 -07:00
ViViDboarder ee774a65e9 Cleanup for Grepper 2015-10-26 10:24:44 -07:00
ViViDboarder dc08f01422 Easier mapping to escape term in nvim 2015-10-26 10:24:22 -07:00
ViViDboarder 3cb93b7ff5 Set default shell to bash instead of sh 2015-10-26 10:23:45 -07:00
ViViDboarder a2af8da3a5 Make checking for Neocomplete more robust 2015-10-26 10:19:24 -07:00
ViViDboarder 178458e89a Use Grepper instead of ack.vim and ag.vim 2015-08-20 14:54:46 -07:00
ViViDboarder 0c21ca1154 Neovim Term mode for Airline 2015-08-17 19:27:02 -07:00
ViViDboarder ae0e8892d5 Reorder startify screen 2015-08-17 19:25:55 -07:00
ViViDboarder 5cd246b7d4 Add neoterm 2015-08-17 16:45:12 -07:00
ViViDboarder ff3b206718 More python stuff 2015-08-17 16:37:29 -07:00
ViViDboarder 179ccc8e96 Startupify and cleanup 2015-08-13 22:43:20 -07:00
ViViDboarder 008e2ef801 Clean plugin file and add vim-gutentags and vim-gitgutter 2015-08-13 15:28:46 -07:00
ViViDboarder c5f6717f15 More Omni Patterns 2015-08-13 15:27:58 -07:00
ViViDboarder c5dd824c5f Fix up neocomplete/neocomplcache 2015-06-18 09:27:57 -07:00
ViViDboarder 77a5573941 A bit of cleanup to Dash config 2015-06-15 18:02:23 -07:00
ViViDboarder bedad8069b Add vim-fish and vim-endwise 2015-06-15 18:01:57 -07:00
ViViDboarder 68cc46f11c Ignore UltiSnips directory 2015-06-15 18:00:51 -07:00
ViViDboarder 1bdb30bf1a Update keymap for new nvim :Term commands 2015-06-15 18:00:37 -07:00
ViViDboarder 5ed8198ba8 only install nvim plugins if nvim exists 2015-06-03 14:28:44 -07:00
ViViDboarder 16956153a9 Add support for fish shell, just in case 2015-05-21 13:52:19 -07:00
ViViDboarder 8d24b9ab33 Switch qfix to qfix and loclist toggles 2015-05-21 13:51:59 -07:00
ViViDboarder 89fa788e85 Add fzf 2015-04-28 16:50:32 -07:00
ViViDboarder ba490aa7b7 Move some of the more complicated plugin settings to their own rcs 2015-04-28 12:01:33 -07:00
ViViDboarder 6941a4626a Fix some neovim and tmux stuff 2015-03-31 13:48:21 -07:00
ViViDboarder c5892e0bf0 Fix bug 2015-03-26 17:54:29 -07:00
ViViDboarder 8ff7681f09 Neovim updates 2015-03-26 17:45:03 -07:00
ViViDboarder 9d6f308332 Add Makefile 2015-03-26 10:36:36 -07:00
ViViDboarder 9338f311a0 fix path 2015-03-26 10:11:36 -07:00
ViViDboarder 92d7a08690 More dark vim! 2015-03-26 10:09:26 -07:00
81 changed files with 4429 additions and 562 deletions

21
.dockerignore Normal file
View File

@ -0,0 +1,21 @@
*.log
.DS_Store
.pre_commit_env/
tags
neovim/backup/
neovim/plugged/
neovim/plugin/packer_compiled.lua
neovim/spell/
neovim/tmp/
vim/.netrwhist
vim/UltiSnips
vim/autoload/plug.vim
vim/autoload/plug.vim.old
vim/backup/
vim/plugged/
vim/rc/*.local.rc.vim
vim/rc/plugins/*.local.rc.vim
vim/spell/
vim/tmp/
vim/tmp/viminfo.*
vim/view/

39
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,39 @@
---
name: push-docker-images
"on":
push:
branches:
- 'master'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
file: ./docker/Dockerfile
context: .
platforms: linux/amd64
push: true
tags: vividboarder/my-neovim:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

21
.gitignore vendored Normal file
View File

@ -0,0 +1,21 @@
*.log
.DS_Store
.pre_commit_env/
tags
neovim/backup/
neovim/plugged/
neovim/plugin/packer_compiled.lua
neovim/spell/
neovim/tmp/
vim/.netrwhist
vim/UltiSnips
vim/autoload/plug.vim
vim/autoload/plug.vim.old
vim/backup/
vim/plugged/
vim/rc/*.local.rc.vim
vim/rc/plugins/*.local.rc.vim
vim/spell/
vim/tmp/
vim/tmp/viminfo.*
vim/view/

1
.luacheckrc Normal file
View File

@ -0,0 +1 @@
globals = { "vim" }

4
.luarc.json Normal file
View File

@ -0,0 +1,4 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.workspace.checkThirdParty": false
}

35
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,35 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/Kuniwak/vint
rev: v0.4a3
hooks:
- id: vint
exclude: >
(?x)^(
vim/colors/.*\.vim
)$
- repo: https://github.com/johnnymorganz/stylua
rev: v0.17.1
hooks:
- id: stylua-github
- repo: https://github.com/lunarmodules/luacheck
rev: v1.1.0
hooks:
- id: luacheck
args:
- --globals
- vim
- --
- repo: local
hooks:
- id: sort-json
name: sort json files with jq
language: script
entry: ./scripts/sort-json.sh
files: "(\\.json$|^neovim/packer_snapshots/)"
types: [text]

1
.stylua.toml Normal file
View File

@ -0,0 +1 @@
indent_type = "Spaces"

81
Makefile Normal file
View File

@ -0,0 +1,81 @@
.PHONY: all test
PRE_COMMIT_ENV ?= .pre_commit_env
PRE_COMMIT_ENV_BIN ?= $(PRE_COMMIT_ENV)/bin
.PHONY: default
default: check
.PHONY: install
install:
sh ./vim-sync-append.sh
.PHONY: update
update:
sh ./update-plugins.sh
.PHONY: install-coding-helpers
install-coding-helpers:
sh ./install-coding-helpers.sh
.PHONY: install-language-servers
install-language-servers: install-coding-helpers
@echo "Using obsolete make target. Change to install-coding-helpers"
.PHONY: uninstall
uninstall:
rm ~/.vimrc
rm -fr ~/.vim
rm -fr ~/.config/nvim
.PHONY: clean
clean:
# Clean vim-plug
rm -fr ./vim/plugged ./vim/autoload/plug.vim
# Clean LspInstall
rm -fr ~/.local/share/nvim/lsp_servers
# Clean Packer
rm -fr ~/.local/share/nvim/site/pack/packer
# Installs pre-commit hooks
$(PRE_COMMIT_ENV):
virtualenv $(PRE_COMMIT_ENV)
$(PRE_COMMIT_ENV_BIN)/pre-commit: $(PRE_COMMIT_ENV)
$(PRE_COMMIT_ENV_BIN)/pip install pre-commit
.PHONY: install-hooks
install-hooks: $(PRE_COMMIT_ENV_BIN)/pre-commit
$(PRE_COMMIT_ENV_BIN)/pre-commit install --install-hooks
# Checks files for encryption
.PHONY: check
check: $(PRE_COMMIT_ENV_BIN)/pre-commit
$(PRE_COMMIT_ENV_BIN)/pre-commit run --all-files
# Build Docker images
.PHONY: docker-build
docker-build:
docker build \
-f ./docker/Dockerfile \
--tag vividboarder/my-neovim .
# Build Docker images
.PHONY: docker-build-all
docker-build-all:
docker buildx build \
-f ./docker/Dockerfile \
--platform linux/arm,linux/arm64,linux/amd64 \
--tag vividboarder/my-neovim .
# Build Docker images
.PHONY: docker-build-push
docker-build-push:
docker buildx build \
-f ./docker/Dockerfile \
--push \
--platform linux/arm,linux/arm64,linux/amd64 \
--tag vividboarder/my-neovim .
.PHONY: docker-clean
docker-clean:
docker volume rm nvim-$(USER)-home

View File

@ -1,16 +1,41 @@
About
====
## About
These are just my Vim settings that I like to keep synced between my computers for convenience
These are my Vim and Neovim settings that I like to keep synced between my computers for convenience. This bootstrap setup will support both Vim and Neovim and uses different plugins, where needed, to bridge gaps in functionality.
I am not the original creators of many of the files included in the dot_vim directory and only re-host them out of convienince. If I am missing any licensing information I'd be happy to attach it.
I use Neovim day to day, but there are times it is not available, so Vim and older Neovim installs are supported as well.
Most of the packages have been replaced in favor of using vundle so that I never have to update my repo with any plugin updates.
Vim and Neovim less than 0.5 support is really in maintanence mode now and not heavily maintained. I may actually trim down the configuration to be more minimal and act as an alternative to my more IDE like Neovim environment.
Install
=======
The bootstrap script included will set the proper symblinks and run package managers to install any plugins.
git clone https://github.com/ViViDboarder/Vim-Settings.git
cd Vim-Settings
./vim-sync-append.sh
## Install
git clone https://github.com/ViViDboarder/vim-settings.git
cd vim-settings
make install
You can also remove any installed plugins or uninstall this configuration using either `make clean` or `make uninstall` respectively.
## Version support
Nearly every version of Vim or Neovim found on major distros is supported right now. To simplify things, I am considering adopting the following rule: Supporting only the lowest version of each found in the latest Ubuntu LTS and Debian Stable releases. I'll also make tags for commits where I drop support for a version.
## Project Layout
The `vim` directory here is what gets symblinked to `~/.vim`, and the `neovim` directory gets symblinked to `~/.config/nvim`. Inside, the `init.vim` file will also get symblinked to `~/.vimrc`. The `neovim/init.vim` file will dyanmically load the older non-Lua configs if Lua is not supported. The other included directories are mostly standard vim directories that provide some additional configuration files. The exceptions would be `backup`, which becomes the new default location for storing backup files while editing. The `tmp` directory is for storing session information. The `rc` directory is where all the `vimrc` work gets done.
## Neovim config
This config is in Lua with the philosopy of taking advantage of as much out of the box capaiblities as possible.
## Vim and old Nvim
### The rc Files
The `init.vim` file essentially sets vim up to import the rc files from the `rc` directory. The actual configuration exists almost entirely in the `rc` directory. Each file should be fairly self explanatory.
One problem with syncing rc file between different machines, is that you may have different usages. That is solved by this framework by making use of `local.rc` files. For every `*.rc.vim`, you may provide a `*.local.rc.vim` file which will be loaded after the shared one. Here you can override or add anything to the synced configuration without it causing problems on any other machine.
## Note
I am not the original creators of some of the files included in the vim directory and only vendor them out of convienince. If I am missing any licensing information I'd be happy to attach it.

70
docker/Dockerfile Normal file
View File

@ -0,0 +1,70 @@
# hadolint global ignore=DL3018,DL3059
FROM alpine:3.18
RUN apk add --no-cache \
bash \
cargo \
ctags \
curl \
git \
go \
luarocks \
make \
neovim \
npm \
py3-pip \
py3-pynvim \
python3 \
;
# Install shellcheck and rustup, if in repo (like arm)
RUN apk add --no-cache shellcheck rustup || true
# Create user
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
RUN mkdir -p $XDG_CONFIG_HOME
# Configure go path
ENV GOPATH $HOME/go
RUN mkdir -p $GOPATH/bin
ENV PATH $PATH:$GOPATH/bin
# Configure npm path
ENV NPM_PACKAGES $HOME/.npm-packages
RUN npm config set prefix $NPM_PACKAGES
ENV PATH $PATH:$NPM_PACKAGES/bin
ENV PATH $HOME/.local/bin:$PATH
# Add personal user bin path
RUN mkdir $HOME/bin
ENV PATH $HOME/bin:$PATH
# Install Language servers
COPY --chown=vividboarder:users ./install-coding-helpers.sh ./
RUN ./install-coding-helpers.sh
# Add config
COPY --chown=vividboarder:users ./neovim $HOME/.config/nvim
# Sync packer plugins
RUN nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerBootstrap"
# Bootstrap treesitter parsers
RUN nvim --headless -c "lua require('plugins.treesitter').bootstrap()" -c quitall
# Create persistent data dir
RUN mkdir -p /home/vividboarder/.data
VOLUME /home/vividboarder/.data
# Generate workdir
RUN mkdir /home/vividboarder/data
WORKDIR /home/vividboarder/data
COPY ./docker/docker-entry.sh /docker-entry.sh
ENTRYPOINT ["/docker-entry.sh"]

13
docker/docker-entry.sh Executable file
View File

@ -0,0 +1,13 @@
#! /bin/bash
set -e
VOLUME_DATA=/home/vividboarder/.data
[ -d "$VOLUME_DATA/nvim/backup" ] || mkdir -p "$VOLUME_DATA/nvim/backup"
[ -d "$XDG_CONFIG_HOME/nvim/backup" ] || ln -s "$VOLUME_DATA/nvim/backup" "$XDG_CONFIG_HOME/nvim/backup"
if [ "$1" == "bash" ]; then
exec "$@"
else
exec nvim "$@"
fi

20
docker/nvim-container.sh Executable file
View File

@ -0,0 +1,20 @@
#! /bin/bash
set -e
container_name=nvim-$USER
if ! docker inspect "${container_name}-home" > /dev/null ; then
docker volume create "${container_name}-home"
fi
docker run --interactive --rm --tty \
--name "$container_name" \
--env "NVIM_COLOR=$NVIM_COLOR" \
--volume "${container_name}-home:/home/vividboarder/.data" \
--volume "$(pwd):/home/vividboarder/data" \
--workdir /home/vividboarder/data \
--entrypoint /docker-entry.sh \
--user "vividboarder:$(id -g)" \
--group-add users \
vividboarder/my-neovim "$@"

308
install-coding-helpers.sh Executable file
View File

@ -0,0 +1,308 @@
#! /bin/bash
# Clear explicit PYTHONPATH since this gets confused between py2 and py3
export PYTHONPATH=""
# Languages to install helpers for
declare -a VIM_LANGS
# Read flag for ignore missing and args for languages
while [[ $# -gt 0 ]]; do
case "$1" in
--ignore-missing)
VIM_IGNORE_MISSING=true
;;
*)
VIM_LANGS+=("$1")
;;
esac
shift
done
function want_lang() {
if [ "${#VIM_LANGS[@]}" -eq 0 ]; then
return 0
fi
for l in "${VIM_LANGS[@]}"; do
if [ "$l" == "$1" ]; then
return 0
fi
done
return 1
}
# Ignore failed installs
if [ -z "$VIM_IGNORE_MISSING" ]; then
set -e
else
set +e
fi
# Determines if a command exists or not
function command_exists() {
command -v "$1" > /dev/null 2>&1;
}
# Runs a command or spits out the output
function maybe_run() {
if command_exists "$1" ;then
echo "> $*"
# shellcheck disable=2048,2086
eval $*
else
echo "ERROR: $1 does not exist. Could not 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_npm_install bash-language-server
fi
# Kotlin
# https://github.com/fwcd/kotlin-language-server/blob/master/BUILDING.md
# Python
if want_lang python ;then
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
if should_install_user gopls ;then
export GO111MODULE=on
maybe_run go install golang.org/x/tools/gopls@latest
fi
fi
echo ""
}
## Linters
function install_linters() {
echo "### Installing linters..."
# Python
if want_lang python ;then
maybe_pip_install mypy || echo "WARNING: mypy is py3 only"
fi
# CSS
if want_lang css || want_lang web ;then
maybe_npm_install csslint
fi
# Vim
if want_lang vim || want_lang neovim ;then
maybe_pip_install vim-vint
fi
# YAML
if want_lang yaml ;then
maybe_pip_install yamllint
fi
# Text / Markdown
if want_lang text || want_lang prose ;then
maybe_npm_install alex write-good
maybe_pip_install proselint
fi
# Makefile
# maybe_run go install github.com/mrtazz/checkmake@latest
# Go
if want_lang go ;then
maybe_run release-gitter --git-url "https://github.com/golangci/golangci-lint" \
--map-system Windows=windows --map-system Linux=linux --map-system Darwin=darwin \
--map-arch x86_64=amd64 --map-arch armv7l=armv7 --map-arch aarch64=arm64 \
--extract-all --exec "'mv /tmp/\$(echo {}|sed s/\.tar\.gz\$//)/golangci-lint ~/bin/'" \
"golangci-lint-{version}-{system}-{arch}.tar.gz" /tmp/
fi
# Lua
if want_lang lua || want_lang neovim ;then
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
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
fi
# Terraform
if want_lang terraform ;then
maybe_run release-gitter --git-url "https://github.com/aquasecurity/tfsec" \
--map-arch x86_64=amd64 \
--map-arch aarch64=arm64 \
--map-system Linux=linux --map-system Darwin=darwin \
--exec "'mv ~/bin/{} ~/bin/tfsec && chmod +x ~/bin/tfsec'" \
"tfsec-{system}-{arch}" ~/bin
maybe_run release-gitter --git-url "https://github.com/terraform-linters/tflint" \
--map-arch x86_64=amd64 \
--map-arch aarch64=arm64 \
--map-system Linux=linux --map-system Darwin=darwin \
--extract-all --exec "'chmod +x ~/bin/tflint'" \
"tflint_{system}_{arch}.zip" ~/bin
fi
echo ""
}
## Fixers
function install_fixers() {
echo "### Installing 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_npm_install prettier
fi
# Python
if want_lang python ;then
maybe_pip_install black reorder-python-imports
fi
# Rust
if want_lang rust ;then
maybe_run rustup component add rustfmt
fi
# Lua
if want_lang lua || want_lang neovim ;then
# Version pinned to version in pre-commit
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 \
--exec "chmod +x ~/bin/stylua" \
"stylua-{system}-{arch}.zip" ~/bin ; then
maybe_run cargo install --version "$stylua_version" stylua
fi
fi
echo ""
}
## Debuggers
function install_debuggers() {
# Python
if want_lang python ;then
maybe_pip_install debugpy
fi
}
function main() {
maybe_pip_install release-gitter
install_language_servers
install_linters
install_fixers
install_debuggers
echo ""
echo "DONE"
}
main

1
neovim/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*_local.lua

0
neovim/backup/.gitkeep Normal file
View File

View File

@ -0,0 +1,2 @@
let g:tokyonight_style = 'night'
runtime colors/tokyonight.vim

View File

@ -0,0 +1,2 @@
let g:tokyonight_style = 'storm'
runtime colors/tokyonight.vim

8
neovim/ftplugin/fish.vim Normal file
View File

@ -0,0 +1,8 @@
" Set up :make to use fish for syntax checking.
compiler fish
" Set this to have long lines wrap inside comments.
setlocal textwidth=79
" Enable folding of block structures in fish.
setlocal foldmethod=expr

1
neovim/ftplugin/go.vim Normal file
View File

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

View File

@ -0,0 +1,7 @@
" Set Markdown indent to 2 so single indented text doesn't become 'code'
set shiftwidth=2
" From plasticboy/vim-markdown via sheerun/vim-polyglot
let g:vim_markdown_new_list_item_indent = 0
call textobj#sentence#init()

View File

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

2
neovim/ftplugin/yaml.vim Normal file
View File

@ -0,0 +1,2 @@
" Set YAML indent to 2 because list objects are weird otherwise
set shiftwidth=2

8
neovim/init.vim Normal file
View File

@ -0,0 +1,8 @@
" Maybe load init.lua
if has('nvim-0.6')
lua require('init')
else
set runtimepath+='~/.vim'
source ~/.vim/autoload/*
source ~/.vim/init.vim
end

73
neovim/lua/_bindings.lua Normal file
View File

@ -0,0 +1,73 @@
local utils = require("utils")
utils.keymap_set("n", "<C-L><C-L>", ":set wrap!<CR>", { desc = "Toggle line wrapping" })
utils.keymap_set("n", "<leader>lw", ":set wrap!<CR>", { desc = "Toggle line wrapping" })
utils.keymap_set("n", "<C-N><C-N>", ":set invnumber<CR>", { desc = "Toggle line numbers" })
utils.keymap_set("n", "<leader>ln", ":set invnumber<CR>", { desc = "Toggle line numbers" })
utils.keymap_set("n", "<leader>/", ":set hlsearch! hlsearch?<CR>", { desc = "Toggle search highlighting" })
utils.keymap_set("n", "<leader>cs", ":nohlsearch<CR>", { desc = "Clear search highlighting" })
utils.keymap_set("n", "<leader>ws", ":set list!<CR>", { desc = "Toggle whitespace characters" })
-- Save and quit typos
utils.keymap_set("c", "WQ<CR>", "wq<CR>", { desc = "Write and quit" })
utils.keymap_set("c", "Wq<CR>", "wq<CR>", { desc = "Write and quit" })
utils.keymap_set("c", "W<CR>", "w<CR>", { desc = "Write" })
utils.keymap_set("c", "Q<CR>", "q<CR>", { desc = "Quit" })
utils.keymap_set("c", "Q!<CR>", "q!<CR>", { desc = "Force quit" })
utils.keymap_set("c", "Qa<CR>", "qa<CR>", { desc = "Quit all" })
utils.keymap_set("c", "Qa!<CR>", "qa!<CR>", { desc = "Force quit all" })
utils.keymap_set("c", "QA<CR>", "qa<CR>", { desc = "Quit all" })
utils.keymap_set("c", "QA!<CR>", "qa!<CR>", { desc = "Force quit all" })
utils.keymap_set("c", "w;", "w", { desc = "Write" })
utils.keymap_set("c", "W;", "w", { desc = "Write" })
utils.keymap_set("c", "q;", "q", { desc = "Quit" })
utils.keymap_set("c", "Q;", "q", { desc = "Quit" })
-- Paste over
utils.keymap_set("v", "pp", "p", { desc = "Paste" })
utils.keymap_set("v", "po", '"_dP', { desc = "Paste over and keep clipboard" })
-- Buffer nav
utils.keymap_set("n", "gb", ":bnext<CR>", { desc = "Next buffer" })
utils.keymap_set("n", "gB", ":bprevious<CR>", { desc = "Previous buffer" })
-- Easy redo
utils.keymap_set("n", "U", ":redo<CR>", { desc = "Redo" })
-- Make escape easier
utils.keymap_set("i", "jk", "<esc>", { desc = "Escape insert" })
utils.keymap_set("i", "``", "<esc>", { desc = "Escape insert" })
utils.keymap_set("v", "``", "<esc>", { desc = "Escape visual" })
-- C-Space completion
function _G.complete_space()
if vim.fn.pumvisible() == 1 then
return utils.t("<C-n>")
elseif utils.is_plugin_loaded("completion-nvim") then
return utils.t("<Plug>(completion_trigger)")
elseif utils.is_plugin_loaded("nvim-compe") then
return vim.fn["compe#complete"]()
elseif utils.is_plugin_loaded("nvim-cmp") then
return utils.t("<Plug>(cmp_complete)")
else
return utils.t("<C-x><C-o>")
end
end
utils.keymap_set("i", "<C-Space>", "v:lua.complete_space()", { expr = true })
-- TODO: remove check when dropping v0.6.0
if vim.fn.has("nvim-0.7.0") == 1 then
vim.api.nvim_create_user_command("TagsUpdate", "!ctags -R .", { desc = "Update ctags" })
vim.api.nvim_create_user_command("Todo", "grep TODO", { desc = "Search for TODO tags" })
vim.api.nvim_create_user_command("Spell", "setlocal spell! spelllang=en_us", { desc = "Toggle spelling" })
else
vim.cmd("command! TagsUpdate !ctags -R .")
vim.cmd("command! Todo grep TODO")
vim.cmd("command Spell setlocal spell! spelllang=en_us")
end
-- Pop spelling completion for word under cursor
utils.keymap_set("n", "<leader>s", "viw<esc>a<c-x>s", { desc = "Show spelling suggestions" })
-- Build on F5
utils.keymap_set("n", "<F5>", ":make<CR>", { desc = "Run make" })

77
neovim/lua/_colors.lua Normal file
View File

@ -0,0 +1,77 @@
-- Update colors based on environment variables
function _G.update_colors()
local function maybe_set(scope, name, val, force)
force = force or false
local changed = vim[scope][name] ~= val
if changed or force then
if scope == "g" and name == "colors_name" then
-- Colorscheme is different. Use this instead of setting colors_name directly
-- Try to set the colorscheme. If not loaded, skip the error
local status, _ = pcall(vim.cmd, "colorscheme " .. val)
if not status then
vim.notify("Failed to set colorscheme to " .. val .. ". Maybe it's not yet loaded")
end
else
vim[scope][name] = val
end
return changed
end
return false
end
-- Set colorscheme based on env
local utils = require("utils")
local default_color = "wombat_lush"
local env_color = utils.env_default("VIM_COLOR", default_color)
env_color = utils.env_default("NVIM_COLOR", env_color)
-- Read dark mode
local mode = utils.env_default("IS_DARKMODE", "dark")
if vim.g.is_mac == 1 then
local cmd = "defaults read -g AppleInterfaceStyle 2>/dev/null || echo Light"
mode = vim.fn.system(cmd):gsub("\n", ""):lower()
end
-- Update background and theme
local change = false
if mode == "dark" then
env_color = utils.env_default("VIM_COLOR_DARK", env_color)
env_color = utils.env_default("NVIM_COLOR_DARK", env_color)
change = maybe_set("o", "background", "dark")
change = maybe_set("g", "colors_name", env_color, false) or change
elseif mode == "light" then
env_color = utils.env_default("VIM_COLOR_LIGHT", env_color)
env_color = utils.env_default("NVIM_COLOR_LIGHT", env_color)
change = maybe_set("o", "background", "light")
change = maybe_set("g", "colors_name", env_color, false) or change
end
-- Update status line theme
if change then
if vim.fn.exists(":AirlineRefresh") == 1 then
vim.cmd(":AirlineRefresh")
elseif utils.is_plugin_loaded("lualine.nvim") then
require("plugins.lualine").config_lualine()
end
end
return change and "Changed color to " .. env_color .. " with mode " .. mode or "No change"
end
-- Don't need the autocommand when dark-notify is installed
local utils = require("utils")
if not utils.is_plugin_loaded("dark-notify") then
-- TODO: remove check when dropping v0.6.0
if vim.fn.has("nvim-0.7.0") == 1 then
vim.api.nvim_create_autocmd({ "FocusGained" }, {
pattern = "*",
callback = _G.update_colors,
group = vim.api.nvim_create_augroup("auto_colors", { clear = true }),
})
else
utils.autocmd("auto_colors", "FocusGained * call v:lua.update_colors()")
end
end
-- Initial setting of colors
_G.update_colors()

53
neovim/lua/_settings.lua Normal file
View File

@ -0,0 +1,53 @@
local o = vim.o
local g = vim.g
local utils = require("utils")
-- Set backup on
o.backup = true
o.backupdir = table.concat({
(vim.env.XDG_DATA_HOME or "") .. "/nvim/backup//",
(vim.env.XDG_CONFIG_HOME or "") .. "/nvim/backup//",
"~/.config/nvim/backup//",
".",
}, ",")
-- Set leader to space
g.mapleader = " "
-- Get terminal colors and unicode working, hopefully
vim.cmd([[
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
]])
o.termguicolors = true
-- o.term = "xterm-256color"
o.number = true
o.expandtab = true
o.tabstop = 4
o.softtabstop = 4
o.shiftwidth = 4
o.virtualedit = "onemore"
o.scrolljump = 5
o.scrolloff = 3
-- o.backspace = "2"
-- o.mousehide = true
o.mouse = "a"
-- Autocomplete options
o.completeopt = "menuone,noinsert,noselect,preview"
-- TODO: remove check when dropping v0.6.0
if vim.fn.has("nvim-0.7.0") == 1 then
vim.api.nvim_create_autocmd({ "CompleteDone" }, {
pattern = "*",
command = "if pumvisible() == 0 | pclose | endif",
group = vim.api.nvim_create_augroup("close_preview", { clear = true }),
})
else
utils.autocmd("close_preview", "CompleteDone * if pumvisible() == 0 | pclose | endif", true)
end
local has = vim.fn.has
g.is_mac = (has("mac") or has("macunix") or has("gui_macvim") or vim.fn.system("uname"):find("^darwin") ~= nil)
g.is_gui = vim.fn.exists("g:neovide")

29
neovim/lua/init.lua Normal file
View File

@ -0,0 +1,29 @@
if vim.fn.has("nvim-0.6.0") ~= 1 then
print("ERROR: Requires nvim >= 0.6.0")
end
local o = vim.o
-- Helpers
require("_settings")
require("_bindings")
require("_colors")
-- Use better grep programs
if vim.fn.executable("rg") == 1 then
o.grepprg = "rg --vimgrep --no-heading --color=never"
o.grepformat = "%f:%l:%c:%m,%f:%l:%m"
elseif vim.fn.executable("ag") == 1 then
o.grepprg = "ag --vimgrep --nogroup --nocolor"
elseif vim.fn.executable("ack") == 1 then
o.grepprg = "ack"
end
-- Disable polyglot for langauges I've added special support for
-- TODO: Can this be moved somewhere better?
vim.g.polyglot_disabled = { "go", "rust" }
-- Plugins
-- Packer auto installs and then lazy loads itself on PackerCommand and require the plugins module
-- This command should only really be needed to bootstrap a new system
vim.cmd([[command! PackerBootstrap lua require("plugins")]])

View File

@ -0,0 +1,2 @@
require("_settings")
require("_bindings")

624
neovim/lua/plugins.lua Normal file
View File

@ -0,0 +1,624 @@
-- Install packer
local utils = require("utils")
local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/opt/packer.nvim"
local packer_bootstrap = ""
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
packer_bootstrap = vim.fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path })
end
vim.cmd("packadd packer.nvim")
local packer = require("packer")
local packer_util = require("packer.util")
local use = packer.use
packer.init({
-- Always load default
snapshot = utils.map_version_rule({
[">=0.9.0"] = "latest-0.9",
[">=0.8.0"] = "latest-0.8",
[">=0.7.0"] = "latest-0.7",
[">=0.6.0"] = "latest-0.6",
}),
snapshot_path = packer_util.join_paths(vim.fn.stdpath("config"), "packer_snapshots"),
display = {
open_fn = function()
return packer_util.float({ border = "single" })
end,
},
})
-- Load things faster!
if vim.fn.has("nvim-0.9.0") == 1 then
-- Not needed on nvim 0.9+
vim.loader.enable()
else
use({
"lewis6991/impatient.nvim",
config = [[require('impatient')]],
tag = utils.map_version_rule({
[">=0.7.0"] = utils.nil_val,
[">0.6.0"] = "v0.2",
[">=0.5.0"] = "v0.1",
}),
})
end
-- Let Packer manage and lazyload itself
use({
"https://github.com/wbthomason/packer.nvim",
cmd = {
"PackerClean",
"PackerCompile",
"PackerInstall",
"PackerLoad",
"PackerProfile",
"PackerSnapshot",
"PackerSnapshotDelete",
"PackerSnapshotRollback",
"PackerStatus",
"PackerSync",
"PackerUpdate",
},
config = [[require("plugins")]],
})
-- Colorschemes
use({
"https://github.com/vim-scripts/wombat256.vim",
{
"https://github.com/ViViDboarder/wombat.nvim",
requires = {
{
"rktjmp/lush.nvim",
tag = utils.map_version_rule({
[">=0.7.0"] = utils.nil_val,
[">=0.5.0"] = "v1.0.1",
}),
},
},
},
{
"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",
}),
},
{
"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("https://github.com/tpope/vim-endwise")
-- Unix commands from vim? Yup!
use("https://github.com/tpope/vim-eunuch")
-- Adds repeats for custom motions
use("https://github.com/tpope/vim-repeat")
-- Readline shortcuts
use("https://github.com/tpope/vim-rsi")
-- Surround motions
use("https://github.com/tpope/vim-surround")
-- Better netrw
use("https://github.com/tpope/vim-vinegar")
-- Easier jumping to lines
use("https://github.com/vim-scripts/file-line")
-- Auto ctags generation
use("https://github.com/ludovicchabant/vim-gutentags")
-- Make it easier to discover some of my keymaps
use({
"https://github.com/folke/which-key.nvim",
config = function()
require("plugins.whichkey").configure()
end,
tag = "v1.*",
})
-- Better commenting
use({
"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" })
end,
})
-- Allow wrapping and joining of arguments across multiple lines
use({
"https://github.com/FooSoft/vim-argwrap",
config = function()
require("utils").keymap_set("n", "<Leader>a", "<cmd>ArgWrap<CR>", {
desc = "Wrap or unwrap arguments",
})
end,
})
-- Adds git operations to vim
use({
"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" })
require("utils").keymap_set("n", "gd", "<cmd>Git diff<CR>", { desc = "Git diff" })
require("utils").keymap_set("n", "gs", "<cmd>Git<CR>", { desc = "Git status" })
require("utils").keymap_set("n", "gw", "<cmd>Git write<CR>", { desc = "Git write" })
end,
})
-- Quick toggling of Location and Quickfix lists
use({
"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" })
end,
})
-- Find text everywhere!
use({
"https://github.com/mhinz/vim-grepper",
config = function()
require("plugins.grepper")
end,
})
-- Highlight inline colors
use({
"https://github.com/norcalli/nvim-colorizer.lua",
config = function()
require("colorizer").setup()
end,
})
-- Custom status line
use({
"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({
"https://github.com/SmiteshP/nvim-navic",
requires = "https://github.com/neovim/nvim-lspconfig",
disable = vim.fn.has("nvim-0.7.0") ~= 1,
})
use({
"https://github.com/nvim-lualine/lualine.nvim",
config = function()
require("plugins.lualine").config_lualine()
end,
after = vim.fn.has("nvim-0.7.0") == 1 and "nvim-navic" or "nvim-gps",
})
-- On Mac, update colors when dark mode changes
use({
"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 = function()
require("plugins.darknotify")
end,
requires = "https://github.com/nvim-lualine/lualine.nvim",
})
-- Custom start screen
use({
"https://github.com/mhinz/vim-startify",
config = function()
require("utils").require_with_local("plugins.startify")
end,
})
-- LSP
-- Configure language servers
use({
"https://github.com/neovim/nvim-lspconfig",
tag = utils.map_version_rule({
-- [">=0.8.0"] = utils.nil_val,
[">=0.7.0"] = utils.nil_val,
[">=0.6.1"] = "v0.1.2",
[">=0.6.0"] = "v0.1.0",
}),
})
-- 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({
"https://github.com/williamboman/mason.nvim",
requires = {
"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,
})
-- Lua dev for vim
use({
"https://github.com/folke/neodev.nvim",
requires = "https://github.com/neovim/nvim-lspconfig",
})
-- Rust analyzer
use({
"https://github.com/simrat39/rust-tools.nvim",
disable = vim.fn.has("nvim-0.7.0") ~= 1,
})
-- Better display of lsp diagnostics
use({
"https://github.com/folke/trouble.nvim",
tag = utils.map_version_rule({
[">=0.7.2"] = "v2.*",
["<0.7.2"] = "v1.*",
}),
})
-- Incremental lsp rename view
use({
"https://github.com/smjonas/inc-rename.nvim",
config = function()
require("inc_rename").setup({
input_buffer_type = "dressing",
})
end,
-- Only supports >=0.8.0
disable = vim.fn.has("nvim-0.8.0") ~= 1,
})
-- Generic linter/formatters in diagnostics API
use({
"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 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",
}),
requires = { "https://github.com/nvim-lua/plenary.nvim", "https://github.com/neovim/nvim-lspconfig" },
})
-- Writing
-- abolish/pencil
use({
"https://github.com/preservim/vim-pencil",
cmd = { "Pencil" },
})
use({
"https://github.com/preservim/vim-textobj-sentence",
requires = "https://github.com/kana/vim-textobj-user",
})
use({
"https://github.com/junegunn/goyo.vim",
cmd = { "Goyo", "Zen" },
config = [[require("plugins.goyo-limelight")]],
requires = { "https://github.com/junegunn/limelight.vim", cmd = "Limelight" },
})
-- Treesitter
use({
"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",
}),
config = function()
require("utils").require_with_local("plugins.treesitter").setup()
end,
})
--[[ TODO: Enable this as an alterantive or fallback for LSPs
use({
"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",
}),
})
--]]
use({
"https://github.com/nvim-treesitter/nvim-treesitter-textobjects",
requires = "https://github.com/nvim-treesitter/nvim-treesitter",
commit = utils.map_version_rule({
[">=0.8.0"] = utils.nil_val,
[">=0.7.0"] = "8673926519ea61069f9c1366d1ad1949316d250e",
["<0.7.0"] = "eca3bf30334f85259d41dc060d50994f8f91ef7d",
}),
})
-- Completion
use({
"https://github.com/L3MON4D3/LuaSnip",
tag = "v1.*",
})
use({
"https://github.com/hrsh7th/nvim-cmp",
config = function()
require("plugins.completion").config_cmp()
end,
commit = utils.map_version_rule({
[">=0.7.0"] = utils.nil_val,
[">=0.5.0"] = "bba6fb67fdafc0af7c5454058dfbabc2182741f4",
}),
requires = {
{
"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",
}),
},
{ "https://github.com/hrsh7th/cmp-buffer", after = "nvim-cmp" },
{ "https://github.com/f3fora/cmp-spell", after = "nvim-cmp" },
{
"https://github.com/saadparwaiz1/cmp_luasnip",
after = "nvim-cmp",
commit = utils.map_version_rule({
[">0.7.0"] = utils.nil_val,
[">=0.5.0"] = "b10829736542e7cc9291e60bab134df1273165c9",
}),
},
"https://github.com/L3MON4D3/LuaSnip",
},
event = "InsertEnter *",
})
-- Add snippets
use({
"https://github.com/rafamadriz/friendly-snippets",
requires = "https://github.com/L3MON4D3/LuaSnip",
after = "LuaSnip",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
})
use({
"https://github.com/ray-x/lsp_signature.nvim",
config = function()
require("lsp_signature").setup({
extra_trigger_chars = { "(", "," },
auto_close_after = nil,
-- Toggle these to use hint only
floating_window = true,
hint_enable = false,
})
end,
})
-- Fuzzy Finder
use({
"https://github.com/nvim-telescope/telescope.nvim",
requires = {
"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.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",
}),
config = function()
require("plugins.telescope")
end,
})
-- Filetypes
use("https://github.com/ViViDboarder/vim-forcedotcom")
use("https://github.com/hsanson/vim-android")
use({
"https://github.com/sheerun/vim-polyglot",
config = function()
-- TODO: Replace with api calls when dropping 0.6
vim.cmd([[
augroup polyglot_fts
au BufRead,BufNewFile */playbooks/*.yml,*/playbooks/*.yaml set filetype=yaml.ansible
au BufRead,BufNewFile go.mod,go.sum set filetype=gomod
augroup end
]])
end,
})
-- Debuging nvim config
use({
"https://github.com/tweekmonster/startuptime.vim",
cmd = { "StartupTime" },
})
-- Fancy todo highlighting
use({
"https://github.com/folke/todo-comments.nvim",
requires = {
"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"] = "v1.*",
["<0.8.0"] = utils.nil_val,
}),
branch = utils.map_version_rule({
[">=0.8.0"] = utils.nil_val,
["<0.8.0"] = "neovim-pre-0.8.0",
}),
})
-- Fancy notifications
use({
"https://github.com/rcarriga/nvim-notify",
config = function()
require("plugins.notify")
end,
})
use({
"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()
end

View File

@ -0,0 +1,62 @@
local M = {}
function M.config_cmp()
local cmp = require("cmp")
local luasnip = require("luasnip")
cmp.setup({
completion = {
completeopt = "menuone,noinsert",
autocomplete = false,
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "spell" },
{ name = "obsidian" },
{ name = "obsidian_new" },
},
mapping = cmp.mapping.preset.insert({
-- Scroll docs with readline back - forward
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
-- Expand snippets with Tab
["<Tab>"] = cmp.mapping(function(fallback)
if luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end),
-- Start and cycle completions with C-Space
["<C-Space>"] = cmp.mapping(function()
if cmp.visible() then
cmp.select_next_item()
else
cmp.complete()
end
end),
-- Confirm completion with Enter
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
})
-- Add a plug mapping to use in C-Space binding
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

@ -0,0 +1,18 @@
vim.g.goyo_width = 120
vim.cmd([[
command Zen :Goyo
function! s:goyo_enter()
Limelight
endfunction
function! s:goyo_leave()
Limelight!
endfunction
augroup zenevents
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
augroup end
]])

View File

@ -0,0 +1,47 @@
-- Grepper settings and shortcuts
vim.g.grepper = {
quickfix = 1,
open = 1,
switch = 0,
jump = 0,
tools = { "git", "rg", "ag", "ack", "pt", "grep" },
dir = "repo,cwd",
}
require("utils").keymap_set({ "n", "x" }, "gs", "<plug>(GrepperOperator)", {
silent = true,
noremap = false,
desc = "Grepper",
})
-- Override Todo command to use Grepper
-- TODO: Remove check when dropping 0.6
if vim.fn.has("nvim-0.7.0") == 1 then
vim.api.nvim_create_user_command("Todo", ":Grepper -noprompt -query TODO", { desc = "Search for TODO tags" })
else
vim.cmd("command! Todo :Grepper -noprompt -query TODO")
end
-- Make some shortands for various grep programs
-- TODO: Remove check when dropping 0.6
if vim.fn.has("nvim-0.7.0") == 1 then
if vim.fn.executable("rg") == 1 then
vim.api.nvim_create_user_command("Rg", ":GrepperRg <args>", { nargs = "+", desc = "Ripgrep" })
end
if vim.fn.executable("ag") == 1 then
vim.api.nvim_create_user_command("Ag", ":GrepperAg <args>", { nargs = "+", desc = "Silversearcher" })
end
if vim.fn.executable("ack") == 1 then
vim.api.nvim_create_user_command("Ack", ":GrepperAck <args>", { nargs = "+", desc = "Ack search" })
end
else
if vim.fn.executable("rg") == 1 then
vim.cmd("command -nargs=+ Rg :GrepperRg <args>")
end
if vim.fn.executable("ag") == 1 then
vim.cmd("command -nargs=+ Ag :GrepperAg <args>")
end
if vim.fn.executable("ack") == 1 then
vim.cmd("command -nargs=+ Ack :GrepperAck <args>")
end
end

390
neovim/lua/plugins/lsp.lua Normal file
View File

@ -0,0 +1,390 @@
-- luacheck: globals packer_plugins
local M = {}
local utils = require("utils")
function M.config_lsp_ui()
local border = {
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
}
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
opts = opts or {}
opts.border = opts.border or border
return orig_util_open_floating_preview(contents, syntax, opts, ...)
end
-- Diagnostics signs
for type, icon in pairs(utils.diagnostic_signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
utils.try_require("trouble", function(trouble)
trouble.setup({
fold_open = "",
fold_closed = "",
icons = false,
use_diagnostic_signs = true,
})
end)
end
local function get_server_capabilities(client)
-- HACK: Support for <0.8
if client.server_capabilities ~= nil then
return client.server_capabilities
end
local capabilities = client.resolved_capabilities
if capabilities.documentSymbolProvider == nil then
capabilities.documentSymbolProvider = capabilities.goto_definition
end
if capabilities.documentFormattingProvider == nil then
capabilities.documentFormattingProvider = capabilities.document_formatting
end
if capabilities.documentRangeFormattingProvider == nil then
capabilities.documentRangeFormattingProvider = capabilities.document_range_formatting
end
if capabilities.documentHighlightProvider == nil then
capabilities.documentHighlightProvider = capabilities.document_highlight
end
if capabilities.workspaceSymbolProvider == nil then
-- Not sure what the legacy version of this is
capabilities.workspaceSymbolProvider = capabilities.goto_definition
end
return capabilities
end
local function get_default_attach(override_capabilities)
return function(client, bufnr)
-- Allow overriding capabilities to avoid duplicate lsps with capabilities
-- Using custom method to extract for <0.8 support
local server_capabilities = get_server_capabilities(client)
if override_capabilities ~= nil then
server_capabilities = vim.tbl_extend("force", server_capabilities, override_capabilities or {})
end
local function buf_set_option(...)
vim.api.nvim_buf_set_option(bufnr, ...)
end
-- Set built in features to use lsp functions (automatic in nvim-0.8)
-- HACK: Support for <0.8
if vim.fn.has("nvim-0.8") ~= 1 then
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
if server_capabilities.documentSymbolProvider then
buf_set_option("tagfunc", "v:lua.vim.lsp.tagfunc")
end
if server_capabilities.documentFormattingProvider then
buf_set_option("formatexpr", "v:lua.vim.lsp.formatexpr()")
end
end
-- Mappings
-- TODO: use functions instead of strings when dropping 0.6
local lsp_keymap = utils.curry_keymap("n", "<leader>l", { buffer = bufnr })
lsp_keymap("h", "<cmd>lua vim.lsp.buf.hover()<CR>", { desc = "Display hover" })
lsp_keymap("rn", "<cmd>lua vim.lsp.buf.rename()<CR>", { desc = "Refactor rename" })
lsp_keymap("e", "<cmd>lua vim.diagnostic.open_float()<CR>", { desc = "Open float dialog" })
lsp_keymap("D", "<cmd>lua vim.lsp.buf.declaration()<CR>", { desc = "Go to declaration" })
lsp_keymap("d", "<cmd>lua vim.lsp.buf.definition()<CR>", { desc = "Go to definition" })
lsp_keymap("t", "<cmd>lua vim.lsp.buf.type_definition()<CR>", { desc = "Go to type definition" })
lsp_keymap("i", "<cmd>lua vim.lsp.buf.implementation()<CR>", { desc = "Show implementations" })
lsp_keymap("s", "<cmd>lua vim.lsp.buf.signature_help()<CR>", { desc = "Show signature help" })
lsp_keymap("wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", { desc = "Workspace: Add folder" })
lsp_keymap("wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", { desc = "Workspace: Remove folder" })
lsp_keymap(
"wl",
"<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>",
{ desc = "Workspace: List folders" }
)
lsp_keymap("r", "<cmd>lua vim.lsp.buf.references()<CR>", { desc = "References" })
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(
"i",
"<C-k>",
"<cmd>lua vim.lsp.buf.signature_help()<CR>",
{ 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", "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)
buf_set_keymap("n", "<leader>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
buf_set_keymap("n", "<leader>D", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
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", "<leader>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
--]]
-- Open diagnostic on hold
if vim["diagnostic"] ~= nil then
-- TODO: When dropping 0.6, use lua aucommand api
vim.cmd([[autocmd CursorHold * lua vim.diagnostic.open_float(nil, {focus=false, scope="cursor"})]])
end
-- Use IncRename if available
if utils.try_require("inc_rename") ~= nil then
-- TODO: Should I be using this for calling lua functions from keymaps?
vim.keymap.set("n", "<leader>rn", function()
return ":IncRename " .. vim.fn.expand("<cword>")
end, { expr = true, buffer = true, desc = "Rename current symbol" })
end
-- Set some keybinds conditional on server capabilities
if vim.fn.has("nvim-0.8") == 1 then
lsp_keymap("f", "<cmd>lua vim.lsp.buf.format({async=true})<CR>", { desc = "Format code" })
lsp_keymap(
"f",
"<cmd>lua vim.lsp.buf.format({async=true})<CR>",
{ mode = "v", desc = "Format selected code" }
)
if server_capabilities.documentFormattingProvider then
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
pattern = { "*.rs", "*.go", "*.sh", "*.lua" },
callback = function()
vim.lsp.buf.format({ async = false, timeout_ms = 1000 })
end,
group = vim.api.nvim_create_augroup("lsp_format", { clear = true }),
desc = "Auto format code on save",
})
end
else
-- HACK: Support for <0.8
lsp_keymap("f", "<cmd>lua vim.lsp.buf.formatting()<CR>", { desc = "Format code" })
lsp_keymap(
"f",
"<cmd>lua vim.lsp.buf.range_formatting()<CR>",
{ mode = "v", desc = "Format selected code" }
)
if server_capabilities.documentFormattingProvider then
vim.cmd([[
augroup lsp_format
autocmd!
autocmd BufWritePre lua vim.lsp.buf.formatting_sync(nil, 1000)
augroup END
]])
end
end
-- Set autocommands conditional on server_capabilities
if server_capabilities.documentHighlightProvider then
vim.cmd([[
:highlight link LspReferenceRead MatchParen
:highlight link LspReferenceText MatchParen
:highlight link LspReferenceWrite MatchParen
augroup lsp_document_highlight
autocmd!
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]])
end
-- Some override some fuzzy finder bindings to use lsp sources
if utils.try_require("telescope") ~= nil then
-- Replace some Telescope bindings with LSP versions
local telescope_keymap = utils.curry_keymap("n", "<leader>f", { buffer = bufnr })
if server_capabilities.documentSymbolProvider then
telescope_keymap("t", "<cmd>Telescope lsp_document_symbols<CR>", { desc = "Find buffer tags" })
end
if server_capabilities.workspaceSymbolProvider then
telescope_keymap("T", "<cmd>Telescope lsp_dynamic_workspace_symbols<CR>", { desc = "Find tags" })
end
-- Replace some LSP bindings with Telescope ones
if server_capabilities.definitionProvider then
lsp_keymap("d", "<cmd>Telescope lsp_definitions<CR>", { desc = "Find definition" })
end
if server_capabilities.typeDefinitionProvider then
lsp_keymap("t", "<cmd>Telescope lsp_type_definition<CR>", { desc = "Find type definition" })
end
lsp_keymap("i", "<cmd>Telescope lsp_implementations<CR>", { desc = "Find implementations" })
lsp_keymap("r", "<cmd>Telescope lsp_references<CR>", { desc = "Find references" })
lsp_keymap("A", "<cmd>Telescope lsp_code_actions<CR>", { desc = "Select code actions" })
lsp_keymap("A", "<cmd>Telescope lsp_range_code_actions<CR>", { mode = "v", desc = "Select code actions" })
end
-- Attach navic for statusline location
if server_capabilities.documentSymbolProvider then
utils.try_require("nvim-navic", function(navic)
navic.attach(client, bufnr)
end)
end
end
end
local function merged_capabilities()
-- Maybe update capabilities
local capabilities = nil
utils.try_require("cmp-nvim-lsp", function(cmp_nvim_lsp)
capabilities = cmp_nvim_lsp.default_capabilities()
end)
return capabilities
end
function M.config_lsp()
utils.try_require("lspconfig", function(lsp_config)
local capabilities = merged_capabilities()
local default_attach = get_default_attach()
local default_setup = { capabilities = capabilities, on_attach = default_attach }
-- Configure each server
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
if vim.fn.executable("rust-analyzer") == 1 then
-- Prefer rust-tools, if present
utils.try_require("rust-tools", function(rust_tools)
rust_tools.setup({
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({
capabilities = capabilities,
on_attach = default_attach,
settings = {
["rust-analyzer"] = {
cargo = {
features = "all",
},
},
},
})
end)
else
lsp_config.rls.setup({
capabilities = capabilities,
on_attach = default_attach,
})
end
-- Configure neovim dev for when sumneko_lua is installed
utils.try_require("neodev", function(neodev)
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
utils.try_require("mason-lspconfig", function(mason_lspconfig)
-- Get list of servers that are installed but not set up
local already_setup
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, which is required for nvim <0.7.0
already_setup = lsp_config.available_servers()
end
local needs_setup = vim.tbl_filter(function(server)
return not vim.tbl_contains(already_setup, server)
end, mason_lspconfig.get_installed_servers())
-- Setup each server with default config
vim.tbl_map(function(server)
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)
-- Config null-ls after lsps so we can disable for languages that have language servers
require("plugins.null-ls").configure(default_setup)
end)
end
function M.config_lsp_intaller()
utils.try_require("mason", function(mason)
mason.setup()
end)
utils.try_require("mason-lspconfig", function(mason_lspconfig)
mason_lspconfig.setup()
end)
end
return M

View File

@ -0,0 +1,127 @@
local M = {}
local utils = require("utils")
-- Only return interesting ffenc (not utf-8[unix])
function M.custom_ffenc()
local enc = vim.bo.fenc
local format = vim.bo.fileformat
if enc ~= "utf-8" or format ~= "unix" then
return enc .. "[" .. format .. "]"
end
return ""
end
function M.mixed_indent()
local mixed = vim.fn.search([[\v^(\t+ | +\t)]], "nw")
if mixed > 0 then
return "i:" .. mixed
end
local space_indent = vim.fn.search([[\v^ +]], "nw")
local tab_indent = vim.fn.search([[\v^\t+]], "nw")
if tab_indent > 0 and space_indent > 0 then
return "i:" .. require("math").max(tab_indent, space_indent)
end
return ""
end
function M.trailing_whitespace()
local line = vim.fn.search([[\s\+$]], "nw")
if line ~= 0 then
return "tw:" .. line
end
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
if theme_name == nil then
theme_name = "auto"
elseif theme_name:find("wombat") then
theme_name = "wombat"
elseif theme_name == "wombuddy" then
theme_name = "wombat"
end
-- gps / navic
local code_loc = {}
utils.try_require("nvim-gps", function(gps)
gps.setup({
icons = {
["class-name"] = "(c) ",
["function-name"] = "(ƒ) ",
["method-name"] = "(m) ",
["container-name"] = "",
["tag-name"] = "(t) ",
},
})
code_loc = { gps.get_location, cond = gps.is_available }
end)
utils.try_require("nvim-navic", function(navic)
navic.setup({
icons = {
Class = "(c)",
Constant = "(Const)",
Constructor = "cst",
Function = "(f)",
Method = "(m)",
Package = "(p)",
Property = "(pr)",
Struct = "(s)",
Variable = "(v)",
},
})
code_loc = { "navic" }
end)
local diagnostic_plugin = "nvim_diagnostic"
-- HACK: Support for <0.6
if vim.fn.has("nvim-0.6.0") ~= 1 then
diagnostic_plugin = "nvim_lsp"
end
require("lualine").setup({
options = {
theme = theme_name,
icons_enabled = false,
component_separators = { left = "|", right = "|" },
section_separators = { left = "", right = "" },
},
sections = {
lualine_a = {
{
"mode",
fmt = function(str)
return str:sub(1, 1)
end,
},
},
lualine_b = { "FugitiveHead", "diff" },
lualine_c = { { "filename", path = 1 }, code_loc, M.csv_col },
lualine_x = { M.custom_ffenc, "filetype" },
lualine_y = { "progress", "location" },
lualine_z = {
{ "diagnostics", sources = { diagnostic_plugin } },
{ M.mixed_indent, color = { bg = "#de4f1f" } },
{ M.trailing_whitespace, color = { bg = "#de4f1f" } },
},
},
})
end
return M

View File

@ -0,0 +1,11 @@
local utils = require("utils")
require("notify").setup({
icons = {
ERROR = utils.diagnostic_signs.Error,
WARN = utils.diagnostic_signs.Warn,
DEBUG = utils.diagnostic_signs.Hint,
TRACE = utils.diagnostic_signs.Pencil,
INFO = utils.diagnostic_signs.Info,
},
})
vim.notify = require("notify")

View File

@ -0,0 +1,88 @@
local M = {}
local utils = require("utils")
local function disable_formatter_filetypes_for_existing_servers(sources, preserve)
-- Aggregate filetypes with language servers
local server_filetypes = {}
utils.try_require("lspconfig", function(lsp_config)
local available_servers
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, which is required for nvim <0.7.0
available_servers = lsp_config.available_servers()
end
vim.tbl_map(function(server)
if lsp_config[server].filetypes ~= nil then
vim.list_extend(server_filetypes, lsp_config[server].filetypes)
end
end, available_servers)
end)
-- Remove filetypes for formatters I want to preserve
server_filetypes = vim.tbl_filter(function(ft)
return not vim.tbl_contains(preserve or {}, ft)
end, server_filetypes)
local NULL_LS_FORMATTING = require("null-ls").methods.FORMATTING
-- Apply with statement to all filtered formatters to disable filetypes
sources = vim.tbl_map(function(builtin)
if
builtin.method == NULL_LS_FORMATTING
or (type(builtin.method) == "table" and vim.tbl_contains(builtin.method, NULL_LS_FORMATTING))
then
return builtin.with({ disabled_filetypes = server_filetypes })
end
return builtin
end, sources)
return sources
end
function M.configure(options)
utils.try_require("null-ls", function(null_ls)
local sources = {
-- Generic
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
null_ls.builtins.formatting.reorder_python_imports,
null_ls.builtins.formatting.black,
null_ls.builtins.diagnostics.mypy,
-- Go
null_ls.builtins.diagnostics.golangci_lint,
-- 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)
diagnostic.severity = vim.diagnostic.severity.WARN
end,
}),
-- Shell
null_ls.builtins.diagnostics.shellcheck,
-- Lua
null_ls.builtins.diagnostics.luacheck,
null_ls.builtins.formatting.stylua,
-- Docker
null_ls.builtins.diagnostics.hadolint,
}
sources = disable_formatter_filetypes_for_existing_servers(sources, { "python", "lua" })
-- Setup or configure null_ls
options.sources = sources
null_ls.setup(options)
end)
end
return M

View File

@ -0,0 +1,10 @@
vim.g.startify_list_order = {
{ " My Bookmarks" },
"bookmarks",
{ " Most recently used files in the current directory" },
"dir",
{ " Most recently used files" },
"files",
{ " My Sessions" },
"sessions",
}

View File

@ -0,0 +1,67 @@
local function load_extensions()
local utils = require("utils")
require("telescope").load_extension("file_browser")
if utils.is_plugin_loaded("nvim-notify") then
require("telescope").load_extension("notify")
end
end
local function config_telescope()
local actions = require("telescope.actions")
require("telescope").setup({
defaults = {
mappings = {
i = {
["<esc>"] = actions.close,
-- Disable scroll-up to allow clearing prompt
["<C-u>"] = false,
},
},
layout_strategy = "flex",
},
})
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
load_extensions()
end
config_telescope()

View File

@ -0,0 +1,25 @@
local utils = require("utils")
require("todo-comments").setup({
signs = false,
keywords = {
FIX = {
icon = "🩹",
},
TODO = {
icon = utils.diagnostic_signs.Pencil,
},
HACK = {
icon = "🙈",
},
PERF = {
icon = "🚀",
},
NOTE = {
icon = "📓",
},
WARNING = {
icon = utils.diagnostic_signs.Warn,
},
},
})

View File

@ -0,0 +1,47 @@
-- Configures nvim-treesitter
local M = {}
M.ensure_installed = {
"bash",
"css",
"dockerfile",
"fish",
"go",
"gomod",
"html",
"java",
"javascript",
"json",
"kotlin",
"lua",
"make",
"markdown",
"markdown_inline",
"python",
"rust",
"scala",
"toml",
"typescript",
"vim",
"yaml",
}
function M.bootstrap()
require("nvim-treesitter.install").ensure_installed_sync(M.ensure_installed)
end
function M.setup()
require("nvim-treesitter.configs").setup({
incremental_selection = { enable = true },
-- Indent appears to be broken right now
indent = { enable = false },
textobjects = { enable = true },
highlight = {
enable = true,
disable = {},
},
ensure_installed = M.ensure_installed,
})
end
return M

View File

@ -0,0 +1,12 @@
local M = {}
function M.configure()
require("which-key").setup({
triggers_blacklist = {
i = { "j", "k", "`" },
v = { "j", "k" },
},
})
end
return M

270
neovim/lua/utils.lua Normal file
View File

@ -0,0 +1,270 @@
-- luacheck: globals packer_plugins
local M = {}
function M.get_color(synID, what, mode)
return vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID(synID)), what, mode)
end
-- Create an autocmd
-- TODO: Remove this and use nvim_create_autocmd and nvim_create_augroup when dropping .6
function M.autocmd(group, cmds, clear)
clear = clear == nil and false or clear
if type(cmds) == "string" then
cmds = { cmds }
end
vim.cmd("augroup " .. group)
if clear then
vim.cmd([[au!]])
end
for _, cmd in ipairs(cmds) do
vim.cmd("autocmd " .. cmd)
end
vim.cmd([[augroup END]])
end
-- Terminal escape a given string
function M.t(str)
return vim.api.nvim_replace_termcodes(str, true, true, true)
end
-- Get env value or use default, if not present
function M.env_default(name, def)
local val = vim.env[name]
return val == nil and def or val
end
-- Checks to see if a package can be required
function M.can_require(name)
if package.loaded[name] then
return false
else
for _, searcher in ipairs(package.searchers or package.loaders) do
local loader = searcher(name)
if type(loader) == "function" then
package.preload[name] = loader
return true
end
end
return false
end
end
-- Require a package if possible
function M.maybe_require(name)
if M.can_require(name) then
return require(name)
end
return nil
end
-- Require a package and a "_local" suffixed one
function M.require_with_local(name)
-- Local should completely override the versioned module
-- In that case, the local file would probably start with a `require` for the
-- non-local version. This would allow more control but at the cost of a bit
-- of boiler plate
local rmod = require(name)
local lmod = M.maybe_require(name .. "_local")
if lmod ~= nil then
return lmod
end
return rmod
end
-- Returns whether or not packer plugin is loaded
function M.is_plugin_loaded(name)
return _G["packer_plugins"] and _G["packer_plugins"][name] and _G["packer_plugins"][name].loaded
end
-- Try to require something and perform some action if it was found
function M.try_require(name, on_found, on_notfound)
local status, module = pcall(require, name)
if status then
if on_found ~= nil then
on_found(module)
end
return module
else
if on_notfound ~= nil then
on_notfound(name)
end
return nil
end
end
-- Compare sequenced integers used to compare versions. Eg {0, 6, 0}
function M.cmp_versions(a, b)
for i, part_a in pairs(a) do
local part_b = b[i]
if part_b == nil or part_a > part_b then
return 1
elseif part_a < part_b then
return -1
end
end
return 0
end
-- Materializes an iterator into a list
function M.materialize_list(list, iterator)
if iterator == nil then
iterator = list
list = {}
end
for item in iterator do
table.insert(list, item)
end
return list
end
-- Special not actually nil, but to be treated as nil value in some cases
M.nil_val = {}
-- Maps a set of version rules to a value eg. [">=0.5.0"] = "has 0.5.0"
-- If more than one rule matches, the one with the greatest version number is used
function M.map_version_rule(rules)
local v = vim.version()
local current_version = { v and v.major, v and v.minor, v and v.patch }
-- Parse a constraint and version of a string
local parse_rule = function(rule_string)
local cmp, major, minor, patch = string.gmatch(rule_string, "([=<>]+)(%d+).(%d+).(%d+)")()
return cmp, tonumber(major), tonumber(minor), tonumber(patch)
end
-- Checks if a constraint matches the current nvim instance
local matches = function(cmp, major, minor, patch)
local c = M.cmp_versions(current_version, { major, minor, patch })
if c == 1 then
if vim.tbl_contains({ ">", ">=" }, cmp) then
return true
end
elseif c == 0 then
if vim.tbl_contains({ "==", ">=", "<=" }, cmp) then
return true
end
elseif c == -1 then
if vim.tbl_contains({ "<", "<=" }, cmp) then
return true
end
end
return false
end
local latest_version, latest_value = nil, nil
for rule, value in pairs(rules) do
local cmp, major, minor, patch = parse_rule(rule)
if matches(cmp, major, minor, patch) then
-- If the rule matches and the version that it matches is greater than the previous matches, save it
if latest_version == nil or M.cmp_versions({ major, minor, patch }, latest_version) == 1 then
latest_version = { major, minor, patch }
latest_value = value
end
end
end
-- Return highest versioned matched value
if latest_value == M.nil_val then
return nil
end
return latest_value
end
-- Basically the oposite of map
function M.swapped_map(v, func)
func(v)
return func
end
-- Pop from table
function M.tbl_pop(t, key)
local v = t[key]
t[key] = nil
return v
end
-- Calls keymap_set with preferred defaults
function M.keymap_set(mode, lhs, rhs, opts)
opts = vim.tbl_extend("keep", opts, { noremap = true, silent = true })
-- TODO: Remove this check when dropping 0.6 support
if vim.fn.has("nvim-0.7") == 1 then
vim.keymap.set(mode, lhs, rhs, opts)
else
-- Desc is not supported in 0.6
opts["desc"] = nil
if type(mode) ~= "string" then
for _, m in pairs(mode) do
M.keymap_set(m, lhs, rhs, opts)
end
return
end
-- Buffer requires a different function
local buffer = M.tbl_pop(opts, "buffer")
if buffer == nil then
vim.api.nvim_set_keymap(mode, lhs, rhs, opts)
else
vim.api.nvim_buf_set_keymap(buffer, mode, lhs, rhs, opts)
end
end
end
-- Returns a curried function for passing data into vim.keymap.set
function M.curry_keymap(mode, prefix, default_opts)
default_opts = vim.tbl_extend("keep", default_opts or {}, { noremap = true, silent = true })
-- TODO: Remove when dropping 0.6
if vim.fn.has("nvim-0.7") ~= 1 then
-- NOTE: This is incompatible with a lua function on rhs and a bool buffer instead of number
return M.keymap_group(mode, prefix, default_opts)
end
return function(lhs, rhs, opts)
opts = vim.tbl_extend("keep", opts or {}, default_opts)
local opt_mode = M.tbl_pop(opts, "mode")
vim.keymap.set(opt_mode or mode, prefix .. lhs, rhs, opts)
end
end
-- Returns a function used to create keymaps with consistent prefixes
function M.keymap_group(mode, prefix, default_opts)
-- TODO: Remove when dropping 0.6 since curry_keymap exists
return function(lhs, rhs, opts)
opts = opts or default_opts
if opts ~= nil and default_opts ~= nil and opts ~= default_opts then
opts = vim.tbl_extend("keep", opts, default_opts)
end
local opt_mode = M.tbl_pop(opts, "mode")
M.keymap_set(opt_mode or mode, prefix .. lhs, rhs, opts)
end
end
-- Diagnostics signs
M.diagnostic_signs = {
Error = "🔥",
Warn = "⚠️",
Hint = "🤔",
Info = "",
Pencil = "✏️",
}
-- Don't use emoji for Kitty
if vim.env["TERM"] == "xterm-kitty" then
M.diagnostic_signs = {
Error = "🔥",
Warn = "",
Hint = "🤔",
Info = "i",
Pencil = "",
}
end
return M

View File

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

View File

@ -0,0 +1,176 @@
{
"LuaSnip": {
"commit": "500981f"
},
"cmp-buffer": {
"commit": "3022dbc"
},
"cmp-nvim-lsp": {
"commit": "3cf38d9"
},
"cmp-spell": {
"commit": "60584cb"
},
"cmp_luasnip": {
"commit": "b108297"
},
"colorbuddy.vim": {
"commit": "cdb5b06"
},
"dark-notify": {
"commit": "891adc0"
},
"file-line": {
"commit": "67c3590"
},
"friendly-snippets": {
"commit": "49ca2a0"
},
"goyo.vim": {
"commit": "fa0263d"
},
"impatient.nvim": {
"commit": "969f2c5"
},
"limelight.vim": {
"commit": "86aaec1"
},
"lsp_signature.nvim": {
"commit": "17ff7a4"
},
"lualine.nvim": {
"commit": "05d78e9"
},
"lush.nvim": {
"commit": "87e9039"
},
"neodev.nvim": {
"commit": "c120c96"
},
"null-ls.nvim": {
"commit": "4b403d2"
},
"nvim-cmp": {
"commit": "bba6fb6"
},
"nvim-colorizer.lua": {
"commit": "36c610a"
},
"nvim-gps": {
"commit": "f4734df"
},
"nvim-lspconfig": {
"commit": "ea29110"
},
"nvim-notify": {
"commit": "ea9c8ce"
},
"nvim-solarized-lua": {
"commit": "faba49b"
},
"nvim-treesitter": {
"commit": "bc25a6a5"
},
"nvim-treesitter-textobjects": {
"commit": "eca3bf3"
},
"packer.nvim": {
"commit": "1d0cf98"
},
"plenary.nvim": {
"commit": "36aaceb"
},
"popup.nvim": {
"commit": "b7404d3"
},
"rust.vim": {
"commit": "889b9a7"
},
"startuptime.vim": {
"commit": "dfa57f5"
},
"tcomment_vim": {
"commit": "b4930f9"
},
"telescope-file-browser.nvim": {
"commit": "87dfaa9"
},
"telescope.nvim": {
"commit": "d88094f"
},
"todo-comments.nvim": {
"commit": "7b8f174"
},
"tokyonight.nvim": {
"commit": "161114b"
},
"trouble.nvim": {
"commit": "556ef30"
},
"vim-android": {
"commit": "8911f86"
},
"vim-argwrap": {
"commit": "feaba6b"
},
"vim-endwise": {
"commit": "e714ac3"
},
"vim-eunuch": {
"commit": "291ef1f"
},
"vim-forcedotcom": {
"commit": "a30ba7e"
},
"vim-fugitive": {
"commit": "5a24c25"
},
"vim-grepper": {
"commit": "2b93535"
},
"vim-gutentags": {
"commit": "1337b18"
},
"vim-pencil": {
"commit": "6d70438"
},
"vim-polyglot": {
"commit": "bc8a81d3"
},
"vim-repeat": {
"commit": "24afe92"
},
"vim-rsi": {
"commit": "4554063"
},
"vim-startify": {
"commit": "81e36c3"
},
"vim-surround": {
"commit": "3d188ed"
},
"vim-textobj-sentence": {
"commit": "c5dd562"
},
"vim-textobj-user": {
"commit": "41a675d"
},
"vim-togglelist": {
"commit": "48f0d30"
},
"vim-vinegar": {
"commit": "bb1bcdd"
},
"which-key.nvim": {
"commit": "e271c28"
},
"wombat.nvim": {
"commit": "96989b1"
},
"wombat256.vim": {
"commit": "8734ba4"
},
"wombuddy.nvim": {
"commit": "29deb8f"
}
}

View File

@ -0,0 +1,194 @@
{
"LuaSnip": {
"commit": "500981f"
},
"cmp-buffer": {
"commit": "3022dbc"
},
"cmp-nvim-lsp": {
"commit": "44b16d1"
},
"cmp-spell": {
"commit": "32a0867"
},
"cmp_luasnip": {
"commit": "05a9ab2"
},
"colorbuddy.vim": {
"commit": "cdb5b06"
},
"dark-notify": {
"commit": "891adc0"
},
"dressing.nvim": {
"commit": "f16d758"
},
"file-line": {
"commit": "67c3590"
},
"friendly-snippets": {
"commit": "43727c2"
},
"git-scripts.nvim": {
"commit": "2f7c075"
},
"goyo.vim": {
"commit": "fa0263d"
},
"impatient.nvim": {
"commit": "47302af"
},
"limelight.vim": {
"commit": "86aaec1"
},
"lsp_signature.nvim": {
"commit": "1fba8f4"
},
"lualine.nvim": {
"commit": "2248ef2"
},
"lush.nvim": {
"commit": "966aad1"
},
"mason-lspconfig.nvim": {
"commit": "ab640b3"
},
"mason.nvim": {
"commit": "41e75af"
},
"neodev.nvim": {
"commit": "b2881ee"
},
"null-ls.nvim": {
"commit": "6cc5477"
},
"nvim-cmp": {
"commit": "0b751f6"
},
"nvim-colorizer.lua": {
"commit": "36c610a"
},
"nvim-lspconfig": {
"commit": "4834708"
},
"nvim-navic": {
"commit": "0ffa7ff"
},
"nvim-notify": {
"commit": "e4a2022"
},
"nvim-solarized-lua": {
"commit": "7bd46fa"
},
"nvim-treesitter": {
"commit": "4cccb6f4"
},
"nvim-treesitter-textobjects": {
"commit": "8673926"
},
"obsidian.nvim": {
"commit": "0f16bb4"
},
"packer.nvim": {
"commit": "ea0cc3c"
},
"plenary.nvim": {
"commit": "5001291"
},
"popup.nvim": {
"commit": "b7404d3"
},
"rust-tools.nvim": {
"commit": "0cc8ada"
},
"sg.nvim": {
"commit": "4137856"
},
"startuptime.vim": {
"commit": "dfa57f5"
},
"tcomment_vim": {
"commit": "90eaf75"
},
"telescope-file-browser.nvim": {
"commit": "f41675f"
},
"telescope.nvim": {
"commit": "7011eaa"
},
"todo-comments.nvim": {
"commit": "7b8f174"
},
"tokyonight.nvim": {
"commit": "f247ee7"
},
"trouble.nvim": {
"commit": "f1168fe"
},
"vim-android": {
"commit": "26990f9"
},
"vim-argwrap": {
"commit": "b532cb6"
},
"vim-endwise": {
"commit": "e714ac3"
},
"vim-eunuch": {
"commit": "67f3dd3"
},
"vim-forcedotcom": {
"commit": "a30ba7e"
},
"vim-fugitive": {
"commit": "5a24c25"
},
"vim-grepper": {
"commit": "2b93535"
},
"vim-gutentags": {
"commit": "aa47c5e"
},
"vim-pencil": {
"commit": "6d70438"
},
"vim-polyglot": {
"commit": "bc8a81d"
},
"vim-repeat": {
"commit": "24afe92"
},
"vim-rsi": {
"commit": "4554063"
},
"vim-startify": {
"commit": "4e089df"
},
"vim-surround": {
"commit": "3d188ed"
},
"vim-textobj-sentence": {
"commit": "c5dd562"
},
"vim-textobj-user": {
"commit": "41a675d"
},
"vim-togglelist": {
"commit": "48f0d30"
},
"vim-vinegar": {
"commit": "bb1bcdd"
},
"which-key.nvim": {
"commit": "ce741eb"
},
"wombat.nvim": {
"commit": "96989b1"
},
"wombat256.vim": {
"commit": "8734ba4"
},
"wombuddy.nvim": {
"commit": "29deb8f"
}
}

View File

@ -0,0 +1,188 @@
{
"LuaSnip": {
"commit": "51ebb4b"
},
"cmp-buffer": {
"commit": "3022dbc"
},
"cmp-nvim-lsp": {
"commit": "0e6b2ed"
},
"cmp-spell": {
"commit": "60584cb"
},
"cmp_luasnip": {
"commit": "1809552"
},
"colorbuddy.vim": {
"commit": "cdb5b06"
},
"dark-notify": {
"commit": "891adc0"
},
"file-line": {
"commit": "67c3590"
},
"friendly-snippets": {
"commit": "0dd6114"
},
"goyo.vim": {
"commit": "fa0263d"
},
"impatient.nvim": {
"commit": "47302af"
},
"inc-rename.nvim": {
"commit": "fb1b746"
},
"limelight.vim": {
"commit": "86aaec1"
},
"lsp_signature.nvim": {
"commit": "17ff7a4"
},
"lualine.nvim": {
"commit": "05d78e9"
},
"lush.nvim": {
"commit": "fb148c0"
},
"mason-lspconfig.nvim": {
"commit": "f0ce33f"
},
"mason.nvim": {
"commit": "7d7efc7"
},
"neodev.nvim": {
"commit": "358f11c"
},
"null-ls.nvim": {
"commit": "c89333e"
},
"nvim-cmp": {
"commit": "fc0f694"
},
"nvim-colorizer.lua": {
"commit": "36c610a"
},
"nvim-lspconfig": {
"commit": "255e07c"
},
"nvim-navic": {
"commit": "15704c6"
},
"nvim-notify": {
"commit": "f3024b9"
},
"nvim-solarized-lua": {
"commit": "7bd46fa"
},
"nvim-treesitter": {
"commit": "2cbe8a4"
},
"nvim-treesitter-refactor": {
"commit": "65ad2ec"
},
"nvim-treesitter-textobjects": {
"commit": "23e883b"
},
"packer.nvim": {
"commit": "1d0cf98"
},
"plenary.nvim": {
"commit": "499e074"
},
"popup.nvim": {
"commit": "b7404d3"
},
"rust.vim": {
"commit": "889b9a7"
},
"startuptime.vim": {
"commit": "dfa57f5"
},
"tcomment_vim": {
"commit": "b4930f9"
},
"telescope-file-browser.nvim": {
"commit": "6cf29d5"
},
"telescope.nvim": {
"commit": "b79cd6c"
},
"todo-comments.nvim": {
"commit": "09b0b17"
},
"tokyonight.nvim": {
"commit": "161114b"
},
"trouble.nvim": {
"commit": "324c977"
},
"vim-android": {
"commit": "8911f86"
},
"vim-argwrap": {
"commit": "feaba6b"
},
"vim-endwise": {
"commit": "e714ac3"
},
"vim-eunuch": {
"commit": "291ef1f"
},
"vim-forcedotcom": {
"commit": "a30ba7e"
},
"vim-fugitive": {
"commit": "5f0d280"
},
"vim-grepper": {
"commit": "2b93535"
},
"vim-gutentags": {
"commit": "1337b18"
},
"vim-pencil": {
"commit": "6d70438"
},
"vim-polyglot": {
"commit": "bc8a81d"
},
"vim-repeat": {
"commit": "24afe92"
},
"vim-rsi": {
"commit": "4554063"
},
"vim-startify": {
"commit": "81e36c3"
},
"vim-surround": {
"commit": "3d188ed"
},
"vim-textobj-sentence": {
"commit": "c5dd562"
},
"vim-textobj-user": {
"commit": "41a675d"
},
"vim-togglelist": {
"commit": "48f0d30"
},
"vim-vinegar": {
"commit": "bb1bcdd"
},
"which-key.nvim": {
"commit": "e271c28"
},
"wombat.nvim": {
"commit": "96989b1"
},
"wombat256.vim": {
"commit": "8734ba4"
},
"wombuddy.nvim": {
"commit": "29deb8f"
}
}

View File

@ -0,0 +1,203 @@
{
"LuaSnip": {
"commit": "a7a4b46"
},
"cmp-buffer": {
"commit": "3022dbc"
},
"cmp-nvim-lsp": {
"commit": "5af77f5"
},
"cmp-spell": {
"commit": "32a0867"
},
"cmp_luasnip": {
"commit": "05a9ab2"
},
"colorbuddy.vim": {
"commit": "9e96ccd"
},
"dark-notify": {
"commit": "891adc0"
},
"dressing.nvim": {
"commit": "18e5beb"
},
"file-line": {
"commit": "67c3590"
},
"friendly-snippets": {
"commit": "dcd4a58"
},
"git-scripts.nvim": {
"commit": "2f7c075"
},
"goyo.vim": {
"commit": "fa0263d"
},
"inc-rename.nvim": {
"commit": "6f9b5f9"
},
"limelight.vim": {
"commit": "86aaec1"
},
"lsp_signature.nvim": {
"commit": "c6aeb2f"
},
"lualine.nvim": {
"commit": "b5e8bb6"
},
"lush.nvim": {
"commit": "bc12f01"
},
"mason-lspconfig.nvim": {
"commit": "9dfcf20"
},
"mason.nvim": {
"commit": "751b1fc"
},
"neodev.nvim": {
"commit": "ce9a2e8"
},
"null-ls.nvim": {
"commit": "0010ea9"
},
"nvim-cmp": {
"commit": "97dc716"
},
"nvim-colorizer.lua": {
"commit": "36c610a"
},
"nvim-dap": {
"commit": "405df1d"
},
"nvim-dap-python": {
"commit": "66560f0"
},
"nvim-dap-ui": {
"commit": "edfa93f"
},
"nvim-lspconfig": {
"commit": "6e5c78e"
},
"nvim-navic": {
"commit": "8649f69"
},
"nvim-notify": {
"commit": "5371f4b"
},
"nvim-solarized-lua": {
"commit": "d69a263"
},
"nvim-treesitter": {
"commit": "f848872"
},
"nvim-treesitter-textobjects": {
"commit": "d2a4ffc"
},
"obsidian.nvim": {
"commit": "c5c4088"
},
"packer.nvim": {
"commit": "ea0cc3c"
},
"plenary.nvim": {
"commit": "8aad439"
},
"popup.nvim": {
"commit": "b7404d3"
},
"rust-tools.nvim": {
"commit": "6761879"
},
"sg.nvim": {
"commit": "8d7735b"
},
"startuptime.vim": {
"commit": "dfa57f5"
},
"tcomment_vim": {
"commit": "48ab639"
},
"telescope-file-browser.nvim": {
"commit": "5ee5002"
},
"telescope.nvim": {
"commit": "b22e6f6"
},
"todo-comments.nvim": {
"commit": "a7e39ae"
},
"tokyonight.nvim": {
"commit": "9bf9ec5"
},
"trouble.nvim": {
"commit": "b9cf677"
},
"vim-android": {
"commit": "26990f9"
},
"vim-argwrap": {
"commit": "f3e26a5"
},
"vim-endwise": {
"commit": "3719ffd"
},
"vim-eunuch": {
"commit": "8fb3904"
},
"vim-forcedotcom": {
"commit": "a30ba7e"
},
"vim-fugitive": {
"commit": "a83135b"
},
"vim-grepper": {
"commit": "485d349"
},
"vim-gutentags": {
"commit": "aa47c5e"
},
"vim-pencil": {
"commit": "6d70438"
},
"vim-polyglot": {
"commit": "bc8a81d"
},
"vim-repeat": {
"commit": "24afe92"
},
"vim-rsi": {
"commit": "4554063"
},
"vim-startify": {
"commit": "4e089df"
},
"vim-surround": {
"commit": "3d188ed"
},
"vim-textobj-sentence": {
"commit": "c5dd562"
},
"vim-textobj-user": {
"commit": "41a675d"
},
"vim-togglelist": {
"commit": "48f0d30"
},
"vim-vinegar": {
"commit": "bb1bcdd"
},
"which-key.nvim": {
"commit": "4433e5e"
},
"wombat.nvim": {
"commit": "96989b1"
},
"wombat256.vim": {
"commit": "8734ba4"
},
"wombuddy.nvim": {
"commit": "29deb8f"
}
}

11
neovim/plugin/lsp.lua Normal file
View File

@ -0,0 +1,11 @@
local utils = require("utils")
local lsp_config = require("plugins.lsp")
-- Configure my various lsp stuffs
lsp_config.config_lsp_intaller()
lsp_config.config_lsp()
lsp_config.config_lsp_ui()
if utils.is_plugin_loaded("lspsaga.nvim") then
lsp_config.config_lsp_saga()
end

58
neovim/spell/en.utf-8.add Normal file
View File

@ -0,0 +1,58 @@
Fijolek
Cloudflare
Scaleway
Runbook
eg.
Bitwarden
Cloudron
DNS
AWS
Backblaze
S3
app
apps
API
YouTube
Golang
Reddit
mentorship
workflow
refactored
neurodiverse
neurodiversity
impactful
backend
middleware
javascript
NodeJS
TypeScript
frontend
AngularJS
PHP
hackathon
roadmap
Salesforce
CEP
roadmaps
onboarding
CRM
Kotlin
microservice
microservices
Wordpress
async
dequeue
dequeued
JSON
auth
DevOps
Kubernetes
benchmarking
metadata
mentee
trade-off
quo
NDA
MySQL
APIs
on-prem

Binary file not shown.

7
scripts/sort-json.sh Executable file
View File

@ -0,0 +1,7 @@
#! /usr/bin/env bash
set -e
for f in "$@"; do
jq --sort-keys --monochrome-output . "$f" > "$f.tmp"
mv "$f.tmp" "$f"
done

View File

@ -1,118 +1,40 @@
#! /bin/bash
############################
# Vim Settings Setup script by ViViDboarder (Ian)
# http://github.com/ViViDboarder/Vim-Settings
############################
#! /bin/bash
# Try to load .bashrc to load rvm functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
set -ex
# Get current directory for future use in links
VIM_SYNC_DIR=$(dirname $0)
cd $VIM_SYNC_DIR
VIM_SYNC_DIR=$(dirname "$0")
cd "$VIM_SYNC_DIR"
VIM_SYNC_DIR=$(pwd)
# Verify git is installed (although needed to checkout
command -v git >/dev/null 2>&1 || {
echo "Error: git required for install";
exit 1;
}
# Clone vundle if not done already
if [ ! -d ~/.vim/bundle/vundle ]; then
echo "Installing vundle"
mkdir -p ~/.vim/bundle
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
fi
# Vim
[ -d "$HOME/.vim" ] || ln -s "$VIM_SYNC_DIR/vim" "$HOME/.vim"
[ -f "$HOME/.vimrc" ] || ln -s "$VIM_SYNC_DIR/vim/init.vim" "$HOME/.vimrc"
# Make backup and tmp dirs
echo "Building temp and backup dirs"
mkdir -p ~/.vim/backup
mkdir -p ~/.vim/tmp
mkdir -p ~/.vim/doc
# If a .vimrc_sync doesn't exist, link it
if [[ ! ( -f ~/.vimrc_sync ) ]]; then
echo "Linking sync'd vimrc"
ln -s $VIM_SYNC_DIR/vimrc ~/.vimrc_sync
fi
# If a .vim_drpobox dir doesn't exist, link it
if [[ ! ( -d ~/.vim_sync ) ]]; then
echo "Linking sync'd vim runtime"
ln -s $VIM_SYNC_DIR/vim ~/.vim_sync
fi
# if there is no .vimrc file already, make a blank one
if [[ ( ! -f ~/.vimrc ) ]]; then
echo "No ~/.vimrc found, creating one"
touch ~/.vimrc
fi
# if not already sourcing the synced version, source it
if ! ( grep -q 'source ~/.vimrc_sync' ~/.vimrc ); then
echo "Source sync'd vimrc in vimrc"
echo '' >> ~/.vimrc
echo '"import vimrc from synced' >> ~/.vimrc
echo 'source ~/.vimrc_sync' >> ~/.vimrc
fi
if ! ( grep -q 'set runtimepath+=$HOME/.vim_sync' ~/.vimrc ); then
echo "Add sync'd vim dir to runtime"
echo '' >> ~/.vimrc
echo '"add vim directory from synced' >> ~/.vimrc
echo 'set runtimepath+=$HOME/.vim_sync' >> ~/.vimrc
fi
# Neovim
mkdir -p "${XDG_CONFIG_HOME:=$HOME/.config}"
[ -e "$XDG_CONFIG_HOME/nvim" ] || ln -s "$VIM_SYNC_DIR/neovim" "$XDG_CONFIG_HOME/nvim"
# Install all bundles
echo "Install all bundles"
vim +BundleInstall! +qall
echo "Compile vimproc"
cd ~/.vim/bundle/vimproc.vim && make
cd -
# Compile CommandT if possible
# See if ruby is installed
if command -v ruby >/dev/null 2>&1; then
# Make sure GCC is installed
if command -v gcc >/dev/null 2>&1; then
# Use system ruby
command -v rvm >/dev/null 2>&1 && { rvm use system; }
echo "Compile Command T's C extension"
cd ~/.vim/bundle/Command-T/ruby/command-t
ruby extconf.rb
make
fi
if hash nvim 2>/dev/null; then
# Install plugins for old Neovim (<0.5)
nvim --headless -c PlugInstall -c qall
# Install plugins for new Neovim (>0.5)
nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerBootstrap" -c "PackerSync"
nvim --headless -c "lua require('plugins.treesitter').bootstrap()" -c quitall
nvim --headless -c "TSUpdateSync" -c "quitall"
fi
if hash vim 2>/dev/null; then
vim +PlugInstall +qall
fi
# Display warning methods related to Command T
vim --version | grep -q '\+ruby' || { echo "Warning: Default vim does not include ruby as needed for Command T"; }
command -v ruby >/dev/null 2>&1 || { echo "Warning: ruby required for Command T"; }
command -v gcc >/dev/null 2>&1 || { echo "Warning: gcc required for Command T"; }
# Execute vim's update of the helptags
VIM_RESULT=$(vim +"helptags ~/.vim/doc" +"q")
if [[ "$VIM_RESULT" == *SEGV* ]]; then
echo "Seg Faulted. Retry with different ruby"
cd ~/.vim/bundle/Command-T/ruby/command-t && /opt/local/bin/ruby* extconf.rb && make && cd -
# Retry
vim +"helptags ~/.vim/doc" +"q"
fi
# Warn if ctags does not exist
command -v ctags >/dev/null 2>&1 || { echo "Warning: ctags required for Tag List
--- Debian: apt-get install ctags
--- OSX (MacPorts): port install ctags"; }
echo "Note: If VIM Segfaults try the following:"
echo " cd ~/.vim/bundle/Command-T/ruby/command-t && /opt/local/bin/ruby* extconf.rb && make && cd -"
echo ""
echo "All done!"
exit 0

View File

@ -2,7 +2,7 @@ function! GetJavaIndent_improved()
let theIndent = GetJavaIndent()
let lnum = prevnonblank(v:lnum - 1)
let line = getline(lnum)
if line =~ '^\s*@.*$'
if line =~? '^\s*@.*$'
let theIndent = indent(lnum)
endif

0
vim/autoload/.gitkeep Normal file
View File

0
vim/backup/.gitkeep Normal file
View File

8
vim/ftplugin/fish.vim Normal file
View File

@ -0,0 +1,8 @@
" Set up :make to use fish for syntax checking.
compiler fish
" Set this to have long lines wrap inside comments.
setlocal textwidth=79
" Enable folding of block structures in fish.
setlocal foldmethod=expr

9
vim/ftplugin/go.vim Normal file
View File

@ -0,0 +1,9 @@
let g:argwrap_tail_comma = 1
let g:ale_fix_on_save = 1
" Disable some vim-go settings when Ale is installed
if exists('g:ale_fixers')
let g:go_def_mapping_enabled = 0
let g:go_version_warning = 0
let g:go_fmt_autosave = 0
let g:go_imports_autosave = 0
end

View File

@ -0,0 +1,5 @@
" Set Markdown indent to 2 so single indented text doesn't become 'code'
set shiftwidth=2
" From plasticboy/vim-markdown via sheerun/vim-polyglot
let g:vim_markdown_new_list_item_indent = 0

1
vim/ftplugin/python.vim Normal file
View File

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

2
vim/ftplugin/yaml.vim Normal file
View File

@ -0,0 +1,2 @@
" Set YAML indent to 2 because list objects are weird otherwise
set shiftwidth=2

69
vim/init.vim Normal file
View File

@ -0,0 +1,69 @@
" A lot of inspiration from Shougo
" Note: Skip initialization for vim-tiny or vim-small.
if !1 | finish | endif
" Don't use fish as the default shell. This makes things weird
if &shell =~# 'fish$'
set shell=bash
endif
" Don't use sh if we have bash
if &shell =~# '/sh$' || &shell =~# '^sh$' && executable('bash')
set shell=bash
endif
function! s:smart_source_rc(name)
call s:source_rc(a:name . '.rc.vim')
call s:source_rc(a:name . '.local.rc.vim')
endfunction
function! s:source_rc(path)
let l:f_path = fnameescape(expand('~/.vim/rc/' . a:path))
if filereadable(l:f_path)
execute 'source' . l:f_path
endif
endfunction
let s:is_windows = has('win16') || has('win32') || has('win64')
let s:is_cygwin = has('win32unix')
let s:is_sudo = $SUDO_USER !=# '' && $USER !=# $SUDO_USER
\ && $HOME !=# expand('~'.$USER)
\ && $HOME ==# expand('~'.$SUDO_USER)
" IsWindows determines if this instances is running on Windows
function! IsWindows()
return s:is_windows
endfunction
" IsMac determines if this instance is running on macOS
function! IsMac()
return !s:is_windows && !s:is_cygwin
\ && (has('mac') || has('macunix') || has('gui_macvim') ||
\ (!executable('xdg-open') &&
\ system('uname') =~? '^darwin'))
endfunction
" IsGuiApp determines if (n)vim is running in a GUI
function! IsGuiApp()
return has('gui_running') || exists('neovim_dot_app')
\ || has('gui_win32') || has('gui_macvim')
\ || has('gui_vimr') || exists('g:gui_oni')
endfunction
" Auto install vim-plug
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
augroup pluginstall
autocmd VimEnter * PlugInstall
augroup end
endif
call s:smart_source_rc('init')
call s:smart_source_rc('input')
call plug#begin()
call s:smart_source_rc('plugins')
call plug#end()
call s:smart_source_rc('ui')

20
vim/rc/init.rc.vim Normal file
View File

@ -0,0 +1,20 @@
"Allows filetype detection
filetype on
filetype plugin indent on
" Set backup dirs
set backup
if has('nvim')
set backupdir=~/.config/nvim/backup
set directory=~/.config/nvim/tmp
set viminfo='100,n~/.config/nvim/tmp/viminfo.nvim
else
set backupdir=~/.vim/backup
set directory=~/.vim/tmp
set viminfo='100,n~/.vim/tmp/viminfo.vim
endif
" Filetype extension overrides
augroup syntax_overrides
au BufRead,BufNewFile *.md set syntax=markdown
augroup end

156
vim/rc/input.rc.vim Normal file
View File

@ -0,0 +1,156 @@
" Tab functionality
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set autoindent
" Ensure backspace actually works
set backspace=2
"
" allow for cursor beyond last character
set virtualedit=onemore
" lines to scroll when cursor leaves screen
set scrolljump=5
" minimum lines to keep above and below cursor
set scrolloff=3
" Enable mouse input
set mousehide
set mouse=a
" Use more convenient leader
let mapleader="\<Space>"
" Remap jk to esc
inoremap jk <esc>
" Easy esc on TEX Yoda
inoremap `` <esc>
vnoremap `` <esc>
" Change Working Directory to that of the current file
cmap cwd lcd %:p:h
cmap cd. lcd %:p:h
" Bind Make to F5 like other IDEs
nnoremap <F5> :make<CR>
" Ctrl-Space for omnicompletions
inoremap <C-Space> <C-n>
inoremap <Nul> <C-n>
inoremap <silent><expr> <C-Space> pumvisible() \|\| &omnifunc == '' ?
\ "\<lt>C-n>" :
\ "\<lt>C-x>\<lt>C-o><c-r>=pumvisible() ?" .
\ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" .
\ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>"
imap <C-@> <C-Space>
" Enable preview window
set completeopt+=preview
augroup close_docs
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
augroup end
" Toggle highlighting with \hr (highlight row)
nnoremap <leader>hr :set cursorline!<CR>
" Toggle Line numbers with Ctrl+N double tap
nmap <C-N><C-N> :set invnumber<CR>
nmap <leader>ln :set invnumber<CR>
" Toggle line wrap with Ctrl+L double tap
nmap <C-L><C-L> :set wrap!<CR>
nmap <leader>lw :set wrap!<CR>
" Toggle White Space
nmap <leader>ws :set list!<CR>
" Map Shift+U to redo
nnoremap <S-u> <C-r>
" Stupid shift key fixes
cmap WQ<CR> wq<CR>
cmap Wq<CR> wq<CR>
cmap W<CR> w<CR>
cmap Q<CR> q<CR>
cmap Q!<CR> q!<CR>
cmap Qa<CR> qa<CR>
cmap Qa!<CR> qa!<CR>
cmap QA<CR> qa<CR>
cmap QA!<CR> qa!<CR>
" Stupid semicolon files
cnoremap w; w
cnoremap W; w
cnoremap q; q
cnoremap Q; q
" Avoid accidental Ex-mode
:map Q <Nop>
" Clearing highlighted search
nmap <silent> <leader>/ :set hlsearch! hlsearch?<CR>
" Clear search
nmap <silent> <leader>cs :nohlsearch<CR>
" Code fold
nmap <leader>cf va{<ESC>zf%<ESC>:nohlsearch<CR>
" Paste over
vnoremap pp p
vnoremap po "_dP
" Terminal mode
" Make switching to normal mode a bit easier
if has('nvim') || has('terminal')
tnoremap <c-W><esc> <c-W>N
endif
if has('nvim')
" Add bash related term commands
command Bash e term://bash
command VBash vsp term://bash
command SBash sp term://bash
command TBash tabedit term://bash
" Add fish related term commands
command Fish e term://fish
command VFish vsp term://fish
command SFish sp term://fish
command TFish tabedit term://fish
elseif has('terminal')
" Add bash related term commands
command Bash :terminal ++curwin bash
command VBash vsp|:terminal ++curwin bash
command SBash sp|:terminal ++curwin bash
command TBash tabedit|:terminal ++curwin bash
" Add fish related term commands
command Fish :terminal ++curwin fish
command VFish vsp|:terminal ++curwin fish
command SFish sp|:terminal ++curwin fish
command TFish tabedit|:terminal ++curwin fish
endif
" Buffer nav
nmap gb :bn<CR>
nmap gB :bp<CR>
" Command to display TODO tags in project
" Generally, this is overriden in vim-grepper
command Todo grep TODO
" Easy update tags
" Generally this is overriden by Gutentags
command TagsUpdate !ctags -R .
" Set grepprg
if executable('rg')
set grepprg=rg\ --vimgrep\ --no-heading\ --color=never
set grepformat=%f:%l:%c:%m,%f:%l:%m
elseif executable('ag')
set grepprg=ag\ --vimgrep\ --nogroup\ --nocolor
elseif executable('ack')
set grepprg=ack
endif
" Easily toggle spelling
command Spell setlocal spell! spelllang=en_us
" Pop spell completion word under cursor
nmap <leader>s viw<esc>a<c-x>s

View File

@ -0,0 +1,45 @@
" Generated by vim-plug
" Wed Jun 8 19:46:26 2022
" :source this file in vim to restore the snapshot
" or execute: vim -S snapshot.vim
silent! let g:plugs['MatchTag'].commit = 'f190ed0744a02197a87f25c2f6c1e108d2aaf650'
silent! let g:plugs['SimpylFold'].commit = 'ff4c85197c5555715093c08a8d4f9d493c4d80cd'
silent! let g:plugs['ale'].commit = 'f10349b48b173d50b523ce009934bb4bfba04f7f'
silent! let g:plugs['coveragepy.vim'].commit = 'afcef301b723048c25250d2d539b9473a8e4f747'
silent! let g:plugs['dash.vim'].commit = '25b17d9488454a1fcdbb2cbe829a23226f95e3c2'
silent! let g:plugs['file-line'].commit = '67c3590b25703444663edcd4188991147b1bc846'
silent! let g:plugs['force-vim'].commit = '69d9f6855e708462f23efe74fb36ec162e930162'
silent! let g:plugs['fzf'].commit = '3b7a962dc6db227d18faecb25c793431ce7e8640'
silent! let g:plugs['fzf.vim'].commit = 'd5f1f8641b24c0fd5b10a299824362a2a1b20ae0'
silent! let g:plugs['goyo.vim'].commit = 'a9c7283dce60ffcdec952384f6451ff42f8914f2'
silent! let g:plugs['limelight.vim'].commit = 'eebac6c4fce06d3b849cccd213b7233d37ab037f'
silent! let g:plugs['pytest.vim'].commit = 'e7ea3599803cb60861c27ac93f6e00cfe3e54826'
silent! let g:plugs['rust.vim'].commit = '4aa69b84c8a58fcec6b6dad6fe244b916b1cf830'
silent! let g:plugs['tabular'].commit = '339091ac4dd1f17e225fe7d57b48aff55f99b23a'
silent! let g:plugs['tagbar'].commit = 'a577ee4d650476243d91698f2d1228819c5fa0a5'
silent! let g:plugs['tcomment_vim'].commit = '7fb091aad8d824bef1d7bc9365921c65e26d82ad'
silent! let g:plugs['tmuxline.vim'].commit = '4119c553923212cc67f4e135e6f946dc3ec0a4d6'
silent! let g:plugs['vim-abolish'].commit = '3f0c8faadf0c5b68bcf40785c1c42e3731bfa522'
silent! let g:plugs['vim-airline'].commit = '97a9aa4bdb24eea5e85ac0015bdd570f42bad6e7'
silent! let g:plugs['vim-airline-themes'].commit = '97cf3e6e638f936187d5f6e9b5eb1bdf0a4df256'
silent! let g:plugs['vim-android'].commit = 'b8b684f60a26a7208771fc39cbeb6a6421a19ea2'
silent! let g:plugs['vim-argwrap'].commit = '0faba07179f96cae2ab49cf2cc22ebeb922c1532'
silent! let g:plugs['vim-colors-solarized'].commit = '528a59f26d12278698bb946f8fb82a63711eec21'
silent! let g:plugs['vim-endwise'].commit = '4ed852d137853a0c242846fd0a61a241b4c7b467'
silent! let g:plugs['vim-eunuch'].commit = '39e0232f490322c5a2d9e24275872f28da496a93'
silent! let g:plugs['vim-forcedotcom'].commit = 'a30ba7e7f6a3fc2a7cd7ed8f4d7188b42fc52264'
silent! let g:plugs['vim-fugitive'].commit = '92c73bb0507338441733198d630a1fe5e7fdac3a'
silent! let g:plugs['vim-gitgutter'].commit = 'ded11946c04aeab5526f869174044019ae9e3c32'
silent! let g:plugs['vim-go'].commit = 'd34c629b852cd4a308606791ca8a809cd8490886'
silent! let g:plugs['vim-grepper'].commit = '2b93535752ffcb312f9fab73d90e80dc9f2e60fc'
silent! let g:plugs['vim-gutentags'].commit = 'b77b8fabcb0b052c32fe17efcc0d44f020975244'
silent! let g:plugs['vim-polyglot'].commit = '38282d58387cff48ac203f6912c05e4c8686141b'
silent! let g:plugs['vim-repeat'].commit = '24afe922e6a05891756ecf331f39a1f6743d3d5a'
silent! let g:plugs['vim-rsi'].commit = 'e181883a0932d9315cceb96b5fffb5e2ec67068e'
silent! let g:plugs['vim-startify'].commit = '81e36c352a8deea54df5ec1e2f4348685569bed2'
silent! let g:plugs['vim-surround'].commit = 'bf3480dc9ae7bea34c78fbba4c65b4548b5b1fea'
silent! let g:plugs['vim-togglelist'].commit = '48f0d30292efdf20edc883e61b121e6123e03df7'
silent! let g:plugs['vim-tsv'].commit = '116058ad99ca4d72d0fc91bb0738c2c6044d3f46'
silent! let g:plugs['vim-vinegar'].commit = 'bb1bcddf43cfebe05eb565a84ab069b357d0b3d6'
silent! let g:plugs['wombat256.vim'].commit = '8734ba45dcf5e38c4d2686b35c94f9fcb30427e2'

139
vim/rc/plugins.rc.vim Normal file
View File

@ -0,0 +1,139 @@
" Functions {{
function! s:smart_source_rc(name)
call s:source_rc(a:name . '.rc.vim')
call s:source_rc(a:name . '.local.rc.vim')
endfunction
function! s:source_rc(path)
let l:f_path = fnameescape(expand('~/.vim/rc/' . a:path))
if filereadable(l:f_path)
execute 'source' . l:f_path
endif
endfunction
" }} Functions
" General
Plug 'godlygeek/tabular' " Tabular spacing
Plug 'gregsexton/MatchTag'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-rsi'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-vinegar'
Plug 'vim-scripts/file-line'
call s:smart_source_rc('plugins/airline')
call s:smart_source_rc('plugins/startify')
call s:smart_source_rc('plugins/goyo-limelight')
Plug 'milkypostman/vim-togglelist'
nnoremap <silent> <F6> :call ToggleQuickfixList()<CR>
nnoremap <silent> <F7> :call ToggleLocationList()<CR>
" Plug 'edkolev/tmuxline.vim' " Removed because this can fail on some machines
" let g:tmuxline_powerline_separators = 0
" Searching
if !executable('fzf')
call s:smart_source_rc('plugins/ctrlp')
endif
call s:smart_source_rc('plugins/fzf')
call s:smart_source_rc('plugins/vim-grepper')
" Git / Version control
call s:smart_source_rc('plugins/fugitive')
call s:smart_source_rc('plugins/gitgutter')
" Programming
Plug 'FooSoft/vim-argwrap'
nnoremap <silent> <leader>a :ArgWrap<CR>
Plug 'tomtom/tcomment_vim', { 'on': ['TComment', 'TCommentBlock'] }
nnoremap // :TComment<CR>
vnoremap // :TCommentBlock<CR>
Plug 'rizzatti/dash.vim', { 'on': 'DashSearch' }
nmap <silent> <leader>d <Plug>DashSearch
let g:dash_map = { 'apex' : 'apex', 'visualforce' : 'vf' }
" IDE stuff
" let l:is_vim8 = v:version >= 8
" let l:is_nvim = has('nvim')
" let l:is_nvim_5 = has('nvim-0.5')
" Lint and completion
if has('nvim') || v:version >= 800
" let g:ale_completion_enabled = 1
call s:smart_source_rc('plugins/ale')
set omnifunc=ale#completion#OmniFunc
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~? '\s'
endfunction
" " Enable asyncomplete
" Plug 'prabirshrestha/asyncomplete.vim'
" " Add ALE to asyncomplete
" augroup acomp_setup
" au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#ale#get_source_options({
" \ 'priority': 10,
" \ }))
" au CompleteDone * if pumvisible() == 0 | pclose | endif
" augroup end
"
" let g:asyncomplete_auto_popup = 0
" " Make asyncomplete manually triggered
" inoremap <silent><expr> <C-Space>
" \ pumvisible() ? "\<C-n>" :
" \ <SID>check_back_space() ? "\<TAB>" :
" \ asyncomplete#force_refresh()
"
set completeopt+=preview
imap <silent> <C-Space> <Plug>(ale_complete)
" inoremap <silent><expr> <C-Space>
" \ pumvisible() ? "\<C-n>" :
" \ <SID>check_back_space() ? "\<TAB>" :
" \ <Plug>(ale_complete)
end
" Programming Tag navigation
call s:smart_source_rc('plugins/tagbar')
Plug 'ludovicchabant/vim-gutentags'
command! TagsUpdate :GutentagsUpdate
" Filetype configuration
" Languages with custom configuration
" Custom Go
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
" Custom rust
let g:rustfmt_autosave = 1
Plug 'rust-lang/rust.vim'
" Lots of custom python
call s:smart_source_rc('plugins/python')
" Disable polyglot for languages with more robust plugins
let g:polyglot_disabled = ['go', 'rust']
Plug 'sheerun/vim-polyglot'
" Custom rule for ansible playbook detection
augroup ansible_playbook
au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible
au BufRead,BufNewFile */playbooks/*.yaml set filetype=yaml.ansible
augroup end
" Languages not in polyglot
Plug 'ViViDboarder/force-vim', { 'for': ['apex', 'visualforce'] }
Plug 'ViViDboarder/vim-forcedotcom'
Plug 'hsanson/vim-android'
Plug 'pdurbin/vim-tsv'
" }}
" Themes
Plug 'altercation/vim-colors-solarized'
Plug 'vim-scripts/wombat256.vim'
" Saving and loading specific versions of plugins
call s:source_rc('plug-snapshot.rc.vim')
function! s:save_snapshot()
let l:f_path = fnameescape(expand('~/.vim/rc/plug-snapshot.rc.vim'))
execute 'PlugSnapshot!' . l:f_path
endfunction
command! SavePlugSnapshot call s:save_snapshot()

View File

@ -0,0 +1,34 @@
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Use short-form mode text
let g:airline_mode_map = {
\ '__' : '-',
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'c' : 'C',
\ 'v' : 'V',
\ 'V' : 'V',
\ '' : 'V',
\ 's' : 'S',
\ 'S' : 'S',
\ '' : 'S',
\ 't' : 'T',
\ }
" abbreviate trailing whitespace and mixed indent
let g:airline#extensions#whitespace#trailing_format = 'tw[%s]'
let g:airline#extensions#whitespace#mixed_indent_format = 'i[%s]'
" Vertical separators for all
let g:airline_left_sep=''
let g:airline_left_alt_sep=''
let g:airline_right_sep=''
let g:airline_right_alt_sep=''
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
" Slimmer section z
let g:airline_section_z = '%2l/%L:%2v'
" Skip most common encoding
let g:airline#parts#ffenc#skip_expected_string='utf-8[unix]'
" If UTF-8 symbols don't work, use ASCII
" let g:airline_symbols_ascii = 1

43
vim/rc/plugins/ale.rc.vim Normal file
View File

@ -0,0 +1,43 @@
" Install ALE
Plug 'dense-analysis/ale'
let g:airline#extensions#ale#enabled = 1
" Speed up first load time for quick editing
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': ['pyright', 'mypy'],
\ 'rust': ['rls', 'cargo'],
\ 'sh': ['language_server', 'shell', 'shellcheck'],
\ 'text': ['proselint', 'alex'],
\}
let g:ale_linter_aliases = {
\ 'markdown': ['text'],
\}
" More than a few languages use the same fixers
let s:ale_pretty_trim_fixer = ['prettier', 'trim_whitespace', 'remove_trailing_lines']
let g:ale_fixers = {
\ '*': ['trim_whitespace', 'remove_trailing_lines'],
\ 'go': ['gofmt', 'goimports'],
\ 'json': s:ale_pretty_trim_fixer,
\ 'rust': ['rustfmt'],
\ 'python': [ 'black', 'autopep8', 'reorder-python-imports', 'remove_trailing_lines', 'trim_whitespace'],
\ 'markdown': s:ale_pretty_trim_fixer,
\ 'yaml': ['prettier', 'remove_trailing_lines'],
\ 'css': s:ale_pretty_trim_fixer,
\ 'javascript': s:ale_pretty_trim_fixer,
\}
" Language specific options
let g:ale_python_flake8_options = '--max-line-length 88'
let g:ale_go_golangci_lint_options = ''
let g:ale_go_golangci_lint_package = 1
let g:ale_rust_cargo_use_clippy = 1
let g:ale_rust_rls_config = {
\ 'rust': {
\ 'clippy_preference': 'on'
\ }
\ }
" Create shortcut for ALEFix
nnoremap <F4> :ALEFix<CR>

View File

@ -0,0 +1,53 @@
Plug 'ctrlpvim/ctrlp.vim'
" Configuration for ctrlp.vim
let g:ctrlp_in_use = 1
" Ensure max height isn't too large. (for performance)
let g:ctrlp_max_height = 10
" Conditional Mappings
let g:ctrlp_map = '<C-t>'
" Allow ctrl p to open over startify
let g:ctrlp_reuse_window = 'startify'
" Support tag jumping
let g:ctrlp_extensions = ['tag', 'buffertag']
" Don't search right away
let g:ctrlp_lazy_update = 50
" Quick exiting with <bs>
let g:ctrlp_brief_prompt = 1
" Support golang tags
let g:ctrlp_buftag_types = {
\ 'go' : {
\ 'bin' : 'gotags',
\ 'args' : '-sort -silent',
\}
\}
" When using slow built in search, limit max depth
let g:ctrlp_max_depth = 4
" When using slow built in search, limit max files
let g:ctrlp_max_files = 1000
" Use git ls-files when in a git project
let g:ctrlp_user_command = {
\ 'types': {
\ 1: ['.git', 'cd %s && git ls-files'],
\}
\}
" Leader Commands
nnoremap <leader>b :CtrlPBuffer<CR>
nnoremap <leader>m :CtrlPMRUFiles<CR>
nnoremap <leader>p :CtrlP<CR>
nnoremap <leader>r :CtrlPTag<CR>
nnoremap <leader>t :CtrlPBufTag<CR>
nnoremap <leader>u :CtrlPCurFile<CR>
nnoremap <silent> <F2> :CtrlPBuffer<CR>
" Use custom search command
if executable('rg')
let g:ctrlp_user_command['fallback'] = 'rg %s --files --color=never --glob ""'
" rg is fast enough we don't need cache
let g:ctrlp_use_caching = 0
elseif executable('ag')
let g:ctrlp_user_command['fallback'] = 'ag %s -l --depth 5 --nocolor --nogroup -g ""'
" ag is fast enough we don't need cache
let g:ctrlp_use_caching = 0
endif

View File

@ -0,0 +1,7 @@
Plug 'tpope/vim-fugitive' ", { 'on': ['Git'] }
" Mappings
nnoremap <leader>gb :Git blame<CR>
nnoremap <leader>gc :Git commit<CR>
nnoremap <leader>gd :Git diff<CR>
nnoremap <leader>gs :Git status<CR>
nnoremap <leader>gw :Git write<CR>

42
vim/rc/plugins/fzf.rc.vim Normal file
View File

@ -0,0 +1,42 @@
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install' }
Plug 'junegunn/fzf.vim'
let g:fzf_command_prefix = 'FZF'
" Jump to existing window if possible
let g:fzf_buffers_jump = 1
" Override key commands
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-s': 'split',
\ 'ctrl-v': 'vsplit' }
" Override git log to show authors
let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h %an: %s%d %C(black)%C(bold)%cr"'
" Override BTags to attempt to include gotags as well
command! -bang -nargs=* FZFBTags
\ if &filetype == 'go'
\| call fzf#vim#buffer_tags(<q-args>, printf('gotags -silent -sort %s | sed /^!_TAG_/d', shellescape(expand('%'))), <bang>0)
\| else
\| call fzf#vim#buffer_tags(<q-args>, <bang>0)
\| endif
" If no CtrlP, use FZF bindings
if !exists('g:ctrlp_in_use')
" Ctrl-T to launch standard file search
nnoremap <C-t> :FZF<CR>
" Leader Commands
" Find buffers
nnoremap <leader>b :FZFBuffers<CR>
nnoremap <silent> <F2> :FZFBuffers<CR>
" Find text in files
if executable('rg')
nnoremap <leader>f :FZFRg<CR>
elseif executable('ag')
nnoremap <leader>f :FZFAg<CR>
endif
" Find tags
nnoremap <leader>r :FZFTags<CR>
" Find buffer tags
nnoremap <leader>t :FZFBTags<CR>
" Find git history for buffer
nnoremap <leader>g :FZFBCommits<CR>
endif

View File

@ -0,0 +1,12 @@
Plug 'airblade/vim-gitgutter', { 'on': ['GitGutterSignsToggle'] }
" Settings to keep gitgutter fast
let g:gitgutter_enabled = 1
" Will toggle signs when I want them
let g:gitgutter_signs = 0
" Already using Fugitive, don't need more mappings
let g:gitgutter_map_keys = 0
" Make it more passive
let g:gitgutter_eager = 0
let g:gitgutter_realtime = 0
" Quick leader command to toggle git-gutter
nmap <leader>gg :GitGutterSignsToggle<CR>

View File

@ -0,0 +1,19 @@
" Both these plugins work well together for distraction free editing
Plug 'junegunn/goyo.vim', { 'on': 'Goyo' }
Plug 'junegunn/limelight.vim', { 'on': 'Limelight' }
let g:goyo_width = 120
command Zen :Goyo
function! s:goyo_enter()
Limelight
endfunction
function! s:goyo_leave()
Limelight!
endfunction
augroup zenevents
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
augroup end

View File

@ -0,0 +1,8 @@
augroup ftomni
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=jedi#completions
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
augroup end

View File

@ -0,0 +1,7 @@
" All Python plugins and settings
Plug 'alfredodeza/coveragepy.vim', { 'for': 'python' }
Plug 'alfredodeza/pytest.vim', { 'for': 'python' }
Plug 'tmhedberg/SimpylFold', { 'for': 'python' }
nmap <silent><leader>ptp <Esc>:Pytest project<CR>
nmap <silent><leader>ptf <Esc>:Pytest file<CR>
nmap <silent><leader>ptm <Esc>:Pytest method<CR>

View File

@ -0,0 +1,15 @@
Plug 'mhinz/vim-startify'
let g:startify_list_order = [
\ [' My Bookmarks'], 'bookmarks',
\ [' Most recently used files in the current directory'], 'dir',
\ [' Most recently used files'], 'files',
\ [' My Sessions'], 'sessions'
\ ]
" Override in local rc
" let g:startify_bookmarks = [
" \ '~/.vim',
" \ '~/workspace/my-shoestrap'
" \ ]
" let g:startify_custom_header =
" \ map(split(system('fortune | cowsay'), '\n'), '" ". v:val') + ['','']

View File

@ -0,0 +1,3 @@
Plug 'majutsushi/tagbar', { 'on': 'TagbarToggle' }
nnoremap <silent> <F8> :TagbarToggle<CR>
let g:tagbar_autofocus = 1 " Autofocus tagbar

View File

@ -0,0 +1,27 @@
Plug 'mhinz/vim-grepper'
" Grepper settings and shortcuts
let g:grepper = {
\ 'quickfix': 1,
\ 'open': 1,
\ 'switch': 0,
\ 'jump': 0,
\ 'tools': ['git', 'rg', 'ag', 'ack', 'pt', 'grep'],
\ 'dir': 'repo,cwd'
\ }
nmap gs <plug>(GrepperOperator)
xmap gs <plug>(GrepperOperator)
nmap <leader>* :Grepper -cword -noprompt<cr>
" Override Todo command to use Grepper
command! Todo :Grepper -noprompt -query TODO
" Make some shortands for various grep programs
if executable('rg')
command -nargs=+ Rg :GrepperRg <args>
endif
if executable('ag')
command -nargs=+ Ag :GrepperAg <args>
endif
if executable('ack')
command -nargs=+ Ack :GrepperAck <args>
endif

126
vim/rc/ui.rc.vim Normal file
View File

@ -0,0 +1,126 @@
" Add encoding for multibyte chars
scriptencoding utf-8
" Display filename at bottom of window
set laststatus=2
"enable line numbers
set number
" Highlights the line the cursor is on
set cursorline
:hi CursorLine cterm=NONE ctermbg=darkred guibg=darkred guifg=white
" Syntax Hightlighting
syntax on
" Enable search highlighting
set hlsearch
" Set fonts for gui apps {{
if IsGuiApp()
if IsWindows()
set guifont=Consolas:h10:b
elseif IsMac()
try
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h12
catch
" Failed to set font, ok with default
endtry
endif
endif
" }}
" Color Schemes {{
" Set a default color scheme to use
let g:default_color = 'wombat256mod'
" Gets the value of an env or returns a default
function! s:val_default(env, default)
return !empty(a:env) ? a:env : a:default
endfunction
" Get color schemes from env variables
let s:env_color = s:val_default($VIM_COLOR, g:default_color)
let s:env_color_light = s:val_default($VIM_COLOR_LIGHT, s:env_color)
let s:env_color_dark = s:val_default($VIM_COLOR_DARK, s:env_color)
" Override colors for gui apps
if IsGuiApp()
let g:default_color = 'solarized'
let s:env_color = 'solarized'
let s:env_color_light = 'solarized'
let s:env_color_dark = 'solarized'
endif
" Set the colorscheme if it's different than the current
function! s:maybe_set_color(colorscheme_name)
" On some versions of vim, g:colors_name doesn't seem to exist on start
if !exists('g:colors_name') || g:colors_name !=# a:colorscheme_name
execute 'colorscheme ' . a:colorscheme_name
endif
endfunction
" Function and command to update colors based on light and dark mode
function! UpdateColors()
" Detect using an env variable
let cmd = 'echo $IS_DARKMODE'
" On macOS we can do something a bit more fancy
if IsMac()
let cmd = 'defaults read -g AppleInterfaceStyle'
endif
let dark_mode = substitute(system(cmd), '\n', '', 'g')
" Set colorscheme and background based on mode
if dark_mode ==# 'Dark'
if &background !=# 'dark'
set background=dark
endif
call s:maybe_set_color(s:env_color_dark)
else
if &background !=# 'light'
set background=light
endif
call s:maybe_set_color(s:env_color_light)
endif
endfunction
command! UpdateColors call UpdateColors()
nnoremap <leader>cc :UpdateColors<CR>
augroup AutoColors
autocmd FocusGained * call UpdateColors()
augroup END
try
execute 'colorscheme ' . s:env_color
" Disabled because this slows startup
call UpdateColors()
catch /^Vim\%((\a\+)\)\=:E185/
" Colorschemes not installed yet
" This happens when first installing bundles
endtry
" }}
" Set xterm and screen/tmux's title {{
set titlestring=vim\ %{expand(\"%t\")}
if &term =~# '^screen'
" pretend this is xterm. it probably is anyway, but if term is left as
" `screen`, vim doesn't understand ctrl-arrow.
if &term ==# 'screen-256color'
set term=xterm-256color
else
set term=xterm
endif
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
" gotta set these *last*, since `set term` resets everything
set t_ts=k
set t_fs=\
set t_ut=
endif
set notitle
" }}

0
vim/tmp/.gitkeep Normal file
View File

452
vimrc
View File

@ -1,452 +0,0 @@
" Install Vundle Packages
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Plugin 'gmarik/vundle'
" Rest of my bundles
" -- File Nav --
"Plugin 'scrooloose/nerdtree' " File tree navigation
Plugin 'tpope/vim-vinegar' " Simple file navigation
Plugin 'a.vim' " Switch to alternate file
Plugin 'file-line' " Allow opening to a line from file name using :
Plugin 'tpope/vim-fugitive' " Git integration
Plugin 'christoomey/vim-tmux-navigator'
" -- Fuzzy Finders --
Plugin 'ctrlpvim/ctrlp.vim' " Quick find files in project
" -- Buffer Nav --
Plugin 'sandeepcr529/Buffet.vim' " Quick buffer switching
" -- Nav in file --
Plugin 'majutsushi/tagbar' " Ctags file parsing
Plugin 'scrooloose/syntastic' " Syntax checking
Plugin 'ViViDboarder/QFixToggle' " Easy Toggle of QuickFix window
if executable('ag')
Plugin 'rking/ag.vim' " Project searching
else
Plugin 'mileszs/ack.vim' " Project Searching
endif
" -- Text Manipulation --
Plugin 'tomtom/tcomment_vim' " Easy comments
Plugin 'tpope/vim-surround' " Surround for wrapping text
" -- GUI --
Plugin 'gregsexton/MatchTag'
Plugin 'bling/vim-airline' " Custom Status Line
"Powerline Config
"If using a patched font: https://github.com/Lokaltog/vim-powerline/wiki/Patched-fonts
"let g:airline_powerline_fonts = 1
" -- System --
Plugin 'tpope/vim-dispatch' " Allow async make
Plugin 'tpope/vim-rsi' " emacs bindinds in insert
Plugin 'tpope/vim-repeat' " Repeat mapped commands with .
" Needs to be compiled
Plugin 'Shougo/vimproc.vim' " Async for plugins
if has('lua')
Plugin 'Shougo/neocomplete.vim' " Autocomplete
else
Plugin 'Shougo/neocomplcache.vim' " Autocomplete
end
" -- Themes --
Plugin 'vividchalk.vim'
Plugin 'wombat256.vim'
Plugin 'nanotech/jellybeans.vim'
Plugin 'candy.vim'
Plugin 'therubymug/vim-pyte'
Plugin 'eclipse.vim'
Plugin 'summerfruit256.vim'
Plugin 'nuvola.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'morhetz/gruvbox'
"Plugin 'BusyBee.vim'
"Plugin 'github.vim'
" -- Filetypes --
Plugin 'pdurbin/vim-tsv'
Plugin 'pangloss/vim-javascript'
Plugin 'fatih/vim-go'
Plugin 'PreserveNoEOL'
Plugin 'hsanson/vim-android'
Plugin 'groovy.vim'
Plugin 'tfnico/vim-gradle'
Plugin 'dart-lang/dart-vim-plugin'
Plugin 'avakhov/vim-yaml'
"Plugin 'chrisbra/csv.vim'
" SFDC
Plugin 'ViViDboarder/vim-forcedotcom'
"Plugin 'ViViDboarder/force-vim'
"Plugin 'ViViDboarder/vim-abuse-the-force'
" Python
Plugin 'klen/python-mode'
Plugin 'davidhalter/jedi-vim'
Plugin 'alfredodeza/pytest.vim'
Plugin 'alfredodeza/coveragepy.vim'
" ***************************
" Built in settings
" ***************************
"Allows filetype detection
filetype on
" Set settings values
filetype plugin indent on
" Allow arrow keys
set nocompatible
" Use more convenient leader
let mapleader=","
" Enable mouse input
set mousehide
set mouse=a
" Tab functionality
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set autoindent
" Ensure backspace actually works
set backspace=2
"
" allow for cursor beyond last character
set virtualedit=onemore
" lines to scroll when cursor leaves screen
set scrolljump=5
" minimum lines to keep above and below cursor
set scrolloff=3
" Display filename at bottom of window
set ls=2
" Set backup dirs
set backup
set backupdir=~/.vim/backup
set directory=~/.vim/tmp
"enable line numbers
set nu
" Highlights the line the cursor is on
set cursorline
:hi CursorLine cterm=NONE ctermbg=darkred guibg=darkred guifg=white
" Syntax Hightlighting
syntax on
" Enable search highlighting
set hls
" Change Working Directory to that of the current file
cmap cwd lcd %:p:h
cmap cd. lcd %:p:h
" ********************************
" GUI SETTINGS
" *****************************
" Set theme based on $VIM_COLOR variable
try
if !empty($VIM_COLOR)
colorscheme $VIM_COLOR
else
if has("gui_running")
colorscheme wombat256mod
else
colorscheme vividchalk
endif
endif
catch /^Vim\%((\a\+)\)\=:E185/
" Colorschemes not installed yet
" This happens when first installing bundles
colorscheme default
endtry
" Set Airline theme
if g:colors_name == 'github'
let g:airline_theme = 'solarized'
endif
" Set gui fonts
if has("gui_running")
if has("gui_win32")
set guifont=Consolas:h10:b
elseif has("gui_macvim")
try
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h11
catch
" Failed to set font
endtry
endif
endif
" Set xterm title, and inform vim of screen/tmux's syntax for doing the same
set titlestring=vim\ %{expand(\"%t\")}
if &term =~ "^screen"
" pretend this is xterm. it probably is anyway, but if term is left as
" `screen`, vim doesn't understand ctrl-arrow.
if &term == "screen-256color"
set term=xterm-256color
else
set term=xterm
endif
" gotta set these *last*, since `set term` resets everything
set t_ts=k
set t_fs=\
set t_ut=
endif
set title
" ********************************
" SET HOTKEYS
" ********************************
" Remap jk to esc
inoremap jk <esc>
inoremap `` <esc>
vnoremap `` <esc>
" Bind Make to F5 like other IDEs
nnoremap <F5> :Make!<CR>
" Remap Ctrl+Space for auto Complete
inoremap <C-Space> <C-n>
inoremap <Nul> <C-n>
" Toggle highlighting with \hr (highlight row)
nnoremap <leader>hr :set cursorline!<CR>
" Toggle Line numbers with Ctrl+N double tap
nmap <C-N><C-N> :set invnumber<CR>
nmap <leader>ln :set invnumber<CR>
" Toggle line wrap with Ctrl+L double tap
nmap <C-L><C-L> :set wrap!<CR>
nmap <leader>lw :set wrap!<CR>
" Toggle White Space
nmap <leader>ws :set list!<CR>
" Map Shift+U to redo
nnoremap <S-u> <C-r>
" Stupid shift key fixes
cmap WQ<CR> wq<CR>
cmap Wq<CR> wq<CR>
cmap W<CR> w<CR>
cmap Q<CR> q<CR>
cmap Q!<CR> q!<CR>
" Stupid semicolon files
cnoremap w; w
cnoremap W; w
cnoremap q; q
cnoremap Q; q
" Avoid accidental Ex-mode
:map Q <Nop>
" Clearing highlighted search
nmap <silent> <leader>/ :set hlsearch! hlsearch?<CR>
noremap <C-h><C-s> :set hlsearch! hlsearch?<CR>
" Clear search
nmap <silent> <leader>cs :nohlsearch<CR>
" Code fold
nmap <leader>cf va{<ESC>zf%<ESC>:nohlsearch<CR>
" Paste over
vnoremap pp p
vnoremap po "_dP
" Buffer nav
nmap gb :bn<CR>
nmap gB :bp<CR>
set notitle
" Easy update tags
command TagsUpdate Dispatch ctags -R .
" Command to display TODO tags in project
command Todo Ag! TODO
au BufRead,BufNewFile *.md set syntax=markdown
" ********************************
" PLUGIN SETTINGS
" ********************************
" Airline config
" Use short-form mode text
let g:airline_mode_map = {
\ '__' : '-',
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'c' : 'C',
\ 'v' : 'V',
\ 'V' : 'V',
\ '' : 'V',
\ 's' : 'S',
\ 'S' : 'S',
\ '' : 'S',
\ }
let g:airline#extensions#whitespace#trailing_format = 'tw[%s]'
let g:airline#extensions#whitespace#mixed_indent_format = 'i[%s]'
let g:airline_left_sep=''
let g:airline_left_alt_sep=''
let g:airline_right_sep=''
let g:airline_right_alt_sep=''
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
" AbuseTheForce
" Set foreground if using tmux, otherwise background
if ! exists('g:abusetheforce_dispatch_background') && (exists("$TMUX") || ( has("gui_running") && has("gui_macvim") ) )
let g:abusetheforce_dispatch_background = 0
else
let g:abusetheforce_dispatch_background = 1
endif
" Buffet shortcut
nnoremap <silent> <F2> :Bufferlist<CR>
" NERDTree
" nnoremap <silent> <F4> :NERDTreeToggle<CR>
"nnoremap <leader>nn :NERDTreeToggle<CR>
"nnoremap <leader>nf :NERDTreeFind<CR>
" TComment
nnoremap // :TComment<CR>
vnoremap // :TCommentBlock<CR>
" PreserveNoEOL
let g:PreserveNoEOL = 1
" CTags List
nnoremap <silent> <F8> :TagbarToggle<CR>
" Autofocus tagbar
let g:tagbar_autofocus = 1
" CtrlP settings
" Ensure max height isn't too large. (for performance)
let g:ctrlp_max_height = 10
" Conditional Mappings
let g:ctrlp_map = '<C-t>'
" Allow ctrl p to open over the initial nerdtree window
let g:ctrlp_dont_split = 'netrw'
" Support tag jumping
let g:ctrlp_extensions = ['tag', 'buffertag']
" Support Apex language
let g:ctrlp_buftag_types = {
\ 'apex' : '--language-force=c#',
\ 'go' : {
\ 'bin' : 'gotags',
\ 'args' : '-sort -silent',
\}
\}
" Leader Commands
nnoremap <leader>b :CtrlPBuffer<CR>
nnoremap <leader>t :CtrlPBufTag<CR>
nnoremap <leader>r :CtrlPTag<CR>
nnoremap <leader>u :CtrlPCurFile<CR>
nnoremap <leader>m :CtrlPMRUFiles<CR>
" Special stuff for The Silver Searcher
if executable('ag')
" use ag
set grepprg=ag\ --nogroup\ --nocolor
" use ag for CtrlP
let g:ctrlp_user_command = 'ag %s -l --nocolor --nogroup -g ""'
" ag is fast enough we don't need cache
let g:ctrlp_use_caching = 0
endif
" fugitive
" Add some shortcuts for git commands
nnoremap <leader>gb :Gblame<CR>
nnoremap <leader>gc :Gcommit<CR>
nnoremap <leader>gd :Gdiff<CR>
nnoremap <leader>gs :Gstatus<CR>
nnoremap <leader>gw :Gwrite<CR>
" Toggle QuickFix window
nnoremap <silent> <F6> :QFix<CR>
" neocomplete / neocomplcache
if has('lua')
let g:acp_enableAtStartup = 0
let g:neocomplete#enable_at_startup = 1
"let g:neocomplete#enable_smart_case = 1
let g:neocomlete#max_list=10
else
" NeoComplCache
let g:neocomplcache_enable_at_startup = 1
"let g:neocomplcache_enable_smart_case = 1
let g:neocomplcache_max_list = 10
"let g:neocomplcache_enable_camel_case_completion = 1
let g:neocomplcache_enable_fuzzy_completion = 1
if !exists('g:neocomplcache_force_omni_patterns')
let g:neocomplcache_force_omni_patterns = {}
endif
let g:neocomplcache_force_omni_patterns.python =
\ '\%([^. \t]\.\|^\s*@\|^\s*from\s.\+import \|^\s*from \|^\s*import \)\w*'
" alternative pattern: '\h\w*\|[^. \t]\.\w*'
endif
"
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
" Skip python because we have jedi-vim
"autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType python setlocal omnifunc=jedi#completions
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
nmap <leader>a :Ag<Space>
nmap <leader>i* :Ag<Space>-i<Space>'\b<c-r><c-W>\b'<CR>
nmap <leader>* :Ag<Space>'\b<c-r><c-W>\b'<CR>
" Syntastic settings
let g:syntastic_html_tidy_ignore_errors = [
\ 'proprietary attribute "ng-show"',
\ 'proprietary attribute "ng-controller"',
\ 'proprietary attribute "ng-repeat"',
\ 'proprietary attribute "ng-app"',
\ 'proprietary attribute "ng-click"'
\ ]
let g:syntastic_python_checkers = ['flake8']
let g:syntastic_python_flake8_args='--max-line-length=80'
" let g:syntastic_python_checkers = ['pep8']
" let g:syntastic_python_pep8_args='--ignore=E501'
" let g:syntastic_python_checkers = ['jshint']
" let g:syntastic_javascript_jshint_args='--ignore=E501'
" Pymode
let g:pymode_lint = 1
let g:pymode_lint_on_write = 0
let g:pymode_lint_checkers = ['flake8']
let g:pymode_rope = 0
let g:pymode_rope_completion = 0
let g:pymode_rope_complete_on_dot = 0
let g:pymode_breakpoint = 0
" jedi-vim
let g:jedi#completions_enabled = 0
let g:jedi#auto_vim_configuration = 0