Browse Source

feat: more clean up

master
Tovi Jaeschke-Rogers 1 week ago
parent
commit
e7f2e6b2ff
7 changed files with 30 additions and 106 deletions
  1. +3
    -3
      .config/nvim/lua/core/remaps.lua
  2. +20
    -0
      .config/nvim/lua/plugins/harpoon.lua
  3. +0
    -76
      .config/nvim/lua/plugins/laravel.lua
  4. +3
    -3
      .config/nvim/lua/plugins/linting.lua
  5. +4
    -11
      .config/nvim/lua/plugins/lspconfig.lua
  6. +0
    -3
      .config/nvim/lua/plugins/nvim-treesitter.lua
  7. +0
    -10
      .config/nvim/lua/plugins/refactoring.lua

+ 3
- 3
.config/nvim/lua/core/remaps.lua View File

@ -7,7 +7,7 @@ vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
-- Easily open splits -- Easily open splits
vim.keymap.set("n", "<leader>hs", "<cmd>split<cr>", { desc = "Open horizontal spilt" })
vim.keymap.set("n", "<leader>bs", "<cmd>split<cr>", { desc = "Open horizontal spilt" })
vim.keymap.set("n", "<leader>vs", "<cmd>vsplit<cr>", { desc = "Open vertical spilt" }) vim.keymap.set("n", "<leader>vs", "<cmd>vsplit<cr>", { desc = "Open vertical spilt" })
-- Spell-check -- Spell-check
@ -40,8 +40,8 @@ vim.keymap.set("n", "n", "nzzzv", { desc = "Next search result" })
vim.keymap.set("n", "N", "Nzzzv", { desc = "Previous search result" }) vim.keymap.set("n", "N", "Nzzzv", { desc = "Previous search result" })
-- Keep cursor centered when jumping through quickfix list -- Keep cursor centered when jumping through quickfix list
vim.keymap.set("n", "<leader>k", "<cmd>cprev<CR>zz", { desc = "Previous item in quickfix list" })
vim.keymap.set("n", "<leader>j", "<cmd>cnext<CR>zz", { desc = "Next item in quickfix list" })
vim.keymap.set("n", "<leader>K", "<cmd>cprev<CR>zz", { desc = "Previous item in quickfix list" })
vim.keymap.set("n", "<leader>J", "<cmd>cnext<CR>zz", { desc = "Next item in quickfix list" })
-- Easily run global search and replace -- Easily run global search and replace
vim.keymap.set( vim.keymap.set(


+ 20
- 0
.config/nvim/lua/plugins/harpoon.lua View File

@ -25,18 +25,38 @@ return {
harpoon:list():select(1) harpoon:list():select(1)
end, { desc = "Go to first harpoon file" }) end, { desc = "Go to first harpoon file" })
keymap.set("n", "<leader>h", function()
harpoon:list():select(1)
end, { desc = "Go to first harpoon file" })
keymap.set("n", "<leader>2", function() keymap.set("n", "<leader>2", function()
harpoon:list():select(2) harpoon:list():select(2)
end, { desc = "Go to second harpoon file" }) end, { desc = "Go to second harpoon file" })
keymap.set("n", "<leader>j", function()
harpoon:list():select(2)
end, { desc = "Go to second harpoon file" })
keymap.set("n", "<leader>3", function() keymap.set("n", "<leader>3", function()
harpoon:list():select(3) harpoon:list():select(3)
end, { desc = "Go to third harpoon file" }) end, { desc = "Go to third harpoon file" })
keymap.set("n", "<leader>k", function()
harpoon:list():select(3)
end, { desc = "Go to third harpoon file" })
keymap.set("n", "<leader>4", function() keymap.set("n", "<leader>4", function()
harpoon:list():select(4) harpoon:list():select(4)
end, { desc = "Go to fourth harpoon file" }) end, { desc = "Go to fourth harpoon file" })
keymap.set("n", "<leader>l", function()
harpoon:list():select(4)
end, { desc = "Go to fourth harpoon file" })
keymap.set("n", "<C-S-P>", function() keymap.set("n", "<C-S-P>", function()
harpoon:list():prev() harpoon:list():prev()
end) end)


+ 0
- 76
.config/nvim/lua/plugins/laravel.lua View File

@ -1,76 +0,0 @@
return {
"tovijaeschke/laravel.nvim",
enabled = false,
branch = "feature/discovery-check-improvements",
dependencies = {
"nvim-telescope/telescope.nvim",
"tpope/vim-dotenv",
"MunifTanjim/nui.nvim",
-- "nvimtools/none-ls.nvim",
},
cmd = { "Sail", "Artisan", "Composer", "Npm", "Yarn", "Laravel" },
keys = {
{ "<leader>la", ":Laravel artisan<cr>" },
{ "<leader>lr", ":Laravel routes<cr>" },
{ "<leader>lm", ":Laravel related<cr>" },
},
event = { "VeryLazy" },
config = function()
local laravel = require("laravel")
laravel.setup({
lsp_server = "intelephense",
features = {
null_ls = {
enable = false,
},
},
environments = {
env_variable = "NVIM_LARAVEL_ENV",
auto_dicover = false,
default = "docker-compose",
definitions = {
{
name = "sail",
condition = {
file_exists = { "vendor/bin/sail", "docker-compose.yml" },
},
commands = {
sail = { "vendor/bin/sail" },
{
commands = { "php", "composer", "npm", "yarn" },
prefix = { "vendor/bin/sail" },
},
},
},
{
name = "docker-compose",
condition = {
file_exists = { "docker-compose.yml" },
executable = { "docker" },
},
commands = {
compose = { "docker", "compose" },
{
commands = { "php", "composer", "npm" },
docker = {
container = {
env = "APP_SERVICE",
default = "fpm",
},
exec = { "docker", "compose", "exec", "-it" },
},
},
},
},
{
name = "local",
condition = {
executable = { "php" },
},
},
},
},
})
end,
}

+ 3
- 3
.config/nvim/lua/plugins/linting.lua View File

@ -79,8 +79,8 @@ return {
end, end,
}) })
vim.keymap.set("n", "<leader>ll", function()
lint.try_lint()
end)
-- vim.keymap.set("n", "<leader>ll", function()
-- lint.try_lint()
-- end)
end, end,
} }

+ 4
- 11
.config/nvim/lua/plugins/lspconfig.lua View File

@ -63,9 +63,6 @@ return {
vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR }) vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR })
end, opts) end, opts)
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "<leader>ld", vim.diagnostic.setqflist, opts)
opts.desc = "Show documentation for what is under cursor" opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "K", vim.lsp.buf.hover, opts) keymap.set("n", "K", vim.lsp.buf.hover, opts)
@ -106,14 +103,10 @@ return {
return result:lower():gsub("%s+", "") return result:lower():gsub("%s+", "")
end end
-- Set the base path based on the operating system
local os = get_os()
local base_path = ""
if os == "darwin" then
-- base_path = "/usr/lib/node_modules"
local base_path = "/usr/local/lib/node_modules"
if get_os() == "darwin" then
base_path = "/opt/homebrew/lib/node_modules" base_path = "/opt/homebrew/lib/node_modules"
elseif os == "linux" then
base_path = "/usr/lib/node_modules"
end end
local function get_typescript_server_path(root_dir) local function get_typescript_server_path(root_dir)
@ -292,7 +285,7 @@ return {
for server_name, server in pairs(servers) do for server_name, server in pairs(servers) do
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
require("lspconfig")[server_name].setup(server)
lspconfig[server_name].setup(server)
end end
end, end,
} }

+ 0
- 3
.config/nvim/lua/plugins/nvim-treesitter.lua View File

@ -21,11 +21,8 @@ return {
"yaml", "yaml",
"html", "html",
"css", "css",
"prisma",
"markdown", "markdown",
"markdown_inline", "markdown_inline",
"svelte",
"graphql",
"bash", "bash",
"lua", "lua",
"vim", "vim",


+ 0
- 10
.config/nvim/lua/plugins/refactoring.lua View File

@ -1,10 +0,0 @@
return {
"ThePrimeagen/refactoring.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("refactoring").setup()
end,
}

Loading…
Cancel
Save