1
0
Fork 0

nvim: gruvbox-comminity!

This commit is contained in:
Vladimír Dudr 2022-10-31 17:51:51 +01:00
parent 546ca9309a
commit b79409114e
5 changed files with 54 additions and 11 deletions

View file

@ -4,3 +4,7 @@ encryption = "gpg"
args = ["--quiet"]
[diff]
command = "difft"
[merge]
command = "nvim"
args = [ "-d", "{{.Destination}}", "{{.Source}}" ]

View file

@ -140,15 +140,14 @@ vim.api.nvim_create_autocmd('Colorscheme', {
customLinks()
normalizeTerminal()
end
}
)
})
vim.api.nvim_create_autocmd('Colorscheme', {
group = augr,
pattern = "gruvbox",
callback = function()
hl('Directory', { link = 'GruvboxGreen', default = false })
hl('TelescopeBorder', { link = 'GruvBoxBlue', default = false})
end
})

View file

@ -1,8 +1,24 @@
local M = {}
local formatting_filter = function(c)
local bl = {
'phpactor'
}
for _, name in ipairs(bl) do
if c.name == name then
return false;
end
end
return true
end
local function on_attach(args)
-- require "lsp_signature".on_attach()
-- require'completion'.on_attach()
local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id)
-- Mappings.
@ -11,12 +27,15 @@ local function on_attach(args)
if client.server_capabilities.definitionProvider then
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
end
if client.server_capabilities.declarationProvider then
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
end
if client.supports_method("textDocument/hover") then
if client.supports_method("textDocument/hover") and client.name ~= 'null-ls' then
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
end
if client.server_capabilities.implementationProvider then
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
end
@ -26,8 +45,6 @@ local function on_attach(args)
vim.keymap.set('i', '<C-k>', vim.lsp.buf.signature_help, opts)
end
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, opts)
@ -36,8 +53,11 @@ local function on_attach(args)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
vim.keymap.set('n', '<space>F', function() vim.lsp.buf.format({ async = true }) end, opts)
vim.keymap.set('v', '<space>F', vim.lsp.buf.range_formatting, opts)
vim.keymap.set('n', '<space>F', function() vim.lsp.buf.format({ async = true, filter = formatting_filter, }) end, opts)
if (formatting_filter(client)) then
vim.api.nvim_buf_set_option(bufnr, 'formatexpr', 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')
end
end
function M.setup()
@ -122,6 +142,25 @@ function M.setup()
bundle_path = '/home/vladimir/devel/PowerShellEditorServices/module',
capabilities = capabilities,
}
local util = require("lspconfig.util")
require("lspconfig.configs").coffeesense = {
default_config = {
cmd = { '/home/vladimir/devel/coffeesense/server/bin/coffeesense-language-server' },
filetypes = { 'coffee' },
root_dir = function(pattern)
local cwd = vim.loop.cwd()
local root = util.root_pattern('package.json', '.git')(pattern)
-- prefer cwd if root is a descendant
return util.path.is_descendant(cwd, root) and cwd or root
end,
}
}
require("lspconfig").coffeesense.setup({})
end
return M

View file

@ -3,14 +3,14 @@ function M.setup()
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
-- If you want icons for diagnostic errors, you'll need to define them somewhere:
vim.fn.sign_define("DiagnosticSignError",
--[[ vim.fn.sign_define("DiagnosticSignError",
{ text = "", texthl = "DiagnosticSignError" })
vim.fn.sign_define("DiagnosticSignWarn",
{ text = "", texthl = "DiagnosticSignWarn" })
vim.fn.sign_define("DiagnosticSignInfo",
{ text = "", texthl = "DiagnosticSignInfo" })
vim.fn.sign_define("DiagnosticSignHint",
{ text = "", texthl = "DiagnosticSignHint" })
{ text = "", texthl = "DiagnosticSignHint" }) ]]
-- NOTE: this is changed from v1.x, which used the old style of highlight groups
-- in the form "LspDiagnosticsSignWarning"

View file

@ -64,7 +64,7 @@ function M.setup()
run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
}
use { 'morhetz/gruvbox' }
use { 'gruvbox-community/gruvbox' }
use { 'chrisbra/Colorizer', cmd = 'ColorToggle', keys = { 'n', '<space>c <Cmd>ColorToggle<CR>' } }
@ -124,6 +124,7 @@ function M.setup()
use { 'andymass/vim-matchup' }
use { 'fpob/nette.vim', ft = 'nette' }
use { 'kchmck/vim-coffee-script' }
use {
'folke/trouble.nvim',