diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d7ad043 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +plugin/ diff --git a/README.md b/README.md index 9576b94..ae8fe62 100644 --- a/README.md +++ b/README.md @@ -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
Ctrl+g | show current code chunk changes | |
<leader>hb - | show full git blame of current line - | |
<leader>hD | show splitted blame diff + | show full git blame of current line (double use to enter displayed diff) + |
<leader>hD | show splitted blame diff (double use to enter displayed diff) | |
<leader>hd | show splitted diff | |
<leader>hr | reset hunk | |
<leader>hR | reset whole buffer
diff --git a/init.vim b/init.vim
index 56fbd49..cf79636 100644
--- a/init.vim
+++ b/init.vim
@@ -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")
diff --git a/lua/general.lua b/lua/general.lua
index 829d61a..11f93bc 100644
--- a/lua/general.lua
+++ b/lua/general.lua
@@ -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,
diff --git a/lua/my-lspconfig.lua b/lua/my-lspconfig.lua
index 2bdf48d..4eab40b 100644
--- a/lua/my-lspconfig.lua
+++ b/lua/my-lspconfig.lua
@@ -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 = ' |