RltvNmbr.vim
packer.nvim
RltvNmbr.vim | packer.nvim | |
---|---|---|
1 | 180 | |
19 | 7,603 | |
- | - | |
10.0 | 3.4 | |
over 13 years ago | 2 months ago | |
VimL | Lua | |
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
RltvNmbr.vim
-
Unable to exit from visual mode using lua
require("packer").startup(function() use "https://github.com/wbthomason/packer.nvim" use "https://github.com/nvim-treesitter/nvim-treesitter" use "https://github.com/vim-scripts/RltvNmbr.vim" end) require'nvim-treesitter.configs'.setup { ensure_installed = {"c", "cpp", "go", "python", "javascript", "html", "lua"}, highlight = { enable = true }, indent = { enable = true } } function map(modes, key, value, opts) for i=1, string.len(modes) do local mode = string.sub(modes, i, i) vim.keymap.set(mode, key, value, opts) end end --[[https://www.reddit.com/r/neovim/comments/klnb2d/cant_get_nvim_exec_to_work/ https://github.com/neovim/neovim/pull/16594 https://www.reddit.com/r/neovim/comments/muxuc3/difference_between_the_various_vim_apis/ https://dev.to/voyeg3r/writing-useful-lua-functions-to-my-neovim-14ki --]] function smartIndent() --https://vi.stackexchange.com/questions/31189/how-can-i-get-the-current-cursor-position-in-lua local currLine, currCol = unpack(a.nvim_win_get_cursor(0)) --editor cmd into scripting cmd --https://learnvimscriptthehardway.stevelosh.com/chapters/29.html --! => nore a.nvim_command("normal! gg=G") --https://stackoverflow.com/questions/1405583/concatenation-of-strings-in-lua a.nvim_command("normal! " .. currLine .. "G") end --https://vi.stackexchange.com/questions/38352/passing-a-count-to-a-user-command-with-neovims-lua-api function smartShift(lines, right2left) --local arg = vim.fn.getchar() local currLine, currCol = unpack(a.nvim_win_get_cursor(0)) for i=1, lines do if (right2left == true) then a.nvim_command("normal! <<") else a.nvim_command("normal! >>") end a.nvim_command("normal! " .. currLine+i .. "G") end a.nvim_command("normal! " .. currLine .. "G") end function bracketIt() end function smartWindow() local arg = vim.fn.getchar() end function smartIncrement() _, cerow, cecol, _ = unpack(vim.fn.getpos(".")) _, csrow, cscol, _ = unpack(vim.fn.getpos("v")) a.nvim_command("normal Esc") a.nvim_command("normal!u") print(csrow, cerow) end a = vim.api o = vim.opt local options = { --:set wrap = false, splitbelow = true, splitright = true, hlsearch = false, autoindent = true, smartindent = true, relativenumber = true, number = true, mouse = "a", smarttab = true, softtabstop = 4, shiftwidth = 4, tabstop = 4, expandtab = true, foldnestmax = 1, foldmethod = "expr", foldexpr = "nvim_treesitter#foldexpr()", --https://stackoverflow.com/questions/30691466/what-is-difference-between-vims-clipboard-unnamed-and-unnamedplus-settings --o.clipboard:append {"unnamedplus"} clipboard = o.clipboard + "unnamedplus", --https://www.reddit.com/r/neovim/comments/o8dlwg/how_to_append_to_an_option_in_lua/ --o.iskeyword:append {"-", "_"} iskeyword = o.iskeyword + "-" + "_", scrolloff = 999 } for k, v in pairs(options) do vim.opt[k] = v end local commands = { -- https://www.reddit.com/r/neovim/comments/ozo7xl/how_to_map_commands_in_lua/ "command W w", "command Q q", "set cursorline cursorlineopt=screenline,number", } for k, v in pairs(commands) do a.nvim_command(v) end local autocmds = { --https://vi.stackexchange.com/questions/5680/how-can-i-set-number-and-relativenumber-at-the-same-time --https://stackoverflow.com/questions/6821033/vim-how-to-run-a-command-immediately-when-starting-vim --ex commands {{"VimEnter "}, {pattern = "*", command = ":RltvNmbr"}} } --https://alpha2phi.medium.com/neovim-for-beginners-lua-autocmd-and-keymap-functions-3bdfe0bebe42 for k, v in pairs(autocmds) do a.nvim_create_autocmd(v[1], v[2]) end local keybindings = { {"v", "n", "", {silent = false, noremap = true, callback = smartIncrement}}, {"n", "", ":resize -1", {silent = false, noremap = true}}, {"n", "", ":resize +1", {silent = false, noremap = true}}, {"n", "", ":vertical resize -2", {silent = false, noremap = true}}, {"n", "", ":vertical resize +2", {silent = false, noremap = true}}, {"n", "", "", {silent = false, noremap = true, callback = smartSave}}, {"n", "", "", {silent = false, noremap = true, callback = smartWindow}}, {"n", "", "h", {silent = false, noremap = true}}, {"n", "", "j", {silent = false, noremap = true}}, {"n", "", "k", {silent = false, noremap = true}}, {"n", "", "l", {silent = false, noremap = true}}, {"nv", "p", '"+p', { silent=false, noremap=true}}, {"nv", "y", '"+y', { silent=false, noremap=true}}, {"nv", "c", '"_c', { silent=false, noremap=true}}, {"nv", "d", '"_d', { silent=false, noremap=true}}, {"nv", "x", '"_x', { silent=false, noremap=true}}, {"n", "+", "", {silent=false, noremap=true}}, {"n", "-", "", {silent=false, noremap=true}}, --https://www.bigsmoke.us/readline/shortcuts {"i", "", "ha", {silent = false, noremap = true}}, {"ni", "", "d^x==i", {silent = false, noremap = true}}, --0 => beginning of line, ^ => first char {"i", "", "A", {silent=false, noremap=true}}, {"i", "", "I", {silent=false, noremap=true}}, {"i", "", "d$a", {silent=false, noremap=true}}, {"n", "", "", { silent=false, noremap=false, callback=smartIndent}}, --https://www.reddit.com/r/neovim/comments/xxah83/comment/irb5ivq/?context=3 --https://superuser.com/questions/410847/how-do-you-create-a-vim-key-mapping-that-requires-numbers-before-the-hotkey-lik --https://www.reddit.com/r/neovim/comments/sjiwox/question_give_arguments_to_vimkeymapsets_function/ --https://www.reddit.com/r/neovim/comments/rq2vm5/how_to_pass_vcount_to_a_lua_function/ --https://www.linuxquestions.org/questions/programming-9/vim-how-pass-argument-to-key-mapping-933036/ {"nv", "s", function() smartShift(vim.v.count, true) end, { silent=false, noremap=false}}, {"nv", "S", function() smartShift(vim.v.count, false) end, { silent=false, noremap=false}} } for k, v in pairs(keybindings) do map(v[1], v[2], v[3], v[4]) end
packer.nvim
-
thethethe.nvim - neovim friendly autocorrect plugin
packer
-
Help Enablin Powerline Font for Lightline in Kitty NeoVim
-- Check if Packer.nvim is already installed if fn.empty(fn.glob(install_path)) > 0 then -- If not installed, clone it from GitHub fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) -- Load Packer.nvim vim.cmd [[packadd packer.nvim]] return true end return false end
-
Installing neovim on windows 10 does not work (no really, it doesn't)
local ensure_packer = function() local fn = vim.fn local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' if fn.empty(fn.glob(install_path)) > 0 then fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) vim.cmd [[packadd packer.nvim]] return true end return false end
-
Issue with treesitter highlights, disappears after 5 seconds each time
local fn = vim.fn -- Automatically install packer local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" if fn.empty(fn.glob(install_path)) > 0 then PACKER_BOOTSTRAP = fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path, }) print("Installing packer close and reopen Neovim...") vim.cmd([[packadd packer.nvim]]) end -- Autocommand that reloads neovim whenever you save the plugins.lua file vim.cmd([[ augroup packer_user_config autocmd! autocmd BufWritePost plugins.lua source | PackerSync augroup end ]]) -- Use a protected call so we don't error out on first use local status_ok, packer = pcall(require, "packer") if not status_ok then return end -- Have packer use a popup window packer.init({ display = { open_fn = function() return require("packer.util").float({ border = "rounded" }) end, }, }) -- Install your plugins here return packer.startup(function(use) -- My plugins here use({ "wbthomason/packer.nvim" }) -- Have packer manage itself use({ "nvim-lua/plenary.nvim" }) -- Useful lua functions used by lots of plugins use({ "windwp/nvim-autopairs" }) -- Autopairs, integrates with both cmp and treesitter use({ "numToStr/Comment.nvim" }) use({ "JoosepAlviste/nvim-ts-context-commentstring" }) use({ "kyazdani42/nvim-web-devicons" }) use({ "akinsho/bufferline.nvim" }) use({ "moll/vim-bbye" }) use({ "nvim-lualine/lualine.nvim" }) use({ "akinsho/toggleterm.nvim" }) use({ "ahmedkhalf/project.nvim" }) use({ "lewis6991/impatient.nvim" }) use({ "lukas-reineke/indent-blankline.nvim" }) use({ "goolord/alpha-nvim" }) use("folke/which-key.nvim") -- Colorschemes use({ "folke/tokyonight.nvim" }) use("lunarvim/darkplus.nvim") use("bluz71/vim-moonfly-colors") use("fcpg/vim-fahrenheit") use("rainglow/vim") use("wojciechkepka/vim-github-dark") use("gavinok/spaceway.vim") use({"mcchrish/zenbones.nvim", requires = "rktjmp/lush.nvim"}) use({ "ellisonleao/gruvbox.nvim" }) -- Gruvbox theme -- LSP use({ "neovim/nvim-lspconfig" }) -- enable LSP use({ "williamboman/nvim-lsp-installer" }) -- simple to use language server installer use({ "jose-elias-alvarez/null-ls.nvim" }) -- for formatters and linters -- Telescope use({ "nvim-telescope/telescope.nvim" }) -- Treesitter use("nvim-treesitter/nvim-treesitter", {run = ':TSUpdate'}) use("nvim-treesitter/nvim-treesitter-context") use("nvim-treesitter/playground") -- Editor plugins use({ "karb94/neoscroll.nvim" }) -- Git use({ "lewis6991/gitsigns.nvim" }) -- LSP Zero use { 'VonHeikemen/lsp-zero.nvim', requires = { -- LSP Support {'neovim/nvim-lspconfig'}, -- Required {'williamboman/mason.nvim'}, -- Optional {'williamboman/mason-lspconfig.nvim'}, -- Optional -- Autocompletion {'hrsh7th/nvim-cmp'}, -- Required {'hrsh7th/cmp-buffer'}, {'hrsh7th/cmp-path'}, {'hrsh7th/cmp-nvim-lua'}, {'hrsh7th/cmp-nvim-lsp'}, -- Required {'L3MON4D3/LuaSnip'}, -- Required {'rafamadriz/friendly-snippets'}, } } -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if PACKER_BOOTSTRAP then require("packer").sync() end end)
-
Editing init.lua with lua_ls on gives "Undefined global : vim" ?
require('packer').startup(function(use) use 'https://github.com/wbthomason/packer.nvim' use 'https://github.com/neovim/nvim-lspconfig' end)
- error message whenever I write a file
-
[Help] Packer.nvim
git clone --depth 1 https://github.com/wbthomason/packer.nvim\ ~/.local/share/nvim/site/pack/packer/start/packer.nvim
-
Pyright Won't Let me Quit Python Files
``` vim.g.maplocalleader = " " vim.g.mapleader = " " local ensure_packer = function() local fn = vim.fn local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" if fn.empty(fn.glob(install_path)) > 0 then fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path }) vim.cmd([[packadd packer.nvim]]) return true end return false end
- [Neovim] Gestionnaire de packages basé à Lua
What are some alternatives?
vim-plug - :hibiscus: Minimalist Vim Plugin Manager
lazy.nvim - 💤 A modern plugin manager for Neovim
nvim-treesitter - Nvim Treesitter configurations and abstraction layer
nvim-lspconfig - Quickstart configs for Nvim LSP
paq-nvim - 🌚 Neovim package manager
gruvbox.nvim - Lua port of the most famous vim colorscheme
nvim-lua-guide - A guide to using Lua in Neovim
nvim-tree.lua - A file explorer tree for neovim written in lua
NvChad - Blazing fast Neovim config providing solid defaults and a beautiful UI, enhancing your neovim experience.
mason-lspconfig.nvim - Extension to mason.nvim that makes it easier to use lspconfig with mason.nvim.
LunarVim - 🌙 LunarVim is an IDE layer for Neovim. Completely free and community driven.
iron.nvim - Interactive Repl Over Neovim