Compare commits
452 Commits
Author | SHA1 | Date |
---|---|---|
ViViDboarder | 66c11ff5a0 | |
ViViDboarder | a2c6ba1f41 | |
ViViDboarder | f9fa1677d6 | |
ViViDboarder | 87ad6b6947 | |
ViViDboarder | 3a637add78 | |
ViViDboarder | 60819a7dff | |
ViViDboarder | 702af2fa15 | |
ViViDboarder | 77e8e797d0 | |
ViViDboarder | abe6a88fa7 | |
ViViDboarder | b3f73d92dc | |
ViViDboarder | b652a9b49d | |
ViViDboarder | 35ad43e6a3 | |
ViViDboarder | 76903741e7 | |
ViViDboarder | b9917f562e | |
ViViDboarder | 7e32c53c05 | |
ViViDboarder | d52d57f5d5 | |
ViViDboarder | dac42c039a | |
ViViDboarder | 9b05e6a4e0 | |
ViViDboarder | ab29c55c39 | |
ViViDboarder | 6f7627d290 | |
ViViDboarder | 00598ea1c4 | |
ViViDboarder | b97d2aafbe | |
ViViDboarder | cc7d7820b9 | |
ViViDboarder | 78f926dd79 | |
ViViDboarder | cf2c776af6 | |
ViViDboarder | c338a0b580 | |
ViViDboarder | 20af7a9374 | |
ViViDboarder | e783fde179 | |
ViViDboarder | 7739ba5579 | |
ViViDboarder | 8ed18d206d | |
ViViDboarder | c077ee967c | |
ViViDboarder | 7a275315f0 | |
ViViDboarder | 0387b70d3b | |
ViViDboarder | 50a72348e8 | |
ViViDboarder | 5c77243b8c | |
ViViDboarder | 0d8261b924 | |
ViViDboarder | f82987bc19 | |
ViViDboarder | 29d9b7960d | |
ViViDboarder | ad47f57d68 | |
ViViDboarder | 963cc8bb6a | |
ViViDboarder | a616e2e14c | |
ViViDboarder | 03df97c0d2 | |
ViViDboarder | 7c6369ba98 | |
ViViDboarder | 17c3e9b5b7 | |
ViViDboarder | e6b2f2bf86 | |
ViViDboarder | 07a3512dbd | |
ViViDboarder | 7f9c6a92b3 | |
ViViDboarder | 21de929b35 | |
ViViDboarder | b0e8fe7743 | |
ViViDboarder | c81a897384 | |
ViViDboarder | 5bcd6af235 | |
ViViDboarder | 4c65a9dfaa | |
ViViDboarder | 56c03f30c5 | |
ViViDboarder | 3f444b9dc1 | |
ViViDboarder | 6435692fc3 | |
ViViDboarder | e36656e67d | |
ViViDboarder | 8404ef0005 | |
ViViDboarder | fd5e698787 | |
ViViDboarder | 0e446b86d1 | |
ViViDboarder | 72ba9591e7 | |
ViViDboarder | 2e95001b5b | |
ViViDboarder | baf3b0183f | |
ViViDboarder | 3dd3134d30 | |
ViViDboarder | b4cb73b4e4 | |
ViViDboarder | 625879cacb | |
ViViDboarder | 5b3f3f51b4 | |
ViViDboarder | d4c573263c | |
ViViDboarder | 8dd18623e4 | |
ViViDboarder | c56293489b | |
ViViDboarder | 37714095b4 | |
ViViDboarder | fc47ec9051 | |
ViViDboarder | cef387aa4a | |
ViViDboarder | 68d61b1d0b | |
ViViDboarder | 61171df4a8 | |
ViViDboarder | cad8b97da4 | |
ViViDboarder | 9d3c630211 | |
ViViDboarder | b259a7bf53 | |
ViViDboarder | 9c8c290f84 | |
ViViDboarder | d20e4a2645 | |
ViViDboarder | 3d6071d222 | |
ViViDboarder | 8277be8360 | |
ViViDboarder | eb0320fe77 | |
ViViDboarder | 4e906222ea | |
ViViDboarder | e02f9d9c66 | |
ViViDboarder | 9380fc627e | |
ViViDboarder | 85822d8c08 | |
ViViDboarder | a22d1b9244 | |
ViViDboarder | 6f02ac53db | |
ViViDboarder | 9bb414e017 | |
ViViDboarder | ef91367f38 | |
ViViDboarder | 548883eb7b | |
ViViDboarder | 597d0142d6 | |
ViViDboarder | d33415ee73 | |
ViViDboarder | 516e5386ef | |
ViViDboarder | 8b6ae9a87a | |
ViViDboarder | 89c4d40068 | |
ViViDboarder | 759b797f25 | |
ViViDboarder | ba6d69e6a7 | |
ViViDboarder | f9e2976d9f | |
ViViDboarder | b3d96c0ddc | |
ViViDboarder | b846cfc6b9 | |
ViViDboarder | 9a1ac596b2 | |
ViViDboarder | b7e3bfd460 | |
ViViDboarder | 3df8f355dd | |
ViViDboarder | 978d20d4e9 | |
ViViDboarder | ae4cb15f72 | |
ViViDboarder | 219b8fac43 | |
ViViDboarder | ef18e73af1 | |
ViViDboarder | 36853b6b2f | |
ViViDboarder | ded3cec4a9 | |
ViViDboarder | 6be2309fdc | |
ViViDboarder | 6161750843 | |
ViViDboarder | 08308c78ce | |
ViViDboarder | 21a4b791d9 | |
ViViDboarder | 3849838817 | |
ViViDboarder | 617bbf780f | |
ViViDboarder | 0ccfe90fac | |
ViViDboarder | 960aad79e1 | |
ViViDboarder | 1482ccedb1 | |
ViViDboarder | dc2a528c06 | |
ViViDboarder | ddb7721048 | |
ViViDboarder | 02b0cb76bd | |
ViViDboarder | 2eba3d8bc6 | |
ViViDboarder | eebddac3de | |
ViViDboarder | 68f5edb072 | |
ViViDboarder | ec6601ff2a | |
ViViDboarder | 0cb37ef1dc | |
ViViDboarder | efedec3d59 | |
ViViDboarder | 3dabf98e5b | |
ViViDboarder | a4119cae0f | |
ViViDboarder | d368e0eaf6 | |
ViViDboarder | d8cf78b4e4 | |
ViViDboarder | 204fd57199 | |
ViViDboarder | 43ef210795 | |
ViViDboarder | 19752d45a6 | |
ViViDboarder | 53efd0ff51 | |
ViViDboarder | 08a50b1621 | |
ViViDboarder | ace8f98428 | |
ViViDboarder | 68d5b9b62e | |
ViViDboarder | 7b9a4fe2a2 | |
ViViDboarder | 1aaba4f1c6 | |
ViViDboarder | a2a1326258 | |
ViViDboarder | 6efc54a754 | |
ViViDboarder | a0e8fc8310 | |
ViViDboarder | 58f049382e | |
ViViDboarder | da77afdfb3 | |
ViViDboarder | 1e0ae56e92 | |
ViViDboarder | ddbe6a4a71 | |
ViViDboarder | f87a811716 | |
ViViDboarder | 4730db4507 | |
ViViDboarder | 139a779ba0 | |
ViViDboarder | edc6cc173e | |
ViViDboarder | e44c226a70 | |
ViViDboarder | 784fee4cef | |
ViViDboarder | a307c7e930 | |
ViViDboarder | 0c05f9db2a | |
ViViDboarder | aef826f76b | |
ViViDboarder | 5a81e7d33c | |
ViViDboarder | 90581a444b | |
ViViDboarder | 64583bf41d | |
ViViDboarder | f352983d65 | |
ViViDboarder | ec110edaff | |
ViViDboarder | f99002e303 | |
ViViDboarder | 7ba165af78 | |
ViViDboarder | ae6ccdc96a | |
ViViDboarder | 6475f422ac | |
ViViDboarder | e77a79e662 | |
ViViDboarder | e3edf33316 | |
ViViDboarder | cf97331465 | |
ViViDboarder | 6d2acddc56 | |
ViViDboarder | 44b7b000df | |
ViViDboarder | 4c6c3041f0 | |
ViViDboarder | 5b56491ea7 | |
ViViDboarder | 06b29db645 | |
ViViDboarder | 36a3ed3bfd | |
ViViDboarder | c2f290bb97 | |
ViViDboarder | e43a43500e | |
ViViDboarder | 980dd9d1f5 | |
ViViDboarder | fdc27ee719 | |
ViViDboarder | 62d43d5096 | |
ViViDboarder | 27eccf2b51 | |
ViViDboarder | 5a1a907529 | |
ViViDboarder | b48edf86de | |
ViViDboarder | 77266fe95f | |
ViViDboarder | 150a9b36d8 | |
ViViDboarder | 5543af4bbc | |
ViViDboarder | ed6640e8e1 | |
ViViDboarder | c01d2445ba | |
ViViDboarder | 4b6d7a3efc | |
ViViDboarder | 40b88432f8 | |
ViViDboarder | 175c271d90 | |
ViViDboarder | f766f82b2a | |
ViViDboarder | c21fd30312 | |
Ian | e782544db9 | |
ViViDboarder | 37a89b59f0 | |
ViViDboarder | b1fa9733ef | |
ViViDboarder | 07ca6b6ddf | |
ViViDboarder | 8eb0d63ec0 | |
ViViDboarder | 7861b3c4e5 | |
ViViDboarder | ed73884345 | |
ViViDboarder | d004dbee79 | |
ViViDboarder | 718dcc79e6 | |
ViViDboarder | a1f9fdc430 | |
ViViDboarder | 3051f0b294 | |
ViViDboarder | 7b3f69cf66 | |
ViViDboarder | 1eee1c727f | |
ViViDboarder | 1c9990750b | |
ViViDboarder | e11ba17d15 | |
ViViDboarder | 720f8c41ec | |
ViViDboarder | cdc06953d2 | |
ViViDboarder | 24f2e9b645 | |
ViViDboarder | eca001d4d7 | |
ViViDboarder | 6b8a4d39db | |
ViViDboarder | d98e4fac72 | |
ViViDboarder | d9a1d9b799 | |
ViViDboarder | 24b740fe86 | |
ViViDboarder | 212b3cbdc7 | |
ViViDboarder | 46cfa8337e | |
ViViDboarder | eca378ce64 | |
ViViDboarder | a105a310a2 | |
ViViDboarder | c6e7e756d0 | |
ViViDboarder | 83590865a5 | |
ViViDboarder | 052f75718d | |
ViViDboarder | ca13faf07a | |
ViViDboarder | e0900785a1 | |
ViViDboarder | b5930ba12b | |
ViViDboarder | 27c068faca | |
ViViDboarder | 079808942b | |
ViViDboarder | 04b0f7b5f8 | |
ViViDboarder | 04bbeac02b | |
ViViDboarder | 0e30786617 | |
ViViDboarder | aa8ed67173 | |
ViViDboarder | d42d58a45d | |
ViViDboarder | 3490deeb18 | |
ViViDboarder | 70c31d66eb | |
ViViDboarder | f4a7db3ea1 | |
ViViDboarder | 8d1ac8ac5c | |
ViViDboarder | 505143f5e3 | |
ViViDboarder | 84497d7009 | |
ViViDboarder | aa9c37859f | |
ViViDboarder | bf2c6d2b5b | |
ViViDboarder | 7eaf0ee267 | |
ViViDboarder | 45f840144e | |
ViViDboarder | e4a96890d3 | |
ViViDboarder | 5ed31c83b0 | |
ViViDboarder | 8e5aa3158b | |
ViViDboarder | 45e32b07bf | |
ViViDboarder | d811700154 | |
ViViDboarder | 371573e468 | |
ViViDboarder | 9092219d2c | |
ViViDboarder | b8b502298e | |
ViViDboarder | 89cb90a6aa | |
ViViDboarder | 3fdacaf932 | |
ViViDboarder | 02d7c26c98 | |
ViViDboarder | 9778c8c5fa | |
ViViDboarder | 38a0919865 | |
ViViDboarder | 4fb61693a8 | |
ViViDboarder | 00d580eb1b | |
ViViDboarder | 4499dab62b | |
ViViDboarder | c4d688ef51 | |
ViViDboarder | 8bc5c38067 | |
ViViDboarder | f07fe8fad0 | |
ViViDboarder | 24eb10eb7a | |
ViViDboarder | 9e9defe4e2 | |
ViViDboarder | 4a5d7fce1e | |
ViViDboarder | 48af6cc3ef | |
ViViDboarder | 6baa4feab0 | |
ViViDboarder | e8bc313d4f | |
ViViDboarder | ae43e89920 | |
ViViDboarder | 155e61da51 | |
ViViDboarder | 627569ae46 | |
ViViDboarder | cd39a215cf | |
ViViDboarder | 2b920d1230 | |
ViViDboarder | bdf4a23491 | |
ViViDboarder | 453a25f5da | |
ViViDboarder | 7afc5f9903 | |
ViViDboarder | 9bbe68013b | |
ViViDboarder | 4d4b6134d0 | |
ViViDboarder | 098ef45271 | |
ViViDboarder | da356bba97 | |
ViViDboarder | 4097ef493c | |
ViViDboarder | b194e639fd | |
ViViDboarder | 1ac22e81b2 | |
ViViDboarder | 21c33a47f8 | |
ViViDboarder | 954738573d | |
ViViDboarder | d283258689 | |
ViViDboarder | 497c580c12 | |
ViViDboarder | d87d6c8d6a | |
ViViDboarder | 09fd4d640d | |
ViViDboarder | 74675dcba2 | |
ViViDboarder | 05f57cff6c | |
ViViDboarder | ae8d912323 | |
ViViDboarder | edd5181964 | |
ViViDboarder | a293e22eb0 | |
ViViDboarder | 07659f2aaf | |
ViViDboarder | 75261eb20a | |
ViViDboarder | 41ef5dc30f | |
ViViDboarder | eca03d227c | |
ViViDboarder | 1dbde430c2 | |
ViViDboarder | 1dc2a9d34d | |
ViViDboarder | f18eba7148 | |
ViViDboarder | 9dd7947823 | |
ViViDboarder | 19d082d26d | |
ViViDboarder | 0a7865275f | |
ViViDboarder | ba11b4e68e | |
ViViDboarder | 2a1b012ee9 | |
ViViDboarder | 4e49d8b2d1 | |
ViViDboarder | 2b60626ed3 | |
ViViDboarder | 88f5da156e | |
ViViDboarder | 302d5816dd | |
ViViDboarder | 9384d9b0c6 | |
ViViDboarder | fd8c3e8a75 | |
ViViDboarder | 703f9d02b2 | |
ViViDboarder | 724860a098 | |
ViViDboarder | 844c00809f | |
ViViDboarder | 2d05d62bd5 | |
ViViDboarder | dedd400ccf | |
ViViDboarder | d2717e751d | |
ViViDboarder | c8f77b1b3b | |
ViViDboarder | f50cdda385 | |
ViViDboarder | 90b505bb34 | |
ViViDboarder | 1d0cf22333 | |
ViViDboarder | e085795b92 | |
ViViDboarder | 9397bdafbd | |
ViViDboarder | 0ac1019486 | |
ViViDboarder | acf484c4bd | |
ViViDboarder | 4b4c141ee5 | |
ViViDboarder | 348d2fabc6 | |
ViViDboarder | 54d9793902 | |
ViViDboarder | 8b23380279 | |
ViViDboarder | 36eb348b43 | |
ViViDboarder | 808804d0ac | |
ViViDboarder | 2c3d439df4 | |
ViViDboarder | 970d43a694 | |
ViViDboarder | ba6ea9e84b | |
ViViDboarder | cf9a69eede | |
ViViDboarder | 6d67d84fc5 | |
ViViDboarder | 53209bff90 | |
ViViDboarder | 1e7156d172 | |
ViViDboarder | e9bd22b73c | |
ViViDboarder | 5fdc11ff93 | |
ViViDboarder | 51bbd2dcef | |
ViViDboarder | 8d0b6c26fe | |
ViViDboarder | c16f793fb8 | |
ViViDboarder | 4cf4f83897 | |
ViViDboarder | 556b8baeae | |
ViViDboarder | ad7da3997d | |
ViViDboarder | bc1ac5ff71 | |
ViViDboarder | f2a766d1e6 | |
ViViDboarder | 6a51d76881 | |
ViViDboarder | 2b6b13fcda | |
ViViDboarder | 16d6dd2ce5 | |
ViViDboarder | 57e5f83dc8 | |
ViViDboarder | e08135fe1f | |
ViViDboarder | 62c65e5d73 | |
ViViDboarder | 2a07143e43 | |
ViViDboarder | fbab69f00e | |
ViViDboarder | aa0686208b | |
ViViDboarder | fde09749bf | |
ViViDboarder | cb1ff9c78a | |
ViViDboarder | 382c3bf129 | |
ViViDboarder | b2c84bf38f | |
ViViDboarder | 9e4dfcafce | |
ViViDboarder | 2955787cf2 | |
ViViDboarder | 42d33b9f48 | |
ViViDboarder | 4e437e9f59 | |
ViViDboarder | b79938f0be | |
ViViDboarder | a5fad0152b | |
ViViDboarder | f329bc8e27 | |
ViViDboarder | 78b781b859 | |
ViViDboarder | a0684794e9 | |
ViViDboarder | da8a4a5d57 | |
ViViDboarder | fe330eecf7 | |
ViViDboarder | b4b6db5191 | |
ViViDboarder | e541c7f90c | |
ViViDboarder | 6269785d63 | |
ViViDboarder | 6e2ff67d48 | |
ViViDboarder | b899f3f379 | |
ViViDboarder | 8f93dd590d | |
ViViDboarder | 729a912244 | |
ViViDboarder | 1ab61dcbf7 | |
ViViDboarder | 09c2e48b7f | |
ViViDboarder | 843e531fda | |
ViViDboarder | c530562b12 | |
ViViDboarder | ba6c42657a | |
ViViDboarder | 08844a251e | |
ViViDboarder | c3774255ad | |
ViViDboarder | a869f13c7f | |
ViViDboarder | 2061f3b219 | |
ViViDboarder | 6cb6db86bc | |
ViViDboarder | 63f04cc857 | |
ViViDboarder | fbf0df53f7 | |
ViViDboarder | a51e3655a2 | |
ViViDboarder | 58a1a42b3d | |
ViViDboarder | 9867116073 | |
ViViDboarder | c24f602769 | |
ViViDboarder | 5a71a92b06 | |
ViViDboarder | 4f41d766a8 | |
ViViDboarder | a23a9b85e4 | |
ViViDboarder | 89404652c9 | |
ViViDboarder | e0f5eb2044 | |
ViViDboarder | 7646ca8993 | |
ViViDboarder | 60383b6a09 | |
ViViDboarder | 686c6d6547 | |
ViViDboarder | af75cd6000 | |
ViViDboarder | 2041fa4cfe | |
ViViDboarder | 37d3411a64 | |
ViViDboarder | 362ffced8f | |
ViViDboarder | 61f9c512f5 | |
ViViDboarder | 77ecc753e9 | |
ViViDboarder | a5a0c7be64 | |
ViViDboarder | 36941a0b26 | |
ViViDboarder | 3d457e90df | |
ViViDboarder | 9bc754361e | |
ViViDboarder | 72e12c5ee3 | |
ViViDboarder | 11833a5df4 | |
ViViDboarder | 5334b59979 | |
ViViDboarder | a4f7e8a8b2 | |
ViViDboarder | c1b5cc90af | |
ViViDboarder | ca93dafc60 | |
ViViDboarder | 8dce970b22 | |
ViViDboarder | be0a6c50d2 | |
ViViDboarder | 25eea9537e | |
ViViDboarder | 7221f87639 | |
ViViDboarder | ee774a65e9 | |
ViViDboarder | dc08f01422 | |
ViViDboarder | 3cb93b7ff5 | |
ViViDboarder | a2af8da3a5 | |
ViViDboarder | 178458e89a | |
ViViDboarder | 0c21ca1154 | |
ViViDboarder | ae0e8892d5 | |
ViViDboarder | 5cd246b7d4 | |
ViViDboarder | ff3b206718 | |
ViViDboarder | 179ccc8e96 | |
ViViDboarder | 008e2ef801 | |
ViViDboarder | c5f6717f15 | |
ViViDboarder | c5dd824c5f | |
ViViDboarder | 77a5573941 | |
ViViDboarder | bedad8069b | |
ViViDboarder | 68cc46f11c | |
ViViDboarder | 1bdb30bf1a | |
ViViDboarder | 5ed8198ba8 | |
ViViDboarder | 16956153a9 | |
ViViDboarder | 8d24b9ab33 | |
ViViDboarder | 89fa788e85 | |
ViViDboarder | ba490aa7b7 | |
ViViDboarder | 6941a4626a | |
ViViDboarder | c5892e0bf0 | |
ViViDboarder | 8ff7681f09 | |
ViViDboarder | 9d6f308332 | |
ViViDboarder | 9338f311a0 | |
ViViDboarder | 92d7a08690 |
|
@ -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/
|
|
@ -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 }}
|
|
@ -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/
|
|
@ -0,0 +1 @@
|
|||
globals = { "vim" }
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||
"Lua.workspace.checkThirdParty": false
|
||||
}
|
|
@ -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]
|
|
@ -0,0 +1 @@
|
|||
indent_type = "Spaces"
|
|
@ -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
|
45
README.md
45
README.md
|
@ -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.
|
||||
|
|
|
@ -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"]
|
|
@ -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
|
|
@ -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 "$@"
|
|
@ -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
|
|
@ -0,0 +1 @@
|
|||
*_local.lua
|
|
@ -0,0 +1,2 @@
|
|||
let g:tokyonight_style = 'night'
|
||||
runtime colors/tokyonight.vim
|
|
@ -0,0 +1,2 @@
|
|||
let g:tokyonight_style = 'storm'
|
||||
runtime colors/tokyonight.vim
|
|
@ -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
|
|
@ -0,0 +1 @@
|
|||
let g:argwrap_tail_comma = 1
|
|
@ -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()
|
|
@ -0,0 +1 @@
|
|||
let g:argwrap_tail_comma = 1
|
|
@ -0,0 +1,2 @@
|
|||
" Set YAML indent to 2 because list objects are weird otherwise
|
||||
set shiftwidth=2
|
|
@ -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
|
|
@ -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" })
|
|
@ -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()
|
|
@ -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")
|
|
@ -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")]])
|
|
@ -0,0 +1,2 @@
|
|||
require("_settings")
|
||||
require("_bindings")
|
|
@ -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
|
|
@ -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
|
|
@ -0,0 +1,6 @@
|
|||
require("dark_notify").run({
|
||||
onchange = function(_)
|
||||
-- Defined in _colors
|
||||
_G.update_colors()
|
||||
end,
|
||||
})
|
|
@ -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
|
||||
]])
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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")
|
|
@ -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
|
|
@ -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",
|
||||
}
|
|
@ -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()
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
})
|
|
@ -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
|
|
@ -0,0 +1,12 @@
|
|||
local M = {}
|
||||
|
||||
function M.configure()
|
||||
require("which-key").setup({
|
||||
triggers_blacklist = {
|
||||
i = { "j", "k", "`" },
|
||||
v = { "j", "k" },
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
|
@ -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
|
|
@ -0,0 +1 @@
|
|||
neovim/packer_snapshots/latest-0.9
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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
|
|
@ -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.
|
@ -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
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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,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
|
|
@ -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
|
|
@ -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
|
|
@ -0,0 +1 @@
|
|||
let g:argwrap_tail_comma = 1
|
|
@ -0,0 +1,2 @@
|
|||
" Set YAML indent to 2 because list objects are weird otherwise
|
||||
set shiftwidth=2
|
|
@ -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')
|
|
@ -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
|
|
@ -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
|
|
@ -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'
|
|
@ -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()
|
|
@ -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
|
|
@ -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>
|
|
@ -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
|
|
@ -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>
|
|
@ -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
|
|
@ -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>
|
|
@ -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
|
|
@ -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
|
|
@ -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>
|
|
@ -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') + ['','']
|
|
@ -0,0 +1,3 @@
|
|||
Plug 'majutsushi/tagbar', { 'on': 'TagbarToggle' }
|
||||
nnoremap <silent> <F8> :TagbarToggle<CR>
|
||||
let g:tagbar_autofocus = 1 " Autofocus tagbar
|
|
@ -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
|
|
@ -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
|
||||
" }}
|
452
vimrc
452
vimrc
|
@ -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
|
Loading…
Reference in New Issue