mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 16:53:00 +00:00
breaking: Remove setup script and use chezmoi
This commit is contained in:
parent
02bbb24cac
commit
0051a163c3
190 changed files with 118 additions and 3456 deletions
37
dot_config/nvim/lua/config/colors.lua
Normal file
37
dot_config/nvim/lua/config/colors.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
-- This file *currently* contains the colorscheme for lualine (status line)
|
||||
|
||||
local M = {}
|
||||
-- TODO: Change the palatte when the colorscheme changes
|
||||
|
||||
if vim.g.colors_name == "catppuccin-latte" then
|
||||
M.scheme = require("catppuccin.palettes.latte")
|
||||
else
|
||||
M.scheme = require("catppuccin.palettes.mocha")
|
||||
end
|
||||
|
||||
M.accent = M.scheme.lavender
|
||||
|
||||
M.mode = {
|
||||
n = M.scheme.sky,
|
||||
i = M.scheme.green,
|
||||
v = M.scheme.mauve,
|
||||
[""] = M.scheme.mauve,
|
||||
V = M.scheme.mauve,
|
||||
c = M.scheme.mauve,
|
||||
no = M.scheme.red,
|
||||
s = M.scheme.orange,
|
||||
S = M.scheme.orange,
|
||||
[""] = M.scheme.orange,
|
||||
ic = M.scheme.yellow,
|
||||
R = M.scheme.violet,
|
||||
Rv = M.scheme.violet,
|
||||
cv = M.scheme.red,
|
||||
ce = M.scheme.red,
|
||||
r = M.scheme.cyan,
|
||||
rm = M.scheme.cyan,
|
||||
["r?"] = M.scheme.cyan,
|
||||
["!"] = M.scheme.red,
|
||||
t = M.scheme.red,
|
||||
}
|
||||
|
||||
return M
|
||||
43
dot_config/nvim/lua/config/colorscheme.lua
Normal file
43
dot_config/nvim/lua/config/colorscheme.lua
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
-- Change the colorscheme here, use SPACE u i or :FzfLua colorscheme to change colorscheme
|
||||
|
||||
-- https://www.reddit.com/r/neovim/comments/1d3hk1t/automatic_dark_mode_following_system_theme_on/
|
||||
local function get_system_theme()
|
||||
-- Default value
|
||||
local background = 'light'
|
||||
-- First check whether we are on MacOS
|
||||
if vim.loop.os_uname().sysname == "Darwin" then
|
||||
-- Check if 'defaults' is executable
|
||||
if vim.fn.executable('defaults') ~= 0 then
|
||||
-- Execute command to check if the macOS appearance is set to Dark
|
||||
local appleInterfaceStyle = vim.fn.system({ "defaults", "read", "-g", "AppleInterfaceStyle" })
|
||||
if appleInterfaceStyle:find("Dark") then
|
||||
background = 'dark'
|
||||
end
|
||||
end
|
||||
-- Check if 'busctl' is executable (part of systemd)
|
||||
elseif vim.fn.executable('busctl') ~= 0 then
|
||||
-- Get the current color scheme from xdg-desktop-portal using busctl
|
||||
local result = vim.fn.system({
|
||||
"busctl", "--user", "call", "org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop",
|
||||
"org.freedesktop.portal.Settings", "ReadOne", "ss", "org.freedesktop.appearance", "color-scheme"
|
||||
})
|
||||
-- The result is in the form of "v u 0" for light and "v u 1" for dark
|
||||
local color_scheme = result:match("u%s+(%d+)")
|
||||
|
||||
if color_scheme == '1' then
|
||||
background = 'dark'
|
||||
end
|
||||
else
|
||||
end
|
||||
|
||||
return background
|
||||
end
|
||||
|
||||
if get_system_theme() == 'dark' then
|
||||
vim.o.background = 'dark'
|
||||
vim.cmd.colorscheme("catppuccin")
|
||||
else
|
||||
vim.o.background = 'light'
|
||||
-- vim.cmd.colorscheme("rose-pine")
|
||||
vim.cmd.colorscheme("catppuccin")
|
||||
end
|
||||
7
dot_config/nvim/lua/config/diagnostics.lua
Normal file
7
dot_config/nvim/lua/config/diagnostics.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
local signs = require("config.icons").diagnostics
|
||||
|
||||
-- This provides the diagnostics signs near the line numbers
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||
end
|
||||
51
dot_config/nvim/lua/config/icons.lua
Normal file
51
dot_config/nvim/lua/config/icons.lua
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
-- icons.lua
|
||||
-- All icons used in the configuration are defined in this file.
|
||||
-- Currently are only used in diagnostics, lualine, gitsigns
|
||||
local M = {
|
||||
diagnostics = {
|
||||
Error = "",
|
||||
Warning = "",
|
||||
Hint = "",
|
||||
Information = "",
|
||||
},
|
||||
lsp = "",
|
||||
indent = "",
|
||||
git = {
|
||||
Change = "",
|
||||
Add = "",
|
||||
Delete = "",
|
||||
Rename = "",
|
||||
Branch = "",
|
||||
},
|
||||
lsp_kind = {
|
||||
Text = "",
|
||||
Method = "",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "",
|
||||
Variable = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
Copilot = "",
|
||||
},
|
||||
telescope = " ",
|
||||
}
|
||||
|
||||
return M
|
||||
2
dot_config/nvim/lua/config/keymaps.lua
Normal file
2
dot_config/nvim/lua/config/keymaps.lua
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
-- Entry point of keymaps configuration
|
||||
require("keymaps")
|
||||
31
dot_config/nvim/lua/config/migration.lua
Normal file
31
dot_config/nvim/lua/config/migration.lua
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
local nvim_version = vim.version()
|
||||
|
||||
|
||||
if nvim_version.minor ~= 11 then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_lines = true,
|
||||
})
|
||||
|
||||
-- vim.lsp.enable({
|
||||
-- "clangd",
|
||||
-- "luals",
|
||||
-- })
|
||||
|
||||
local lsp_configs = {}
|
||||
for _, v in ipairs(vim.api.nvim_get_runtime_file('lsp/*', true)) do
|
||||
local name = vim.fn.fnamemodify(v, ':t:r')
|
||||
lsp_configs[name] = true
|
||||
end
|
||||
|
||||
vim.lsp.enable(vim.tbl_keys(lsp_configs))
|
||||
|
||||
-- Delete 0.11 new gr- keymaps
|
||||
vim.keymap.del({ "n" }, "grn")
|
||||
vim.keymap.del({ "n", "x" }, "gra")
|
||||
vim.keymap.del({ "n" }, "gri")
|
||||
|
||||
|
||||
86
dot_config/nvim/lua/config/options.lua
Normal file
86
dot_config/nvim/lua/config/options.lua
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
-- <leader> is space
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
-- Disable netrw (file explorer) use NvimTree instead
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
-- Disable Perl
|
||||
vim.g.loaded_perl_provider = 0 -- Don't load Perl
|
||||
|
||||
-- Format on save
|
||||
vim.g.autoformat = true
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
-- Clipboard
|
||||
-- `unnamedplus` for system clipboard
|
||||
opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus"
|
||||
-- Line number
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
|
||||
-- Confirm before dangerous operations
|
||||
opt.confirm = true
|
||||
|
||||
-- Word wrap
|
||||
opt.linebreak = true
|
||||
|
||||
-- Indentation
|
||||
opt.expandtab = true
|
||||
opt.shiftwidth = 4
|
||||
opt.tabstop = 4
|
||||
opt.shiftround = true
|
||||
|
||||
-- Case
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
|
||||
-- Highlight current line
|
||||
opt.cursorline = true
|
||||
-- opt.cursorcolumn = true -- Highlight current column
|
||||
-- Terminal GUI
|
||||
opt.termguicolors = true
|
||||
|
||||
--- Fold
|
||||
opt.foldmethod = "expr"
|
||||
-- Folding provided by treesitter
|
||||
opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
-- Disable fold at start
|
||||
opt.foldlevelstart = 99
|
||||
opt.foldlevel = 99
|
||||
opt.foldenable = false
|
||||
opt.foldlevelstart = 1
|
||||
|
||||
-- Hide Command Line if empty
|
||||
opt.cmdheight = 0
|
||||
|
||||
-- Scroll
|
||||
opt.scrolloff = 5 -- Always show 5 lines above/below cursor
|
||||
opt.sidescrolloff = 10 -- Always show 10 columns left/right of cursor
|
||||
|
||||
-- Conceal: Hide some characters, might be useful for markdown and LaTeX
|
||||
opt.conceallevel = 2
|
||||
|
||||
-- `laststatus`
|
||||
-- Disable status line: Use `lualine` instead
|
||||
-- opt.laststatus = 0
|
||||
-- 3: Global status line (always at the bottom)
|
||||
opt.laststatus = 3
|
||||
|
||||
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||
-- hover.nvim
|
||||
vim.o.mousemoveevent = true
|
||||
|
||||
-- Hide zero-width space
|
||||
-- vim.api.nvim_create_autocmd("FileType", {
|
||||
-- pattern = "*",
|
||||
-- callback = function()
|
||||
-- vim.opt_local.conceallevel = 2
|
||||
-- vim.cmd([[
|
||||
-- syntax match ZeroWidthSpace /\%u200b/ conceal
|
||||
-- highlight link ZeroWidthSpace Conceal
|
||||
-- ]])
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
vim.fn.matchadd("Conceal", [[\%u200b]], 10, -1, { conceal = "" })
|
||||
2
dot_config/nvim/lua/config/plugins.lua
Normal file
2
dot_config/nvim/lua/config/plugins.lua
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
-- Entry point for all plugins
|
||||
require("plugins")
|
||||
36
dot_config/nvim/lua/config/servers.lua
Normal file
36
dot_config/nvim/lua/config/servers.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
--- Available LSP goes here
|
||||
--- Check https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
|
||||
--- for available server and name
|
||||
local M = {}
|
||||
-- Ensure that the following servers are installed and set
|
||||
-- Use :Mason to list all available servers
|
||||
M.servers = {
|
||||
"bashls", -- Bash
|
||||
"clangd", -- C/C++
|
||||
"gopls", -- Go
|
||||
"html", -- HTML
|
||||
"jsonls", -- JSON
|
||||
"lua_ls", -- Lua
|
||||
-- "markdown_oxide", -- Markdown
|
||||
"pyright", -- Python
|
||||
"rust_analyzer", -- Rust
|
||||
"taplo", -- TOML
|
||||
"ts_ls", -- TypeScript
|
||||
"vimls", -- vimscript
|
||||
"yamlls", -- YAML
|
||||
"beancount", -- Beancount
|
||||
}
|
||||
|
||||
-- Configuration for each server defines here
|
||||
M.server_config = {
|
||||
lua_ls = {
|
||||
capabilities = vim.lsp.protocol.make_client_capabilities(),
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
16
dot_config/nvim/lua/config/vscode.lua
Normal file
16
dot_config/nvim/lua/config/vscode.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
require("plugins.lazy-nvim")
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
-- { import = "plugins.completion" },
|
||||
-- { import = "plugins.fileutils" },
|
||||
-- { import = "plugins.lsp" },
|
||||
-- { import = "plugins.edit" },
|
||||
-- { import = "plugins.misc" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue