recovering custom nvim configs
This commit is contained in:
parent
0622ef41cd
commit
ebb0a5aeed
11 changed files with 340 additions and 5 deletions
|
|
@ -1,5 +1,68 @@
|
|||
-- You can add your own plugins here or in other files in this directory!
|
||||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {}
|
||||
return {
|
||||
{
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
requires = {
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
{ "nvim-treesitter/nvim-treesitter" },
|
||||
},
|
||||
config = function()
|
||||
require("refactoring").setup({})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"ThePrimeagen/git-worktree.nvim",
|
||||
},
|
||||
{
|
||||
"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]])
|
||||
end,
|
||||
},
|
||||
-- formatting & linting
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
-- use("jayp0521/mason-null-ls.nvim")
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
requires = "nvim-tree/nvim-web-devicons",
|
||||
config = function()
|
||||
require("trouble").setup({
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-telescope/telescope-live-grep-args.nvim",
|
||||
-- This will not install any breaking changes.
|
||||
-- For major updates, this must be adjusted manually.
|
||||
version = "^1.0.0",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("telescope").load_extension("live_grep_args")
|
||||
end
|
||||
}
|
||||
}
|
||||
|
|
|
|||
20
lua/rahcodes/keymap.lua
Normal file
20
lua/rahcodes/keymap.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
local M = {}
|
||||
|
||||
local function bind(op, outer_opts)
|
||||
outer_opts = outer_opts or {noremap = true}
|
||||
return function(lhs, rhs, opts)
|
||||
opts = vim.tbl_extend("force",
|
||||
outer_opts,
|
||||
opts or {}
|
||||
)
|
||||
vim.keymap.set(op, lhs,rhs, opts)
|
||||
end
|
||||
end
|
||||
|
||||
M.nmap = bind("n", {noremap = false})
|
||||
M.nnoremap = bind("n")
|
||||
M.vnoremap = bind("v")
|
||||
M.xnoremap = bind("x")
|
||||
M.inoremap = bind("i")
|
||||
|
||||
return M
|
||||
69
lua/rahcodes/remap.lua
Normal file
69
lua/rahcodes/remap.lua
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
local Remap = require("rahcodes.keymap")
|
||||
local nmap = Remap.nmap
|
||||
|
||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
-- don't bork paste buffer when pasting
|
||||
vim.keymap.set("x", "<leader>p", '"_dP')
|
||||
|
||||
vim.keymap.set("i", "<C-c>", "<Esc>")
|
||||
|
||||
-- vim.keymap.set("n", "/", "/\v")
|
||||
-- vim.keymap.set("v", "/", "/\v")
|
||||
vim.keymap.set("n", "<leader>`", ":noh<cr>")
|
||||
|
||||
-- No Cheating
|
||||
vim.keymap.set("n", "<up>", "<nop>")
|
||||
vim.keymap.set("n", "<down>", "<nop>")
|
||||
vim.keymap.set("n", "<left>", "<nop>")
|
||||
vim.keymap.set("n", "<right>", "<nop>")
|
||||
vim.keymap.set("i", "<up>", "<nop>")
|
||||
vim.keymap.set("i", "<down>", "<nop>")
|
||||
vim.keymap.set("i", "<left>", "<nop>")
|
||||
vim.keymap.set("i", "<right>", "<nop>")
|
||||
|
||||
-- No weird line jumps
|
||||
vim.keymap.set("n", "j", "gj")
|
||||
vim.keymap.set("n", "k", "gk")
|
||||
|
||||
-- Copy to system clipboard
|
||||
vim.keymap.set("n", "<leader>y", '"*y')
|
||||
vim.keymap.set("v", "<leader>y", '"*y')
|
||||
vim.keymap.set("n", "<leader>yy", '"+y')
|
||||
vim.keymap.set("v", "<leader>yy", '"+y')
|
||||
|
||||
vim.keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
|
||||
|
||||
-- Move buffers
|
||||
nmap("sp", ":bprev<Return>")
|
||||
nmap("sn", ":bnext<Return>")
|
||||
|
||||
-- Quickfix list navigation
|
||||
vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
|
||||
vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz")
|
||||
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
|
||||
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
|
||||
|
||||
-- Save
|
||||
nmap("<C-s>", ":wa<CR>")
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
vim.keymap.set("n", "<leader>m", require("telescope.builtin").oldfiles, { desc = "[?] Find recently opened files" })
|
||||
vim.keymap.set("n", "<leader>/", require("telescope.builtin").find_files, { desc = "[S]earch [F]iles" })
|
||||
|
||||
-- Trouble bindings
|
||||
vim.keymap.set("n", "<leader>xx", function() require("trouble").open() end)
|
||||
vim.keymap.set("n", "<leader>xw", function() require("trouble").open("workspace_diagnostics") end)
|
||||
vim.keymap.set("n", "<leader>xd", function() require("trouble").open("document_diagnostics") end)
|
||||
vim.keymap.set("n", "<leader>xq", function() require("trouble").open("quickfix") end)
|
||||
vim.keymap.set("n", "<leader>xl", function() require("trouble").open("loclist") end)
|
||||
vim.keymap.set("n", "gR", function() require("trouble").open("lsp_references") end)
|
||||
26
lua/rahcodes/sets.lua
Normal file
26
lua/rahcodes/sets.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
vim.opt.guicursor = ""
|
||||
|
||||
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.smartindent = true
|
||||
|
||||
vim.opt.wrap = false
|
||||
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||
|
||||
vim.opt.incsearch = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.isfname:append("@-@")
|
||||
|
||||
vim.opt.colorcolumn = "80"
|
||||
|
||||
vim.opt.mouse = "v"
|
||||
22
lua/rahcodes/solargraph.lua
Normal file
22
lua/rahcodes/solargraph.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
local lsp = require 'lspconfig'
|
||||
lsp.solargraph.setup {
|
||||
cmd = { os.getenv("HOME") .. "/.asdf/shims/solargraph", '--stdio' },
|
||||
filetypes = { "ruby", "rakefile" },
|
||||
settings = {
|
||||
solargraph = {
|
||||
-- root_dir = nvim_lsp.util.root_pattern("Gemfile", ".git", "."),
|
||||
-- root_dir = root_pattern("Gemfile", ".git"),
|
||||
settings = {
|
||||
solargraph = {
|
||||
autoformat = true,
|
||||
completion = true,
|
||||
diagnostic = true,
|
||||
folding = true,
|
||||
references = true,
|
||||
rename = true,
|
||||
symbols = true
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue