Commit graph

1215 commits

Author SHA1 Message Date
Sanchayan Maity 068dfcd4b9 nvim: lsp/keymappings: Move the diagnostic key mappings outside of LSP
vim.diagnostic framework is now available and can be used outside of
LSP. This means the same functions can now work for plugins providing
diagnostics via this framework like nvim-lint and null-ls.
2021-10-02 18:29:57 +05:30
Sanchayan Maity ff93725694 nvim: treesitter: Update treesitter configuration 2021-10-02 17:19:34 +05:30
Sanchayan Maity 2ff1ba46e1 nvim: plugins: Add TSUpdate as post install hook for treesitter 2021-10-02 17:19:34 +05:30
Sanchayan Maity ef61388c72 nvim: plugins: Drop neoformat
With LSP providing formatting have not used this in more than a year.
Just drop it. Also it is pretty stupid to look for everything global &
not use language build tool to pick the correct formatter and its
configuration.
2021-10-02 17:19:34 +05:30
Sanchayan Maity 891fae907b nvim: plugin: Add a simple whitespace plugin
Now that we dropped vim-better-whitespace just add something simple to
strip whitespace if we do ever need it.
2021-10-02 16:14:31 +05:30
Sanchayan Maity 8a43a1c14f nvim: keymappings: Drop mapping to save
We have a keyboard macro to do this.
2021-10-02 13:03:12 +05:30
Sanchayan Maity 331885ea25 nvim: plugins: Drop vim-better-whitespace
Using formatter already does this, so drop it.
2021-10-02 12:45:08 +05:30
Sanchayan Maity 05194ded3a nvim: plugins: Load AnsiEsc plugin only on AnsiEsc command 2021-10-02 11:06:23 +05:30
Sanchayan Maity 95d5a10abc nvim: plugins: Drop SyntaxAttr 2021-10-02 11:06:23 +05:30
Sanchayan Maity ae4edc5bed nvim: plugins: Drop unneeded text object plugins 2021-10-02 10:05:12 +05:30
Sanchayan Maity 2a07f71c6f gitignore: Ignore everything in path packer/opt 2021-10-02 10:05:12 +05:30
Sanchayan Maity 6613689352 nvim: after/plugin/which-key: Add triggers blacklist
We have some mappings starting with p and need to blacklist in which key
without which using paste 'p' becomes impossible.
2021-10-01 14:55:30 +05:30
Sanchayan Maity 31780f0c25 nvim: keymappings: Drop highlight search mapping
<C-l> now clears search highlight and update diffs and is mapped by
default.

See
https://github.com/neovim/neovim/issues/14090#issuecomment-901882455.
2021-10-01 14:55:30 +05:30
Sanchayan Maity a668139491 nvim: after/ftplugin/C: Add a key mapping for ClangSwitchSourceHeader
This allows us to switch seamlessly between source and header file.

Its provided by nvim-lspconfig. See
https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/clangd.lua
2021-10-01 10:00:13 +05:30
Sanchayan Maity 62e99dd1f0 nvim: after/ftplugin/C: Drop unneeded settings
Do not know what advantage if any these settings will bring anymore.
2021-09-30 14:20:42 +05:30
Sanchayan Maity 4b8caad3b6 nvim: plugins: Drop cscope
Now that we have migrated to clang LSP for C, the only reason for
keeping it around was using it to find files in gst-build repository
which was structured in such a way that fzf and rg could not be used.
Now that GStreamer has moved to monorepo setup, we can use fzf and
rg just like in any project. No need for cscope anymore.
2021-09-30 14:20:42 +05:30
Sanchayan Maity 0a21f7d979 nvim: lsp: Explicitly set the log level 2021-09-30 13:55:49 +05:30
Sanchayan Maity 4b6bd7e7ed nvim: after/plugin/fugitive: Add key mappings for git log grep
Usage:
$ git log --grep=word
$ git log -Gword
2021-09-29 11:42:52 +05:30
Sanchayan Maity 8aaccc4f16 nvim: lsp: Refactor and alignment clean ups 2021-09-27 18:46:55 +05:30
Sanchayan Maity 9de5a7de76 nvim: after/plugin/vsnip: Keymap settings are not required anymore
With the move to nvim-cmp these vsnip key mappings are not required
anymore. The completion and expansion gets taken care of by nvim-cmp.
Just move the vsnip_filetypes settings to init.
2021-09-27 18:46:55 +05:30
Sanchayan Maity b6063211f7 nvim: plugins: Fix snippets not showing up in completion
For some reason without adding the snippets to the runtime path,
snippets do now show up in completion.

Found the solution here though the issue is on Ultisnips
https://github.com/hrsh7th/nvim-cmp/issues/241
2021-09-27 16:40:55 +05:30
Sanchayan Maity be02b5ead7 nvim: Switch to nvim-cmp
nvim-compe has been deprecated. While we tried to make it a few days
without any completion support, in javascript/typescript could not get
the default omnicompletion to work at all. It is possible that this
could be due to nvim-lsp-ts-utils/null-ls but who is gonna debug.

Also tried MUcomplete but it just would not work. There are open issues
on this. See https://github.com/neovim/neovim/issues/12390 and also
https://github.com/lifepillar/vim-mucomplete/issues/179.

So here we are with nvim-cmp. Some observations in comparison to compe
before. Using buffer completion seems not possible as most of the times
LSP completion items then do not turn up. Do not know if this is server
specific but at least it is the case with Rust. compe seemed better
performance wise especially in tsserver and considering the buffer
problem mentioned above. Also, even with vsnip added as the completion
source can't seem to get any snippet specific completions working.

Could have ditched all completion support if I did not have to use
tsserver but need it for work currently. So we will stick to enabling
this and hopefully it improves in future.

Fuck nodejs, javascript and typescript.

For references see,
https://github.com/kristijanhusak/neovim-config
https://github.com/sQVe/dotfiles/tree/master/config/nvim
2021-09-27 16:29:18 +05:30
Sanchayan Maity b95a14b8d1 nvim: lsp: Fix enabling of range format support again!
47b1578 did not actually fix it. We need to keep using 'gq' but actually
correctly specify whether we want normal or visual mode. Also disable
range formatting explicitly for tsserver.
2021-09-27 15:23:12 +05:30
Sanchayan Maity d7fbe762c5 nvim: Update packer 2021-09-27 13:50:59 +05:30
Sanchayan Maity c781b15582 nvim: Drop signify and switch to gitsigns
signify seems to be giving an error after somewhat long usage of
"E489: too many highlight and syntax groups".
2021-09-27 13:14:27 +05:30
Sanchayan Maity 91eecec611 nvim: keymappings: Drop the mapping for help 2021-09-27 13:14:27 +05:30
Sanchayan Maity 975e6a646e nvim: plugins: Switch from vim-which-key to which-key 2021-09-27 13:14:20 +05:30
Sanchayan Maity 00670a867f nvim: lsp: Enable rust-tools for inlay hints 2021-09-27 12:31:27 +05:30
Sanchayan Maity 0aa93c6e9b nvim: init: Always enable the signcolumn
Have a fixed column for the diagnostics to appear in as this removes
the jitter when warnings/errors flow in.

Recommended here
https://sharksforarms.dev/posts/neovim-rust/
2021-09-26 12:06:16 +05:30
Sanchayan Maity 97db1c6c9d nvim: keymappings: Enable unique and refactor/cleanup
Enable unique to detect and avoid conflicting key mappings.
2021-09-26 11:51:04 +05:30
Sanchayan Maity 6223b802ce nvim: after/ftplugin/c: Fix conflicting mapping
,d cscope mapping conflicts with the LSP diagnostic mapping.
2021-09-26 11:51:04 +05:30
Sanchayan Maity f7d12b27d3 nvim: lsp: Alignment cleanup 2021-09-26 11:50:36 +05:30
Sanchayan Maity 55356513a9 nvim: after/plugin/easyalign: Fix conflicting mapping
'ga' mapping conflicts with the LSP code action mapping.
2021-09-25 18:31:10 +05:30
Sanchayan Maity 47b157805d nvim: lsp: Fix enabling of range format support
If range formatting is supported we should check that first to enable
it else since most LSP servers support formatting, without range
formatting check being first, it would never be enabled.
2021-09-25 18:21:51 +05:30
Sanchayan Maity 8801b26fa9 nvim: lsp: Add range formatting with motion 2021-09-25 15:26:52 +05:30
Sanchayan Maity eebffce98e nvim: lsp: Add back custom preview function
Follow up to 469e367.
2021-09-25 15:26:52 +05:30
Sanchayan Maity f01b1d6a52 nvim: lsp: Use Leader k mapping for LSP hover
While at it, align code to look nice.
2021-09-25 15:13:49 +05:30
Sanchayan Maity 616c4f003c nvim: lsp: Increase value of debounce didChange notifications 2021-09-25 13:21:01 +05:30
Sanchayan Maity 469e36756b nvim: lsp: Drop custom preview function
Those functions do not work anymore. May be we will add it later
via https://github.com/rmagatti/goto-preview.
2021-09-25 13:21:01 +05:30
Sanchayan Maity cba3c92d06 fish: Add helpers for seeing & collecting perf data 2021-09-25 13:21:01 +05:30
Sanchayan Maity 9ab36d4b1b nvim: lsp: Fix null-ls setup 2021-09-25 13:21:01 +05:30
Sanchayan Maity 350a6edd2c nvim: fugitive/git: Add git helper to push upstream
Now that we set push.default to nothing in our git configuration, add
a git helper to figure out the upstream for the current branch and push
it.
2021-09-25 13:21:01 +05:30
Sanchayan Maity 2fb77b64bc fish: Add a rust-gdb helper command 2021-09-25 13:21:01 +05:30
Sanchayan Maity ccdb81f9b5 git: Set push.default
Do not push anything (error out) unless a refspec is given. We want
to avoid mistakes by always being explicit.

See https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault
2021-09-25 13:21:01 +05:30
Sanchayan Maity 643e1be349 nvim: keymappings: Add mappings to paste from + & * register 2021-09-22 17:52:15 +05:30
Sanchayan Maity 130bf3e04d nvim: colors: yolokai: Update diagnostic highlight 2021-09-22 17:51:51 +05:30
Sanchayan Maity 71f5c334f1 nvim: plugins: Drop nvim-peekup
Does not work correctly and keeps pasting in the first window instead of
where the cursor is placed.
2021-09-21 11:02:25 +05:30
Sanchayan Maity 52ff789cf3 nvim: Switch to the maintained galaxyline fork
See
https://github.com/NTBBloodbath/galaxyline.nvim
https://www.reddit.com/r/neovim/comments/pq3zvq/galaxylinenvim_is_back/
2021-09-21 11:02:25 +05:30
Sanchayan Maity b31aeaf597 nvim: Update packer 2021-09-21 11:02:25 +05:30
Sanchayan Maity a7e7ac968f fish: Add helpers for coredumpctl 2021-09-15 18:33:09 +05:30