Compare commits
4 Commits
8148d7b79e
...
54c845ab59
Author | SHA1 | Date |
---|---|---|
|
54c845ab59 | |
|
f23ada5260 | |
|
404f516984 | |
|
2ad6f7fd59 |
|
@ -15,3 +15,4 @@ map("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
|||
map("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
||||
map("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
||||
map("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
||||
map("n", "<leader>z", ":ZenMode<cr>") --open ZenMode (distraction-free)
|
||||
|
|
|
@ -1,27 +1,26 @@
|
|||
return { -- LSP Configuration & Plugins
|
||||
'neovim/nvim-lspconfig',
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
-- Automatically install LSPs and related tools to stdpath for neovim
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
|
||||
-- Useful status updates for LSP.
|
||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
{ "j-hui/fidget.nvim", opts = {} },
|
||||
|
||||
-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||
-- used for completion, annotations and signatures of Neovim apis
|
||||
{ 'folke/neodev.nvim', opts = {} },
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
},
|
||||
config = function()
|
||||
|
||||
-- This function gets run when an LSP attaches to a particular buffer.
|
||||
-- That is to say, every time a new file is opened that is associated with
|
||||
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
|
||||
-- function will be executed to configure the current buffer
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
||||
callback = function(event)
|
||||
-- NOTE: Remember that lua is a real programming language, and as such it is possible
|
||||
-- to define small helper and utility functions so you don't have to repeat yourself
|
||||
|
@ -30,49 +29,49 @@ return { -- LSP Configuration & Plugins
|
|||
-- In this case, we create a function that lets us more easily define mappings specific
|
||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||
local map = function(keys, func, desc)
|
||||
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||
end
|
||||
|
||||
-- Jump to the definition of the word under your cursor.
|
||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
||||
-- To jump back, press <C-t>.
|
||||
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||
map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
|
||||
|
||||
-- Find references for the word under your cursor.
|
||||
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||
|
||||
-- Jump to the implementation of the word under your cursor.
|
||||
-- Useful when your language has ways of declaring types without an actual implementation.
|
||||
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
|
||||
|
||||
-- Jump to the type of the word under your cursor.
|
||||
-- Useful when you're not sure what type a variable is and you want to see
|
||||
-- the definition of its *type*, not where it was *defined*.
|
||||
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
||||
map("<leader>D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition")
|
||||
|
||||
-- Fuzzy find all the symbols in your current document.
|
||||
-- Symbols are things like variables, functions, types, etc.
|
||||
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
map("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols")
|
||||
|
||||
-- Fuzzy find all the symbols in your current workspace
|
||||
-- Similar to document symbols, except searches over your whole project.
|
||||
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
map("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
|
||||
|
||||
-- Rename the variable under your cursor
|
||||
-- Most Language Servers support renaming across files, etc.
|
||||
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
|
||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
||||
-- or a suggestion from your LSP for this to activate.
|
||||
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||
map("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
|
||||
|
||||
-- Opens a popup that displays documentation about the word under your cursor
|
||||
-- See `:help K` for why this keymap
|
||||
map('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||
map("K", vim.lsp.buf.hover, "Hover Documentation")
|
||||
|
||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||
-- For example, in C this would take you to the header
|
||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
|
||||
-- The following two autocommands are used to highlight references of the
|
||||
-- word under your cursor when your cursor rests there for a little while.
|
||||
|
@ -81,12 +80,12 @@ return { -- LSP Configuration & Plugins
|
|||
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client and client.server_capabilities.documentHighlightProvider then
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
buffer = event.buf,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||
buffer = event.buf,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
|
@ -99,7 +98,7 @@ return { -- LSP Configuration & Plugins
|
|||
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
|
||||
-- So, we create new capabilities with nvim cmp, and then broadcast that to the servers.
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
||||
capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities())
|
||||
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||
|
@ -122,7 +121,7 @@ return { -- LSP Configuration & Plugins
|
|||
--
|
||||
-- But for many setups, the LSP (`tsserver`) will work just fine
|
||||
tsserver = {},
|
||||
--
|
||||
ltex = {}, --
|
||||
|
||||
lua_ls = {
|
||||
-- cmd = {...},
|
||||
|
@ -131,7 +130,7 @@ return { -- LSP Configuration & Plugins
|
|||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = 'Replace',
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||
-- diagnostics = { disable = { 'missing-fields' } },
|
||||
|
@ -146,27 +145,27 @@ return { -- LSP Configuration & Plugins
|
|||
-- :Mason
|
||||
--
|
||||
-- You can press `g?` for help in this menu
|
||||
require('mason').setup()
|
||||
require("mason").setup()
|
||||
|
||||
-- You can add other tools here that you want Mason to install
|
||||
-- for you, so that they are available from within Neovim.
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
'stylua', -- Used to format lua code
|
||||
"stylua", -- Used to format lua code
|
||||
})
|
||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||
require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
|
||||
|
||||
require('mason-lspconfig').setup {
|
||||
require("mason-lspconfig").setup({
|
||||
handlers = {
|
||||
function(server_name)
|
||||
local server = servers[server_name] or {}
|
||||
-- This handles overriding only values explicitly passed
|
||||
-- by the server configuration above. Useful when disabling
|
||||
-- certain features of an LSP (for example, turning off formatting for tsserver)
|
||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||
require('lspconfig')[server_name].setup(server)
|
||||
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
||||
require("lspconfig")[server_name].setup(server)
|
||||
end,
|
||||
},
|
||||
}
|
||||
})
|
||||
end,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"preservim/vim-pencil",
|
||||
init = function()
|
||||
vim.g["pencil#wrapModeDefault"] = "soft"
|
||||
end,
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
return {
|
||||
{
|
||||
"rose-pine/neovim",
|
||||
name = "rose-pine",
|
||||
priority = 1000,
|
||||
|
@ -8,4 +9,6 @@ return {
|
|||
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
||||
vim.cmd.colorscheme("rose-pine-main")
|
||||
end,
|
||||
},
|
||||
{ "ellisonleao/gruvbox.nvim", priority = 1000, config = true, opts = ... },
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
return {
|
||||
"folke/twilight.nvim",
|
||||
opts = {
|
||||
dimming = {
|
||||
alpha = 0.25, -- amount of dimming
|
||||
-- we try to get the foreground from the highlight groups or fallback color
|
||||
color = { "Normal", "#ffffff" },
|
||||
term_bg = "#000000", -- if guibg=NONE, this will be used to calculate text color
|
||||
inactive = false, -- when true, other windows will be fully dimmed (unless they contain the same buffer)
|
||||
},
|
||||
context = 10, -- amount of lines we will try to show around the current line
|
||||
treesitter = true, -- use treesitter when available for the filetype
|
||||
-- treesitter is used to automatically expand the visible text,
|
||||
-- but you can further control the types of nodes that should always be fully expanded
|
||||
expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types
|
||||
"function",
|
||||
"method",
|
||||
"table",
|
||||
"if_statement",
|
||||
},
|
||||
exclude = {}, -- exclude these filetypes
|
||||
},
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
return {
|
||||
"folke/zen-mode.nvim",
|
||||
opts = {
|
||||
window = {
|
||||
backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
|
||||
-- height and width can be:
|
||||
-- * an absolute number of cells when > 1
|
||||
-- * a percentage of the width / height of the editor when <= 1
|
||||
-- * a function that returns the width or the height
|
||||
width = 60, -- width of the Zen window
|
||||
height = 1, -- height of the Zen window
|
||||
-- by default, no options are changed for the Zen window
|
||||
-- uncomment any of the options below, or add other vim.wo options you want to apply
|
||||
options = {
|
||||
-- signcolumn = "no", -- disable signcolumn
|
||||
-- number = false, -- disable number column
|
||||
-- relativenumber = false, -- disable relative numbers
|
||||
-- cursorline = false, -- disable cursorline
|
||||
-- cursorcolumn = false, -- disable cursor column
|
||||
-- foldcolumn = "0", -- disable fold column
|
||||
-- list = false, -- disable whitespace characters
|
||||
},
|
||||
},
|
||||
plugins = {
|
||||
-- disable some global vim options (vim.o...)
|
||||
-- comment the lines to not apply the options
|
||||
options = {
|
||||
enabled = true,
|
||||
ruler = false, -- disables the ruler text in the cmd line area
|
||||
showcmd = false, -- disables the command in the last line of the screen
|
||||
-- you may turn on/off statusline in zen mode by setting 'laststatus'
|
||||
-- statusline will be shown only if 'laststatus' == 3
|
||||
laststatus = 0, -- turn off the statusline in zen mode
|
||||
},
|
||||
twilight = { enabled = true }, -- enable to start Twilight when zen mode opens
|
||||
gitsigns = { enabled = false }, -- disables git signs
|
||||
tmux = { enabled = false }, -- disables the tmux statusline
|
||||
-- this will change the font size on kitty when in zen mode
|
||||
-- to make this work, you need to set the following kitty options:
|
||||
-- - allow_remote_control socket-only
|
||||
-- - listen_on unix:/tmp/kitty
|
||||
kitty = {
|
||||
enabled = false,
|
||||
font = "+4", -- font size increment
|
||||
},
|
||||
-- this will change the font size on alacritty when in zen mode
|
||||
-- requires Alacritty Version 0.10.0 or higher
|
||||
-- uses `alacritty msg` subcommand to change font size
|
||||
alacritty = {
|
||||
enabled = false,
|
||||
font = "14", -- font size
|
||||
},
|
||||
-- this will change the font size on wezterm when in zen mode
|
||||
-- See alse also the Plugins/Wezterm section in this projects README
|
||||
wezterm = {
|
||||
enabled = false,
|
||||
-- can be either an absolute font size or the number of incremental steps
|
||||
font = "+4", -- (10% increase per step)
|
||||
},
|
||||
},
|
||||
-- callback where you can add custom code when the Zen window opens
|
||||
on_open = function(win) end,
|
||||
-- callback where you can add custom code when the Zen window closes
|
||||
on_close = function() end,
|
||||
},
|
||||
}
|
Loading…
Reference in New Issue