commit
366bbcd19d
@ -0,0 +1 @@
|
|||||||
|
lazy-lock.json
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
-- keymaps goes first because it sets the leader key
|
||||||
|
require("keymaps")
|
||||||
|
require("set")
|
||||||
|
|
||||||
|
require("lazy").setup("plugins")
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
-- CONVENIENCE DEFAULT REMAPS
|
||||||
|
vim.keymap.set('n', '<C-d>', '<C-d>zz')
|
||||||
|
vim.keymap.set('n', '<C-u>', '<C-u>zz')
|
||||||
|
vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]])
|
||||||
|
vim.keymap.set({ "n", "v" }, "<leader>p", [["+p]])
|
||||||
|
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||||
|
vim.keymap.set({ "n", "v" }, "<leader>d", [["_d]])
|
||||||
|
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
'numToStr/Comment.nvim',
|
||||||
|
config = function()
|
||||||
|
require('Comment').setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
"tpope/vim-fugitive"
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
return {
|
||||||
|
'lewis6991/gitsigns.nvim',
|
||||||
|
config = function()
|
||||||
|
require('gitsigns').setup {
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
|
local function map(mode, l, r, opts)
|
||||||
|
opts = opts or {}
|
||||||
|
opts.buffer = bufnr
|
||||||
|
vim.keymap.set(mode, l, r, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Navigation
|
||||||
|
map('n', ']c', function()
|
||||||
|
if vim.wo.diff then return ']c' end
|
||||||
|
vim.schedule(function() gs.next_hunk() end)
|
||||||
|
return '<Ignore>'
|
||||||
|
end, { expr = true })
|
||||||
|
|
||||||
|
map('n', '[c', function()
|
||||||
|
if vim.wo.diff then return '[c' end
|
||||||
|
vim.schedule(function() gs.prev_hunk() end)
|
||||||
|
return '<Ignore>'
|
||||||
|
end, { expr = true })
|
||||||
|
|
||||||
|
-- Actions
|
||||||
|
map({ 'n', 'v' }, '<leader>hs', ':Gitsigns stage_hunk<CR>')
|
||||||
|
map({ 'n', 'v' }, '<leader>hr', ':Gitsigns reset_hunk<CR>')
|
||||||
|
map('n', '<leader>hS', gs.stage_buffer)
|
||||||
|
map('n', '<leader>hu', gs.undo_stage_hunk)
|
||||||
|
map('n', '<leader>hR', gs.reset_buffer)
|
||||||
|
map('n', '<leader>hp', gs.preview_hunk)
|
||||||
|
map('n', '<leader>hb', function() gs.blame_line { full = true } end)
|
||||||
|
map('n', '<leader>tb', gs.toggle_current_line_blame)
|
||||||
|
map('n', '<leader>hd', gs.diffthis)
|
||||||
|
map('n', '<leader>hD', function() gs.diffthis('~') end)
|
||||||
|
map('n', '<leader>td', gs.toggle_deleted)
|
||||||
|
|
||||||
|
-- Text object
|
||||||
|
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
@ -0,0 +1,214 @@
|
|||||||
|
return {
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
'hrsh7th/nvim-cmp', -- Autocompletion plugin
|
||||||
|
'hrsh7th/cmp-nvim-lsp', -- LSP source for nvim-cmp
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
{
|
||||||
|
'jose-elias-alvarez/null-ls.nvim',
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
config = function()
|
||||||
|
local null_ls = require("null-ls")
|
||||||
|
|
||||||
|
local sources = {
|
||||||
|
-- python
|
||||||
|
null_ls.builtins.formatting.black.with({
|
||||||
|
extra_args = { "--line-length=79" }
|
||||||
|
}),
|
||||||
|
null_ls.builtins.formatting.isort,
|
||||||
|
null_ls.builtins.diagnostics.flake8,
|
||||||
|
-- java euh script
|
||||||
|
null_ls.builtins.formatting.prettier,
|
||||||
|
null_ls.builtins.code_actions.eslint,
|
||||||
|
null_ls.builtins.diagnostics.eslint,
|
||||||
|
-- convienence
|
||||||
|
null_ls.builtins.code_actions.gitsigns,
|
||||||
|
-- Docker
|
||||||
|
null_ls.builtins.diagnostics.hadolint,
|
||||||
|
-- TailwindCSS
|
||||||
|
null_ls.builtins.formatting.rustywind.with({
|
||||||
|
filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte",
|
||||||
|
"html", "rust" },
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
local lspconfig = require('lspconfig')
|
||||||
|
|
||||||
|
-- Add additional capabilities supported by nvim-cmp
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
local on_attach = function(_, bufnr)
|
||||||
|
local opts = { buffer = bufnr, remap = false }
|
||||||
|
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||||
|
vim.keymap.set("n", "<leader>k", function() vim.lsp.buf.hover() end, opts)
|
||||||
|
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||||
|
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||||
|
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||||
|
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||||
|
vim.keymap.set("n", "<leader>ca", function() vim.lsp.buf.code_action() end, opts)
|
||||||
|
vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, opts)
|
||||||
|
vim.keymap.set("n", "<leader>rn", function() vim.lsp.buf.rename() end, opts)
|
||||||
|
vim.keymap.set("i", "<C-k>", function() vim.lsp.buf.signature_help() end, opts)
|
||||||
|
vim.keymap.set("n", "<leader>fo", function() vim.lsp.buf.format() end, opts)
|
||||||
|
vim.keymap.set('n', '<Leader>D', vim.lsp.buf.type_definition, opts)
|
||||||
|
vim.keymap.set('n', '<Leader>e', vim.diagnostic.open_float, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
lspconfig.rust_analyzer.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
settings = {
|
||||||
|
['rust-analyzer'] = {
|
||||||
|
checkOnSave = {
|
||||||
|
allFeatures = true,
|
||||||
|
overrideCommand = {
|
||||||
|
'cargo', 'clippy', '--workspace', '--message-format=json',
|
||||||
|
'--all-targets', '--all-features'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.lua_ls.setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
version = 'LuaJIT',
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
globals = { 'vim' },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
},
|
||||||
|
telemetry = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.tsserver.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.vuels.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.pyright.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.bashls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.clangd.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- lspconfig.volar.setup {
|
||||||
|
-- filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json' },
|
||||||
|
-- capabilities = capabilities,
|
||||||
|
-- on_attach = on_attach,
|
||||||
|
-- }
|
||||||
|
|
||||||
|
-- Keep null_ls last so that its diagnostics and code actions come last
|
||||||
|
null_ls.setup({ sources = sources })
|
||||||
|
|
||||||
|
-- Global mappings.
|
||||||
|
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||||
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||||
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||||
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
||||||
|
|
||||||
|
-- Use LspAttach autocommand to only map the following keys
|
||||||
|
-- after the language server attaches to the current buffer
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||||
|
callback = function(ev)
|
||||||
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
|
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||||
|
|
||||||
|
-- Buffer local mappings.
|
||||||
|
local opts = { buffer = ev.buf }
|
||||||
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
||||||
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
||||||
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
||||||
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
|
||||||
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||||
|
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||||
|
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||||
|
vim.keymap.set('n', '<leader>wl', function()
|
||||||
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
end, opts)
|
||||||
|
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, opts)
|
||||||
|
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)
|
||||||
|
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, opts)
|
||||||
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
||||||
|
vim.keymap.set('n', '<leader>f', function()
|
||||||
|
vim.lsp.buf.format { async = true }
|
||||||
|
end, opts)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- nvim-cmp setup
|
||||||
|
local cmp = require 'cmp'
|
||||||
|
cmp.setup {
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down
|
||||||
|
-- C-b (back) C-f (forward) for snippet placeholder navigation.
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
['<CR>'] = cmp.mapping.confirm {
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = true,
|
||||||
|
},
|
||||||
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'luasnip' },
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Format on save
|
||||||
|
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"iamcco/markdown-preview.nvim",
|
||||||
|
event = "BufRead",
|
||||||
|
build = function()
|
||||||
|
vim.fn["mkdp#util#install"]()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
return {
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
tag = '0.1.1',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'debugloop/telescope-undo.nvim',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- TELESCOPE
|
||||||
|
local builtin = require('telescope.builtin')
|
||||||
|
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||||
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||||
|
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||||
|
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||||
|
vim.keymap.set('n', '<leader>fq', builtin.quickfix, {})
|
||||||
|
vim.keymap.set('n', '<leader>fr', builtin.lsp_references, {})
|
||||||
|
vim.keymap.set('n', '<leader>fw', builtin.lsp_workspace_symbols, {})
|
||||||
|
vim.keymap.set('n', '<leader>fd', builtin.diagnostics, {})
|
||||||
|
vim.keymap.set('n', '<leader>fc', builtin.git_commits, {})
|
||||||
|
|
||||||
|
-- TELESCOPE UNDO
|
||||||
|
require("telescope").setup({
|
||||||
|
extensions = {
|
||||||
|
undo = {
|
||||||
|
use_delta = true,
|
||||||
|
use_custom_command = nil, -- setting this implies `use_delta = false`. Accepted format is: { "bash", "-c", "echo '$DIFF' | delta" }
|
||||||
|
side_by_side = false,
|
||||||
|
diff_context_lines = vim.o.scrolloff,
|
||||||
|
entry_format = "state #$ID, $STAT, $TIME",
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
["<cr>"] = require("telescope-undo.actions").yank_additions,
|
||||||
|
["<S-cr>"] = require("telescope-undo.actions").yank_deletions,
|
||||||
|
["<C-cr>"] = require("telescope-undo.actions").restore,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require("telescope").load_extension("undo")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>u", "<cmd>Telescope undo<cr>")
|
||||||
|
end
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
'folke/tokyonight.nvim',
|
||||||
|
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
||||||
|
priority = 1000, -- make sure to load this before all the other start plugins
|
||||||
|
config = function()
|
||||||
|
-- load the colorscheme here
|
||||||
|
vim.cmd([[colorscheme tokyonight-night]])
|
||||||
|
end,
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
|
"nvim-treesitter/playground",
|
||||||
|
},
|
||||||
|
build = ":TSUpdate",
|
||||||
|
config = function()
|
||||||
|
require("nvim-treesitter.install").update({ with_sync = true })
|
||||||
|
|
||||||
|
require("nvim-treesitter.configs").setup {
|
||||||
|
ensure_installed = "all",
|
||||||
|
highlight = { enable = true, },
|
||||||
|
textobjects = {
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
lookahead = true,
|
||||||
|
keymaps = {
|
||||||
|
["af"] = "@function.outer",
|
||||||
|
["if"] = "@function.inner",
|
||||||
|
["ac"] = "@comment.outer",
|
||||||
|
["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" },
|
||||||
|
["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" },
|
||||||
|
["is"] = { query = "@scope", query_group = "locals", desc = "Select language scope" },
|
||||||
|
['al'] = '@loop.outer',
|
||||||
|
['il'] = '@loop.inner',
|
||||||
|
['aa'] = '@parameter.outer',
|
||||||
|
['ia'] = '@parameter.inner',
|
||||||
|
},
|
||||||
|
selection_modes = {
|
||||||
|
['@parameter.outer'] = 'v', -- charwise
|
||||||
|
['@function.outer'] = 'V', -- linewise
|
||||||
|
['@class.outer'] = '<c-v>', -- blockwise
|
||||||
|
},
|
||||||
|
include_surrounding_whitespace = true,
|
||||||
|
},
|
||||||
|
swap = {
|
||||||
|
enable = true,
|
||||||
|
swap_next = {
|
||||||
|
["<leader>a"] = "@parameter.inner",
|
||||||
|
},
|
||||||
|
swap_previous = {
|
||||||
|
["<leader>A"] = "@parameter.inner",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lsp_interop = {
|
||||||
|
enable = true,
|
||||||
|
border = 'none',
|
||||||
|
floating_preview_opts = {},
|
||||||
|
peek_definition_code = {
|
||||||
|
["<leader>gf"] = "@function.outer",
|
||||||
|
["<leader>gc"] = "@class.outer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
move = {
|
||||||
|
enable = true,
|
||||||
|
set_jumps = true, -- whether to set jumps in the jumplist
|
||||||
|
goto_next_start = {
|
||||||
|
["]m"] = "@function.outer",
|
||||||
|
["]]"] = { query = "@class.outer", desc = "Next class start" },
|
||||||
|
--
|
||||||
|
-- You can use regex matching (i.e. lua pattern) and/or pass a list in a "query" key to group multiple queires.
|
||||||
|
["]o"] = "@loop.*",
|
||||||
|
-- ["]o"] = { query = { "@loop.inner", "@loop.outer" } }
|
||||||
|
--
|
||||||
|
-- You can pass a query group to use query from `queries/<lang>/<query_group>.scm file in your runtime path.
|
||||||
|
-- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm.
|
||||||
|
["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" },
|
||||||
|
["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" },
|
||||||
|
},
|
||||||
|
goto_next_end = {
|
||||||
|
["]M"] = "@function.outer",
|
||||||
|
["]["] = "@class.outer",
|
||||||
|
},
|
||||||
|
goto_previous_start = {
|
||||||
|
["[m"] = "@function.outer",
|
||||||
|
["[["] = "@class.outer",
|
||||||
|
},
|
||||||
|
goto_previous_end = {
|
||||||
|
["[M"] = "@function.outer",
|
||||||
|
["[]"] = "@class.outer",
|
||||||
|
},
|
||||||
|
-- Below will go to either the start or the end, whichever is closer.
|
||||||
|
-- Use if you want more granular movements
|
||||||
|
-- Make it even more gradual by adding multiple queries and regex.
|
||||||
|
goto_next = {
|
||||||
|
["]i"] = "@conditional.outer",
|
||||||
|
},
|
||||||
|
goto_previous = {
|
||||||
|
["[i"] = "@conditional.outer",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local ts_repeat_move = require "nvim-treesitter.textobjects.repeatable_move"
|
||||||
|
|
||||||
|
-- Repeat movement with ; and ,
|
||||||
|
-- ensure ; goes forward and , goes backward regardless of the last direction
|
||||||
|
vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_next)
|
||||||
|
vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_previous)
|
||||||
|
|
||||||
|
-- vim way: ; goes to the direction you were moving.
|
||||||
|
-- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move)
|
||||||
|
-- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite)
|
||||||
|
|
||||||
|
-- Optionally, make builtin f, F, t, T also repeatable with ; and ,
|
||||||
|
vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f)
|
||||||
|
vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F)
|
||||||
|
vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t)
|
||||||
|
vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T)
|
||||||
|
end,
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
vim.opt.nu = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.softtabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
|
||||||
|
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||||
|
vim.opt.undofile = true
|
||||||
|
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
|
||||||
|
vim.opt.wrap = false
|
||||||
|
|
||||||
|
vim.opt.hlsearch = false
|
||||||
|
vim.opt.incsearch = true
|
||||||
Loading…
Reference in new issue