home: init neovim
This commit is contained in:
parent
eddcb86e76
commit
92bacd3acd
7 changed files with 72 additions and 0 deletions
|
@ -20,6 +20,13 @@
|
|||
command = lib.getExe rustfmt;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "lua";
|
||||
auto-format = true;
|
||||
formatter = {
|
||||
command = lib.getExe luaformatter;
|
||||
};
|
||||
}
|
||||
];
|
||||
language-server = with pkgs; {
|
||||
nil = {
|
34
home/editors/neovim/config.lua
Normal file
34
home/editors/neovim/config.lua
Normal file
|
@ -0,0 +1,34 @@
|
|||
vim.opt.shiftwidth = 2
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- general
|
||||
lvim.log.level = "info"
|
||||
lvim.format_on_save = { enabled = true, pattern = "*.lua", timeout = 1000 }
|
||||
-- to disable icons and use a minimalist setup, uncomment the following
|
||||
|
||||
|
||||
-- keymappings <https://www.lunarvim.org/docs/configuration/keybindings>
|
||||
lvim.leader = "space"
|
||||
-- add your own keymapping
|
||||
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
|
||||
|
||||
-- -- Change theme settings
|
||||
lvim.colorscheme = "lunar"
|
||||
lvim.transparent_window = true
|
||||
|
||||
lvim.builtin.alpha.active = true
|
||||
lvim.builtin.alpha.mode = "dashboard"
|
||||
lvim.builtin.terminal.active = true
|
||||
lvim.builtin.nvimtree.setup.view.side = "left"
|
||||
lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
lvim.builtin.treesitter.auto_install = true
|
||||
|
||||
lvim.plugins = {
|
||||
{
|
||||
"andweeb/presence.nvim",
|
||||
config = function() require("user.presence").config() end
|
||||
}
|
||||
}
|
5
home/editors/neovim/default.nix
Normal file
5
home/editors/neovim/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = [pkgs.lunarvim];
|
||||
xdg.configFile."lvim/config.lua".source = ./config.lua;
|
||||
xdg.configFile."lvim/lua/user/presence.lua".source = ./lua/presence.lua;
|
||||
}
|
26
home/editors/neovim/lua/presence.lua
Normal file
26
home/editors/neovim/lua/presence.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
local M = {}
|
||||
|
||||
M.config = function()
|
||||
local status_ok, presence = pcall(require, "presence")
|
||||
if not status_ok then return end
|
||||
|
||||
presence:setup {
|
||||
auto_update = true,
|
||||
neovim_image_text = "LunarVim",
|
||||
main_image = "file",
|
||||
client_id = "793271441293967371",
|
||||
buttons = true,
|
||||
log_level = nil,
|
||||
debounce_timeout = 10,
|
||||
enable_line_number = true, -- Displays the current line number instead of the current project
|
||||
editing_text = "Editing %s", -- string rendered when an editable file is loaded in the buffer
|
||||
file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer
|
||||
git_commit_text = "Committing changes", -- string rendered when commiting changes in git
|
||||
plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins
|
||||
reading_text = "Reading %s", -- string rendered when a read-only file is loaded in the buffer
|
||||
workspace_text = "Working on %s", -- Workspace format string (either string or function(git_project_name: string|nil, buffer: string): string)
|
||||
line_number_text = "Line %s out of %s" -- Line number string (for when enable_line_number is set to true)
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
Loading…
Reference in a new issue