RltvNmbr.vim

Display relative line numbers (by vim-scripts)

RltvNmbr.vim Alternatives

Similar projects and alternatives to RltvNmbr.vim

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better RltvNmbr.vim alternative or higher similarity.

RltvNmbr.vim reviews and mentions

Posts with mentions or reviews of RltvNmbr.vim. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-10-19.
  • Unable to exit from visual mode using lua
    4 projects | /r/u_matteomanu | 19 Oct 2022
    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

Stats

Basic RltvNmbr.vim repo stats
1
19
10.0
over 13 years ago

The primary programming language of RltvNmbr.vim is VimL.


Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com