Compare commits
8 Commits
15e21f333f
...
19cfaeab49
| Author | SHA1 | Date | |
|---|---|---|---|
| 19cfaeab49 | |||
| 5b41b4d781 | |||
| 9faa5209bb | |||
| 36487d273e | |||
| 5b58207e16 | |||
| 270222bb57 | |||
| 75f9692e7d | |||
| 4bb854c54d |
@@ -1,5 +1,6 @@
|
||||
-- define your colorscheme here
|
||||
local colorscheme = 'lunaperche-sl'
|
||||
-- local colorscheme = 'lunaperche-sl'
|
||||
local colorscheme = 'nightfox'
|
||||
|
||||
local is_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
||||
if not is_ok then
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
lualine_a = { { 'filename', path = 1, shorting_target = 50 } },
|
||||
lualine_b = { 'branch', 'diff', 'diagnostics' },
|
||||
lualine_c = {},
|
||||
lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
||||
lualine_x = { 'encoding', 'fileformat', 'filetype', 'lsp_status' },
|
||||
lualine_y = { 'filesize' },
|
||||
lualine_z = { 'progress', 'location' }
|
||||
},
|
||||
|
||||
@@ -28,12 +28,12 @@ vim.keymap.set('n', '<space>o', ":silent !chromium '%'<cr>", { desc = "Open in b
|
||||
|
||||
-- toggle colorscheme between dark and light
|
||||
vim.keymap.set('n', '<leader>m', function()
|
||||
if vim.opt.background:get() == "dark" then
|
||||
vim.o.background = "light"
|
||||
if vim.g.colors_name == "nightfox" then
|
||||
vim.cmd('colorscheme dayfox')
|
||||
else
|
||||
vim.o.background = "dark"
|
||||
vim.cmd('colorscheme nightfox')
|
||||
end
|
||||
end, { desc = "Toggle dark/light mode" })
|
||||
end, { desc = "Toggle Nightfox/Dayfox" })
|
||||
|
||||
--
|
||||
-- configure workspaces
|
||||
|
||||
55
lua/lsp.lua
55
lua/lsp.lua
@@ -1,4 +1,4 @@
|
||||
-- attach using autocommand, much better than doing it during mason
|
||||
-- attach using autocommand and setup keybindings
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('sl.lsp', {}),
|
||||
callback = function(args)
|
||||
@@ -45,6 +45,8 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||
vim.keymap.set('n', '<space>=d', gitsigns.diffthis, { desc = "Git diff this" })
|
||||
vim.keymap.set('n', '<space>=r', gitsigns.reset_hunk, { desc = "Git reset hunk" })
|
||||
vim.keymap.set('n', '<space>=s', gitsigns.stage_hunk, { desc = "Git stage hunk" })
|
||||
vim.keymap.set('v', '<space>=s', function() gitsigns.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end,
|
||||
{ desc = "Git stage hunk" })
|
||||
|
||||
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<C-,>', fzf.lsp_references, { desc = "Find References" })
|
||||
@@ -52,28 +54,6 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||
end
|
||||
})
|
||||
|
||||
require('mason').setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗"
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
require('mason-lspconfig').setup({
|
||||
-- A list of servers to automatically install if they're not already installed
|
||||
ensure_installed = {
|
||||
'lua_ls',
|
||||
-- 'rust_analyzer', -- handled by rust mrcjkb/rustaceanvim
|
||||
'yamlls',
|
||||
'ts_ls',
|
||||
'gopls',
|
||||
'clangd',
|
||||
},
|
||||
})
|
||||
|
||||
-- lsp format selected range
|
||||
function LSPRangeFormatFunction()
|
||||
vim.lsp.buf.format({
|
||||
@@ -86,21 +66,32 @@ function LSPRangeFormatFunction()
|
||||
end
|
||||
|
||||
-- Set different settings for different languages' LSP
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
lspconfig.ts_ls.setup {
|
||||
-- use globally installed vue-language-server (instead of mason provided)
|
||||
vim.lsp.config('vue_ls', {
|
||||
-- add filetypes for typescript, javascript and vue
|
||||
-- filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = '@vue/typescript-plugin',
|
||||
location = vim.fn.expand '$MASON/packages' .. '/vue-language-server' .. '/node_modules/@vue/language-server',
|
||||
languages = { 'vue' },
|
||||
},
|
||||
vue = {
|
||||
-- disable hybrid mode, will thus use ts_ls internally
|
||||
hybridMode = false,
|
||||
},
|
||||
},
|
||||
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||
})
|
||||
|
||||
local enable_this_lsp = {
|
||||
'vue_ls',
|
||||
'gopls',
|
||||
'bashls',
|
||||
'html',
|
||||
'lua_ls',
|
||||
}
|
||||
|
||||
for l in pairs(enable_this_lsp) do
|
||||
vim.lsp.enable(enable_this_lsp[l])
|
||||
end
|
||||
|
||||
|
||||
-- add autoformat to Dioxus projects
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = "*.rs",
|
||||
|
||||
@@ -21,7 +21,7 @@ vim.opt.number = true -- show absolute number
|
||||
vim.opt.relativenumber = false -- add numbers to each line on the left side
|
||||
vim.opt.cursorline = true -- highlight cursor line underneath the cursor horizontally
|
||||
vim.opt.guicursor = "" .. -- cursor highlight group needs to be Cursor to have lunaperche have a proper light cursor
|
||||
"n-v-c-sm:block-Cursor,i-ci-ve:ver25-Cursor,r-cr-o:hor20,t:block-blinkon500-blinkoff500-TermCursor"
|
||||
"n-v-c-sm:block-Cursor,i-ci-ve:ver25-Cursor,r-cr-o:hor20,t:block-blinkon500-blinkoff500-Cursor"
|
||||
vim.opt.splitbelow = true -- open new vertical split bottom
|
||||
vim.opt.splitright = true -- open new horizontal splits right
|
||||
vim.opt.termguicolors = true -- enable 24-bit RGB color in the TUI
|
||||
|
||||
@@ -102,8 +102,8 @@ require("lazy").setup({
|
||||
--
|
||||
-- LSP manager and others
|
||||
--
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
-- "williamboman/mason.nvim",
|
||||
-- "williamboman/mason-lspconfig.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
|
||||
-- Nice plugin to show what LSPs are doing in the background (and others
|
||||
@@ -125,6 +125,15 @@ require("lazy").setup({
|
||||
},
|
||||
},
|
||||
|
||||
-- fzf-lua
|
||||
{
|
||||
"ibhagwan/fzf-lua",
|
||||
-- optional for icon support
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = true,
|
||||
},
|
||||
|
||||
|
||||
-- neogit setup
|
||||
{
|
||||
"NeogitOrg/neogit",
|
||||
@@ -215,19 +224,6 @@ require("lazy").setup({
|
||||
-- comfortable table editing, esp. used in orgmode
|
||||
{ 'dhruvasagar/vim-table-mode' },
|
||||
|
||||
-- fzf-lua
|
||||
{
|
||||
"ibhagwan/fzf-lua",
|
||||
-- optional for icon support
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
-- calling `setup` is optional for customization
|
||||
local fzf = require("fzf-lua")
|
||||
fzf.setup({ "default-title" })
|
||||
fzf.register_ui_select()
|
||||
end
|
||||
},
|
||||
|
||||
-- which-key
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
@@ -398,11 +394,6 @@ require("lazy").setup({
|
||||
"itchyny/calendar.vim"
|
||||
},
|
||||
|
||||
-- treesitter asciidoc support
|
||||
-- // NOTE.2025-01-17 seems to be broken
|
||||
-- { "cpkio/nvim-treesitter-asciidoc" },
|
||||
|
||||
|
||||
-- Greeter to run on NeoVim startup
|
||||
{
|
||||
'goolord/alpha-nvim',
|
||||
@@ -597,6 +588,29 @@ require("lazy").setup({
|
||||
},
|
||||
},
|
||||
|
||||
-- improved (wrapping!) diagnostics
|
||||
{
|
||||
"rachartier/tiny-inline-diagnostic.nvim",
|
||||
event = "VeryLazy", -- one of LspAttach, VeryLazy
|
||||
priority = 1000, -- needs to be loaded in first
|
||||
config = function()
|
||||
require('tiny-inline-diagnostic').setup({
|
||||
options = {
|
||||
use_icons_from_diagnostic = true,
|
||||
enable_on_insert = true,
|
||||
show_all_diags_on_cursorline = true,
|
||||
multilines = {
|
||||
enabled = true,
|
||||
always_show = true,
|
||||
}
|
||||
}
|
||||
})
|
||||
vim.diagnostic.config({ virtual_text = false }) -- Only if needed in your configuration, if you already have native LSP diagnostics
|
||||
end
|
||||
},
|
||||
-- Nightfox colorscheme
|
||||
{ "EdenEast/nightfox.nvim" },
|
||||
|
||||
-- new plugins here
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user