From 3a918ea5fe45f1412b9a9c4943f2d4e47624fb04 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Sun, 14 Aug 2022 20:36:32 +0300 Subject: [PATCH] Neovim: add signature help plugin + make use of quotes consistent --- .../nvim/lua/pluginconf/bufferline.lua | 2 +- .../nvim/lua/pluginconf/colorscheme.lua | 26 +++++++++---------- .../nvim/lua/pluginconf/completion.lua | 2 +- .../nvim/lua/pluginconf/indent-blankline.lua | 4 +-- home/.config/nvim/lua/pluginconf/lsp.lua | 11 +++++--- .../nvim/lua/pluginconf/treesitter.lua | 6 ++--- home/.config/nvim/lua/pluginmanager.lua | 13 ++++++---- 7 files changed, 35 insertions(+), 29 deletions(-) diff --git a/home/.config/nvim/lua/pluginconf/bufferline.lua b/home/.config/nvim/lua/pluginconf/bufferline.lua index 1c295dc..c8834f1 100644 --- a/home/.config/nvim/lua/pluginconf/bufferline.lua +++ b/home/.config/nvim/lua/pluginconf/bufferline.lua @@ -1 +1 @@ -require("bufferline").setup{} +require('bufferline').setup{} diff --git a/home/.config/nvim/lua/pluginconf/colorscheme.lua b/home/.config/nvim/lua/pluginconf/colorscheme.lua index f176fb1..9dfe8d6 100644 --- a/home/.config/nvim/lua/pluginconf/colorscheme.lua +++ b/home/.config/nvim/lua/pluginconf/colorscheme.lua @@ -1,11 +1,11 @@ -require("catppuccin").setup({ +require('catppuccin').setup({ transparent_background = false, term_colors = false, - compile = {enabled = true, path = vim.fn.stdpath "cache" .. "/catppuccin"}, + compile = {enabled = true, path = vim.fn.stdpath 'cache' .. '/catppuccin'}, styles = { - comments = {"italic"}, - functions = {"italic"}, - keywords = {"italic"}, + comments = {'italic'}, + functions = {'italic'}, + keywords = {'italic'}, strings = {}, variables = {} }, @@ -14,16 +14,16 @@ require("catppuccin").setup({ native_lsp = { enabled = true, virtual_text = { - errors = {"italic"}, - hints = {"italic"}, - warnings = {"italic"}, - information = {"italic"} + errors = {'italic'}, + hints = {'italic'}, + warnings = {'italic'}, + information = {'italic'} }, underlines = { - errors = {"underline"}, - hints = {"underline"}, - warnings = {"underline"}, - information = {"underline"} + errors = {'underline'}, + hints = {'underline'}, + warnings = {'underline'}, + information = {'underline'} } }, lsp_trouble = false, diff --git a/home/.config/nvim/lua/pluginconf/completion.lua b/home/.config/nvim/lua/pluginconf/completion.lua index 2684f59..85605a3 100644 --- a/home/.config/nvim/lua/pluginconf/completion.lua +++ b/home/.config/nvim/lua/pluginconf/completion.lua @@ -54,4 +54,4 @@ cmp.setup { } -- load friendly-snippets to luasnip -require("luasnip/loaders/from_vscode").lazy_load() +require('luasnip/loaders/from_vscode').lazy_load() diff --git a/home/.config/nvim/lua/pluginconf/indent-blankline.lua b/home/.config/nvim/lua/pluginconf/indent-blankline.lua index 58c522b..1adbce2 100644 --- a/home/.config/nvim/lua/pluginconf/indent-blankline.lua +++ b/home/.config/nvim/lua/pluginconf/indent-blankline.lua @@ -1,7 +1,7 @@ vim.opt.list = true -require("indent_blankline").setup { - space_char_blankline = " ", +require('indent_blankline').setup { + space_char_blankline = ' ', show_current_context = true, show_current_context_start = true, } diff --git a/home/.config/nvim/lua/pluginconf/lsp.lua b/home/.config/nvim/lua/pluginconf/lsp.lua index f1a6f7b..c7475b3 100644 --- a/home/.config/nvim/lua/pluginconf/lsp.lua +++ b/home/.config/nvim/lua/pluginconf/lsp.lua @@ -1,4 +1,4 @@ -local lsp_installer = require("nvim-lsp-installer") +local lsp_installer = require('nvim-lsp-installer') local M = {} @@ -47,15 +47,18 @@ end local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) +-- Setup LSP signature plugin +require('lsp_signature').setup() + -- Register a handler that will be called for all installed servers. lsp_installer.on_server_ready(function(server) -- Don't setup jdtls here since it is done by nvim-jdtls - if server.name == "jdtls" then return end + if server.name == 'jdtls' then return end local opts = {} -- Lua specific settings - if server.name == "sumneko_lua" then + if server.name == 'sumneko_lua' then local runtime_path = vim.split(package.path, ';') opts.settings = { Lua = { @@ -71,7 +74,7 @@ lsp_installer.on_server_ready(function(server) }, workspace = { -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true) + library = vim.api.nvim_get_runtime_file('', true) }, -- Do not send telemetry data containing a randomized but unique identifier telemetry = {enable = false} diff --git a/home/.config/nvim/lua/pluginconf/treesitter.lua b/home/.config/nvim/lua/pluginconf/treesitter.lua index 6370d4f..b3abded 100644 --- a/home/.config/nvim/lua/pluginconf/treesitter.lua +++ b/home/.config/nvim/lua/pluginconf/treesitter.lua @@ -1,8 +1,8 @@ require'nvim-treesitter.configs'.setup { ensure_installed = { - "bash", "c", "css", "dockerfile", "html", "http", "java", "json", - "json5", "latex", "lua", "make", "markdown", "php", "python", "regex", - "rst", "scss", "toml", "tsx", "typescript", "javascript", "yaml" + 'bash', 'c', 'css', 'dockerfile', 'html', 'http', 'java', 'json', + 'json5', 'latex', 'lua', 'make', 'markdown', 'php', 'python', 'regex', + 'rst', 'scss', 'toml', 'tsx', 'typescript', 'javascript', 'yaml' }, highlight = {enable = true}, indent = {enable = true}, diff --git a/home/.config/nvim/lua/pluginmanager.lua b/home/.config/nvim/lua/pluginmanager.lua index 07fa44c..b34936b 100644 --- a/home/.config/nvim/lua/pluginmanager.lua +++ b/home/.config/nvim/lua/pluginmanager.lua @@ -20,7 +20,7 @@ require('packer').startup(function() use {'wbthomason/packer.nvim', opt = true} -- Colorscheme - use({"catppuccin/nvim", as = "catppuccin"}) + use({'catppuccin/nvim', as = 'catppuccin'}) -- Git in signcolumn use 'airblade/vim-gitgutter' @@ -34,7 +34,7 @@ require('packer').startup(function() -- Tabline/bufferline use { 'akinsho/nvim-bufferline.lua', - tag = "*", + tag = '*', requires = 'kyazdani42/nvim-web-devicons' } @@ -42,7 +42,7 @@ require('packer').startup(function() use 'tpope/vim-fugitive' -- Indent characters - use "lukas-reineke/indent-blankline.nvim" + use 'lukas-reineke/indent-blankline.nvim' -- Tree explorer use {'kyazdani42/nvim-tree.lua', requires = 'kyazdani42/nvim-web-devicons'} @@ -70,13 +70,16 @@ require('packer').startup(function() -- Additional LSP features for Java use 'mfussenegger/nvim-jdtls' + -- Display function signature + use {'ray-x/lsp_signature.nvim'} + -- Completion use 'hrsh7th/nvim-cmp' -- Autocompletion plugin use 'hrsh7th/cmp-nvim-lsp' -- LSP source for nvim-cmp use 'hrsh7th/cmp-path' -- Path source for nvim-cmp use 'saadparwaiz1/cmp_luasnip' -- Snippets source for nvim-cmp use 'L3MON4D3/LuaSnip' -- Snippets plugin - use "rafamadriz/friendly-snippets" -- Snippets collection + use 'rafamadriz/friendly-snippets' -- Snippets collection -- treesitter syntax highlight use { @@ -118,7 +121,7 @@ require('packer').startup(function() use 'habamax/vim-asciidoctor' -- Modern filetype.vim replacement - use("nathom/filetype.nvim") + use('nathom/filetype.nvim') end)