I wonder what indent you are using with vim? I'm using 2 spaces and guns/vimsexp with tpope/vim-sexp-mappings-for-regular-people and finally vim-parinfer. I find myself aligning one space back and forth all the time
> "I find myself aligning one space back and forth all the time" Would this be for aligning multi-line lists to the first element?
I use vim-sexp but I don't use their alignment or vim's built-in alignment. I solely rely on LSP formatting the buffer on save. And even if I make any alignment using plugins then file save overwrites that.
@clojurians-slack100 sometimes, sometimes it's just because previous line/lines were indented by one or two and I want everything to be consistent
@invertisment_clojuria okay, thats a good idea. how did you configure that?
I have this:
Plug 'lukas-reineke/lsp-format.nvim'
Then I have this:
require('lsp-format').setup {}
Then I also do this (notice the client):
local on_attach = function(client, bufnr)
-- Foramt on save via `lukas-reineke/lsp-format.nvim`
require('lsp-format').on_attach(client)
Then I take this on_attach and use it here:
local lspconfig = require('lspconfig')
for _, lsp_plugin_config in pairs(lsp_plugin_configs) do
local lsp_plugin_name = lsp_plugin_config[1]
local lsp_plugin_on_init = lsp_plugin_config[2]
lspconfig[lsp_plugin_name].setup({
capabilities = capabilities, -- nvim-cmp
on_attach = on_attach,
(this stuff is too long)
Pretty painful to set it up. But now it works for all kinds of languages and it's great! 😄
There are probably better ways to set it up. With my config I have a list of language names and this loop simply activates all of them.hm ok i'm looking at the plugin now