sync
This commit is contained in:
@@ -22,7 +22,7 @@ dashboard.section.buttons.val = {
|
||||
dashboard.button(
|
||||
"e",
|
||||
" Explorer",
|
||||
"<cmd>Explore<cr>"
|
||||
"<cmd>Oil<cr>"
|
||||
),
|
||||
dashboard.button(
|
||||
"c",
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
function ColorMyPencils(color)
|
||||
color = color or "rose-pine"
|
||||
vim.cmd.colorscheme(color)
|
||||
color = color or "rose-pine"
|
||||
vim.cmd.colorscheme(color)
|
||||
|
||||
vim.api.nvim_set_hl(0,"Normal", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0,"NormalFloat", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
end
|
||||
|
||||
ColorMyPencils();
|
||||
|
||||
@@ -4,70 +4,74 @@ lsp.preset("recommended")
|
||||
|
||||
require("mason").setup({})
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
ensure_installed = {
|
||||
"ts_ls",
|
||||
"eslint",
|
||||
"lua_ls",
|
||||
"rust_analyzer",
|
||||
"eslint",
|
||||
"lua_ls",
|
||||
"rust_analyzer",
|
||||
"ast_grep"
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
require("lspconfig")[server_name].setup({})
|
||||
end,
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
require("lspconfig")[server_name].setup({})
|
||||
end,
|
||||
}
|
||||
})
|
||||
|
||||
local cmp = require('cmp')
|
||||
|
||||
cmp.setup({
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-k>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-j>'] = cmp.mapping.select_next_item(),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
}),
|
||||
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-k>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-j>'] = cmp.mapping.select_next_item(),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
}),
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
lsp.extend_lspconfig()
|
||||
|
||||
lsp.set_preferences({
|
||||
sign_icons = { }
|
||||
sign_icons = {}
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
lsp.default_keymaps({buffer = bufnr})
|
||||
lsp.default_keymaps({ buffer = bufnr })
|
||||
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "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>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>gd", builtin.lsp_definitions, {})
|
||||
vim.keymap.set("n", "gd", builtin.lsp_definitions, {})
|
||||
vim.keymap.set('n', '<leader>cf', builtin.lsp_incoming_calls)
|
||||
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>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
end)
|
||||
|
||||
lsp.setup()
|
||||
|
||||
-- Function to restart all active LSP clients
|
||||
local function restart_lsp()
|
||||
for _, client in pairs(vim.lsp.get_active_clients()) do
|
||||
client.stop()
|
||||
end
|
||||
vim.cmd("edit") -- Reload the current buffer to reattach the LSP clients
|
||||
for _, client in pairs(vim.lsp.get_active_clients()) do
|
||||
client.stop()
|
||||
end
|
||||
vim.cmd("edit") -- Reload the current buffer to reattach the LSP clients
|
||||
end
|
||||
|
||||
-- Create a Neovim command to restart LSP
|
||||
|
||||
0
after/plugin/oil.lua
Normal file
0
after/plugin/oil.lua
Normal file
@@ -20,3 +20,21 @@ require("presence").setup({
|
||||
workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
|
||||
line_number_text = "Line %s" --"Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
|
||||
})
|
||||
|
||||
local is_presence_active = true
|
||||
|
||||
function ToggleDiscordPresence()
|
||||
local presence = package.loaded.presence
|
||||
if is_presence_active then
|
||||
presence:cancel()
|
||||
is_presence_active = false
|
||||
print("Discord Presence: Off")
|
||||
else
|
||||
is_presence_active = true
|
||||
presence:update()
|
||||
print("Discord Presence: On")
|
||||
end
|
||||
end
|
||||
|
||||
-- Map it to a key (e.g., <leader>dp for "Discord Presence")
|
||||
vim.keymap.set("n", "<leader>dp", ToggleDiscordPresence, { desc = "Toggle Discord Presence" })
|
||||
|
||||
@@ -1,8 +1,36 @@
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set("n", "<leader>pf", builtin.find_files, {})
|
||||
vim.keymap.set("n", "<leader>pf", function()
|
||||
builtin.find_files({
|
||||
hidden = true,
|
||||
file_ignore_patterns = { "%.git/", "%.cache", "dist/", "target/", ".vscode/", "node_modules/", "%.o", "lazy-lock.json" }
|
||||
})
|
||||
end, {})
|
||||
vim.keymap.set('n', '<leader>bf', builtin.buffers, { desc = 'Telescope buffers' })
|
||||
vim.keymap.set("n", "<C-p>", builtin.git_files, {})
|
||||
vim.keymap.set("n", "<leader>ps", function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep > ")});
|
||||
vim.keymap.set("n", "<leader>ps", function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep > ") });
|
||||
end)
|
||||
|
||||
local actions = require('telescope.actions')
|
||||
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
preview = {
|
||||
treesitter = false,
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
},
|
||||
n = {
|
||||
["q"] = actions.close,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
},
|
||||
},
|
||||
-- path_display = { "smart" },
|
||||
-- layout_strategy = "vertical",
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,37 +1,8 @@
|
||||
|
||||
|
||||
require'nvim-treesitter'.setup {
|
||||
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
|
||||
ensure_installed = { "c", "go", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "javascript", "typescript", "rust"},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = false,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
|
||||
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
|
||||
-- the name of the parser)
|
||||
-- list of language that will be disabled
|
||||
-- disable = {},
|
||||
-- Or a function for more flexibility, e.g. to disable slow treesitter highlight for large files
|
||||
-- disable = function(lang, buf)
|
||||
-- local max_filesize = 100 * 1024 -- 100 KB
|
||||
-- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
-- if ok and stats and stats.size > max_filesize then
|
||||
-- return true
|
||||
-- end
|
||||
-- end,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
||||
require("nvim-treesitter").setup({
|
||||
ensure_installed = {
|
||||
"c", "go", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "javascript", "typescript", "rust"
|
||||
},
|
||||
sync_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = false },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user