feat: worked on nvim config more
This commit is contained in:
parent
441844b0c5
commit
8ea7367442
16
dotfiles/neovim/lua/my/plugins/comment.lua
Normal file
16
dotfiles/neovim/lua/my/plugins/comment.lua
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
-- Update comments for certain languages
|
||||||
|
local function setCommentString(extension, commentString)
|
||||||
|
vim.cmd('autocmd BufEnter '.. extension .. ' :lua vim.api.nvim_buf_set_option(0, "commentstring", "' .. commentString .. '")')
|
||||||
|
vim.cmd('autocmd BufFilePost '.. extension .. ' :lua vim.api.nvim_buf_set_option(0, "commentstring", "' .. commentString ..'")')
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.setup()
|
||||||
|
require('nvim_comment').setup()
|
||||||
|
|
||||||
|
setCommentString(".nix", "# %s")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
return M
|
|
@ -4,10 +4,10 @@ function M.setup()
|
||||||
require("my.plugins.lspconfig").setup()
|
require("my.plugins.lspconfig").setup()
|
||||||
require("my.plugins.fzf-lua").setup()
|
require("my.plugins.fzf-lua").setup()
|
||||||
require("my.plugins.treesitter").setup()
|
require("my.plugins.treesitter").setup()
|
||||||
|
require("my.plugins.comment").setup()
|
||||||
|
|
||||||
-- Other unconfigured plugins
|
-- Other unconfigured plugins
|
||||||
require('nvim-autopairs').setup()
|
require('nvim-autopairs').setup()
|
||||||
require('nvim_comment').setup()
|
|
||||||
require("startup").setup({theme = "dashboard"})
|
require("startup").setup({theme = "dashboard"})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -92,22 +92,17 @@ function M.setup()
|
||||||
end
|
end
|
||||||
|
|
||||||
local efmLanguages = {
|
local efmLanguages = {
|
||||||
typescript = {
|
|
||||||
formatCommand = 'prettierd "${INPUT}"',
|
|
||||||
formatStdin = true,
|
|
||||||
env = {string.format('PRETTIERD_DEFAULT_CONFIG=%s', vim.fn.expand('~/.config/nvim/utils/linter-config/.prettierrc.json'))}
|
|
||||||
},
|
|
||||||
lua = {{formatCommand = formatLua, formatStdin = true}}
|
lua = {{formatCommand = formatLua, formatStdin = true}}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Setup auto-formatting
|
-- Setup auto-formatting
|
||||||
require"lspconfig".efm.setup {
|
require"lspconfig".efm.setup {
|
||||||
init_options = {documentFormatting = true},
|
init_options = {documentFormatting = true},
|
||||||
filetypes = {"lua", "ts", "js", "tsx", "jsx"},
|
filetypes = {"lua"},
|
||||||
settings = {rootMarkers = {".git/"}, languages = efmLanguages}
|
settings = {rootMarkers = {".git/"}, languages = efmLanguages}
|
||||||
}
|
}
|
||||||
|
|
||||||
local autoFormatOn = {lua = 100, purs = 1000, nix = 100, js = 100, ts = 100, tsx = 100, jsx = 100}
|
local autoFormatOn = {lua = 200, purs = 1000, nix = 200, js = 300, ts = 300, tsx = 300, jsx = 300}
|
||||||
|
|
||||||
-- Auto format
|
-- Auto format
|
||||||
for extension, timeout in pairs(autoFormatOn) do
|
for extension, timeout in pairs(autoFormatOn) do
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
let
|
let
|
||||||
githubAlacrittyTheme =
|
githubAlacrittyTheme =
|
||||||
"${pkgs.githubNvimTheme}/terminal/alacritty/github_light.yml";
|
"${pkgs.githubNvimTheme}/terminal/alacritty/github_light.yml";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
home-manager.users.adrielus.programs.alacritty = {
|
home-manager.users.adrielus.programs.alacritty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -22,7 +23,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
# transparent bg:)
|
# transparent bg:)
|
||||||
background_opacity = 0.6;
|
# background_opacity = 0.6;
|
||||||
fonts.normal.family = "Source Code Pro";
|
fonts.normal.family = "Source Code Pro";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,20 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }:
|
||||||
home-manager.users.adrielus.home.packages = with pkgs; [
|
let
|
||||||
fira-code
|
nerdfonts =
|
||||||
fira-code-symbols
|
(pkgs.nerdfonts.override {
|
||||||
source-code-pro
|
fonts = [ "FiraCode" "SourceCodePro" ];
|
||||||
corefonts
|
});
|
||||||
];
|
in
|
||||||
|
{
|
||||||
|
home-manager.users.adrielus = {
|
||||||
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# fira-code
|
||||||
|
# fira-code-symbols
|
||||||
|
# source-code-pro
|
||||||
|
corefonts
|
||||||
|
nerdfonts
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue