change plugin manager to packer, add lsp-signature plugin

This commit is contained in:
Szwendacz99 2022-12-21 14:25:50 +01:00
parent be1be8de9c
commit 754a0006e9
6 changed files with 147 additions and 81 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
plugin/

View file

@ -23,17 +23,14 @@ sudo dnf install \
tree-sitter-cli \
wl-clipboard \
dejavu-fonts-all \
gnu-free-mono-fonts
gnu-free-mono-fonts \
clang \
perl-App-cpanminus # optional, allow perlnavigator lsp working properly
pip install \
pynvim \
'python-lsp-server[all]' \
flake8 \
pyright
pip install pynvim
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
git clone --depth 1 https://github.com/wbthomason/packer.nvim\
~/.local/share/nvim/site/pack/packer/start/packer.nvim
```
#####
@ -42,10 +39,14 @@ sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.
##### Inside vim
```
:PlugInstall
:PackerInstall
:PackerSync
# installing packages, which mason-lspconfig cannot autoinstall (?)
:MasonInstall phpcs
# tree-sitter setup
:TSInstall html dockerfile cpp css markdown c gitcommit bash phpdoc comment python http php regex json5 lua gitattributes gitignore json git_rebase javascript perl sql yaml
```
On Fedora there is need to make sure your system can display any unicode character. Hacked fonts are needed for filetype icons but there is also need for a dedicated package with unicode fonts (like unifont-fonts.noarch) that will have every character missing from default font used in Neovim editor. Link to hacked fonts:
@ -149,8 +150,8 @@ Mason installs stuff in `.local/share/nvim/mason/packages` so they are independe
<table border="1" id="bkmrk-ctrl%2Bs-show-current-" style="border-collapse: collapse; width: 100%; height: 208.6px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl+g
</td><td style="height: 29.8px;">show current code chunk changes</td></tr><tr><td>&lt;leader&gt;hb
</td><td>show full git blame of current line
</td></tr><tr><td>&lt;leader&gt;hD</td><td>show splitted blame diff
</td><td>show full git blame of current line (double use to enter displayed diff)
</td></tr><tr><td>&lt;leader&gt;hD</td><td>show splitted blame diff (double use to enter displayed diff)
</td></tr><tr><td>&lt;leader&gt;hd</td><td>show splitted diff</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;hr
</td><td style="height: 29.8px;">reset hunk
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;hR</td><td style="height: 29.8px;">reset whole buffer

View file

@ -1,67 +1,9 @@
call plug#begin()
" NERDTree stuff
Plug 'nvim-tree/nvim-web-devicons' " optional, for file icons
Plug 'nvim-tree/nvim-tree.lua'
" neovim lsp plugins and depencencies
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/nvim-cmp'
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
Plug 'mfussenegger/nvim-lint'
Plug 'onsails/lspkind.nvim'
" various plugins
Plug 'lewis6991/gitsigns.nvim'
Plug 'petertriho/nvim-scrollbar'
Plug 'kevinhwang91/nvim-hlslens'
Plug 'windwp/nvim-ts-autotag'
Plug 'hrsh7th/cmp-path'
Plug 'L3MON4D3/LuaSnip', {'tag': '*'}
Plug 'saadparwaiz1/cmp_luasnip'
Plug 'lambdalisue/suda.vim'
Plug 'akinsho/bufferline.nvim', { 'tag': '*' }
Plug 'gorbit99/codewindow.nvim'
Plug 'preservim/nerdcommenter'
Plug 'rmagatti/auto-session'
Plug 'tpope/vim-fugitive'
Plug 'Glench/Vim-Jinja2-Syntax'
Plug 'vmware-archive/salt-vim'
Plug 'nvim-lualine/lualine.nvim'
Plug 'itchyny/vim-cursorword'
Plug 'sheerun/vim-polyglot'
" themes
Plug 'folke/tokyonight.nvim', { 'branch': 'main' }
Plug 'olimorris/onedarkpro.nvim'
Plug 'ellisonleao/gruvbox.nvim'
Plug 'Mofiqul/dracula.nvim'
Plug 'vigoux/oak'
Plug 'NLKNguyen/papercolor-theme'
Plug 'bluz71/vim-moonfly-colors'
Plug 'luisiacc/gruvbox-baby'
Plug 'catppuccin/nvim'
Plug 'EdenEast/nightfox.nvim'
Plug 'projekt0n/github-nvim-theme'
"Fuzzy search by Telescope and its dependencies:
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' }
Plug 'BurntSushi/ripgrep'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
call plug#end()
" set termguicolors before lua config,
" as it can contain some theme stuff that
" checks for termguicolors
set termguicolors
" load main lua file with additional configs
lua require("packer-setup")
lua require("general")
lua require("my-lspconfig")
lua require("my-lint")

View file

@ -257,7 +257,6 @@ cmp.setup.cmdline(':', {
})
require("nvim-tree").setup({
create_in_closed_folder = true,
hijack_cursor = true,
open_on_setup = true,
open_on_setup_file = true,

View file

@ -35,6 +35,68 @@ end
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- config for ray-x/lsp_signature.nvim
local cfg = {
debug = false, -- set to true to enable debug logging
log_path = vim.fn.stdpath("cache") .. "/lsp_signature.log", -- log dir when debug is on
-- default is ~/.cache/nvim/lsp_signature.log
verbose = false, -- show debug line number
bind = true, -- This is mandatory, otherwise border config won't get registered.
-- If you want to hook lspsaga or other signature handler, pls set to false
doc_lines = 10, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
-- set to 0 if you DO NOT want any API comments be shown
-- This setting only take effect in insert mode, it does not affect signature help in normal
-- mode, 10 by default
max_height = 12, -- max height of signature floating_window
max_width = 80, -- max_width of signature floating_window
noice = false, -- set to true if you using noice to render markdown
wrap = true, -- allow doc/signature text wrap inside floating_window, useful if your lsp return doc/sig is too long
floating_window = true, -- show hint in a floating window, set to false for virtual text only mode
floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note:
-- will set to true when fully tested, set to false will use whichever side has more space
-- this setting will be helpful if you do not want the PUM and floating win overlap
floating_window_off_x = 1, -- adjust float windows x position.
floating_window_off_y = 0, -- adjust float windows y position. e.g -2 move window up 2 lines; 2 move down 2 lines
-- can be either number or function, see examples
close_timeout = 4000, -- close floating window after ms when laster parameter is entered
fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters
hint_enable = true, -- virtual hint enable
hint_prefix = "🐼 ", -- Panda for parameter, NOTE: for the terminal not support emoji, might crash
hint_scheme = "String",
hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight
handler_opts = {
border = "rounded" -- double, rounded, single, shadow, none, or a table of borders
},
always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58
auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil.
extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","}
zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom
padding = '', -- character to pad on left and right of signature can be ' ', or '|' etc
transparency = nil, -- disabled by default, allow floating win transparent value 1~100
shadow_blend = 36, -- if you using shadow as border use this set the opacity
shadow_guibg = 'Black', -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency
toggle_key = nil, -- toggle signature on and off in insert mode, e.g. toggle_key = '<M-x>'
select_signature_key = nil, -- cycle to next signature, e.g. '<M-n>' function overloading
move_cursor_key = nil, -- imap, use nvim_set_current_win to move cursor between current win and floating
}
-- recommended:
require 'lsp_signature'.setup(cfg) -- no need to specify bufnr if you don't use toggle_key
require 'lspconfig'.pyright.setup {
on_attach = on_attach,
capabilities = capabilities,
@ -46,12 +108,14 @@ require 'lspconfig'.pylsp.setup {
pylsp = {
plugins = {
flake8 = {
enabled = 1
enabled = true
},
pylint = {
enabled = true,
args = {
'--disable=C0114' -- disable missing module docstring info
-- disable missing module docstring info
-- and temporarilt false cannot import errors
'--disable=C0114,E0401'
}
},
yapf = {
@ -60,8 +124,8 @@ require 'lspconfig'.pylsp.setup {
autopep8 = {
enabled = false
},
pyflakes = {enabled = true},
pyodestyle = {enabled = true},
pyflakes = { enabled = true },
pyodestyle = { enabled = true },
pydocstyle = {
enabled = false,
ignore = {
@ -75,11 +139,11 @@ require 'lspconfig'.pylsp.setup {
}
}
}
--require 'lspconfig'.pyre.setup {
--on_attach = on_attach,
--capabilities = capabilities,
--}
require'lspconfig'.sourcekit.setup{
require 'lspconfig'.pyre.setup {
on_attach = on_attach,
capabilities = capabilities,
}
require 'lspconfig'.sourcekit.setup {
on_attach = on_attach,
capabilities = capabilities,
}

59
lua/packer-setup.lua Normal file
View file

@ -0,0 +1,59 @@
return require('packer').startup(function(use)
-- Packer can manage itself
use 'wbthomason/packer.nvim'
-- NERDTree stuff
use 'nvim-tree/nvim-web-devicons' -- optional, for file icons
use 'nvim-tree/nvim-tree.lua'
-- neovim lsp plugins and depencencies
use 'neovim/nvim-lspconfig'
use 'hrsh7th/cmp-nvim-lsp'
use 'hrsh7th/cmp-buffer'
use 'hrsh7th/nvim-cmp'
use 'williamboman/mason.nvim'
use 'williamboman/mason-lspconfig.nvim'
use 'mfussenegger/nvim-lint'
use 'onsails/lspkind.nvim'
-- various plugins
use 'lewis6991/gitsigns.nvim'
use 'petertriho/nvim-scrollbar'
use 'kevinhwang91/nvim-hlslens'
use 'windwp/nvim-ts-autotag'
use 'hrsh7th/cmp-path'
use { 'L3MON4D3/LuaSnip', tag = '*' }
use 'saadparwaiz1/cmp_luasnip'
use 'lambdalisue/suda.vim'
use { 'akinsho/bufferline.nvim', tag = '*' }
use 'gorbit99/codewindow.nvim'
use 'preservim/nerdcommenter'
use 'rmagatti/auto-session'
use 'tpope/vim-fugitive'
use 'Glench/Vim-Jinja2-Syntax'
use 'vmware-archive/salt-vim'
use 'nvim-lualine/lualine.nvim'
use 'itchyny/vim-cursorword'
use 'sheerun/vim-polyglot'
use 'ray-x/lsp_signature.nvim'
-- themes
use 'olimorris/onedarkpro.nvim'
use 'ellisonleao/gruvbox.nvim'
use 'Mofiqul/dracula.nvim'
use 'vigoux/oak'
use 'NLKNguyen/papercolor-theme'
use 'bluz71/vim-moonfly-colors'
use 'luisiacc/gruvbox-baby'
use 'catppuccin/nvim'
use 'EdenEast/nightfox.nvim'
use 'projekt0n/github-nvim-theme'
--Fuzzy search by Telescope and its dependencies:
use {
'nvim-telescope/telescope.nvim', branch = 'master',
requires = { { 'nvim-lua/plenary.nvim' } }
}
use 'BurntSushi/ripgrep'
use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }
end)