add some more hints on the default settings for neovim; just go with alejandra formatter; add more docs on qa
parent
e7efe1a965
commit
6352f821c3
|
@ -0,0 +1,12 @@
|
|||
# Neovim: Testing cmp for color with Tailwind
|
||||
|
||||
- [ ] It should detect a project uses tailwind, maybe via some kind of config file
|
||||
(`tailwind.config.{cjs,mjs,js,ts,json,tsx,toml,yaml}`), or just based on the
|
||||
string content or via tree-stiter. Check this by `:LspInfo` and `tailwindcss-lsp`
|
||||
should attach to the current buffer that has tailwind-css string
|
||||
- [ ] Type in a classname `text-red-500`, just stop at somewhere and start
|
||||
browsing the cmp-lsp window. It should show a color in place of `lspkind`.
|
||||
This validates `tailwindcss-colorizer-cmp.nvim` is good
|
||||
- [ ] Hit that autocomplete, the string should show the color red. This validates
|
||||
`nvim-colorizer.lua` is properly setup.
|
||||
|
|
@ -104,7 +104,7 @@ WPlug('kyazdani42/nvim-web-devicons') -- icons for folder and filetype
|
|||
WPlug('m-demare/hlargs.nvim') -- highlights arguments; great for func prog
|
||||
WPlug('folke/todo-comments.nvim') -- Highlights TODO
|
||||
WPlug('NvChad/nvim-colorizer.lua') -- color highlighter with tailwind support
|
||||
WPlug('roobert/tailwindcss-colorizer-cmp.nvim') -- color highlighter with tailwind support
|
||||
WPlug('roobert/tailwindcss-colorizer-cmp.nvim') -- color for tailiwnd for compe
|
||||
|
||||
-- other utilities
|
||||
WPlug('nvim-treesitter/nvim-treesitter-context') -- Top one-liner context of func/class scope
|
||||
|
@ -112,6 +112,7 @@ WPlug('nvim-treesitter/playground') -- Sees Treesitter AST - less h
|
|||
WPlug('saadparwaiz1/cmp_luasnip') -- snippet engine
|
||||
WPlug('L3MON4D3/LuaSnip') -- snippet engine
|
||||
WPlug('mickael-menu/zk-nvim') -- Zettelkasten
|
||||
WPlug('folke/neodev.nvim') -- Neovim + lua development setup
|
||||
-- Switch cases:
|
||||
-- `gsp` -> PascalCase (classes), `gsc` -> camelCase (Java), `gs_` -> snake_case (C/C++/Rust)
|
||||
-- `gsu` -> UPPER_CASE (CONSTs), `gsk` -> kebab-case (Clojure), `gsK` -> Title-Kebab-Case
|
||||
|
@ -241,7 +242,57 @@ colorscheme gruvbox
|
|||
]])
|
||||
require('hlargs').setup()
|
||||
require('nvim-web-devicons').setup()
|
||||
require('trouble').setup()
|
||||
require('trouble').setup {
|
||||
position = "bottom", -- position of the list can be: bottom, top, left, right
|
||||
height = 10, -- height of the trouble list when position is top or bottom
|
||||
width = 50, -- width of the list when position is left or right
|
||||
icons = true, -- use devicons for filenames
|
||||
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
|
||||
severity = nil, -- nil (ALL) or vim.diagnostic.severity.ERROR | WARN | INFO | HINT
|
||||
fold_open = "", -- icon used for open folds
|
||||
fold_closed = "", -- icon used for closed folds
|
||||
group = true, -- group results by file
|
||||
padding = true, -- add an extra new line on top of the list
|
||||
action_keys = {
|
||||
-- key mappings for actions in the trouble list
|
||||
-- map to {} to remove a mapping, for example:
|
||||
-- close = {},
|
||||
close = "q", -- close the list
|
||||
cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
|
||||
refresh = "r", -- manually refresh
|
||||
jump = { "<cr>", "<tab>" }, -- jump to the diagnostic or open / close folds
|
||||
open_split = { "<c-x>" }, -- open buffer in new split
|
||||
open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
|
||||
open_tab = { "<c-t>" }, -- open buffer in new tab
|
||||
jump_close = { "o" }, -- jump to the diagnostic and close the list
|
||||
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
|
||||
switch_severity = "s", -- switch "diagnostics" severity filter level to HINT / INFO / WARN / ERROR
|
||||
toggle_preview = "P", -- toggle auto_preview
|
||||
hover = "K", -- opens a small popup with the full multiline message
|
||||
preview = "p", -- preview the diagnostic location
|
||||
close_folds = { "zM", "zm" }, -- close all folds
|
||||
open_folds = { "zR", "zr" }, -- open all folds
|
||||
toggle_fold = { "zA", "za" }, -- toggle fold of current file
|
||||
previous = "k", -- previous item
|
||||
next = "j" -- next item
|
||||
},
|
||||
indent_lines = true, -- add an indent guide below the fold icons
|
||||
auto_open = false, -- automatically open the list when you have diagnostics
|
||||
auto_close = false, -- automatically close the list when you have no diagnostics
|
||||
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
|
||||
auto_fold = false, -- automatically fold a file trouble list at creation
|
||||
auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result
|
||||
signs = {
|
||||
-- icons / text used for a diagnostic
|
||||
error = "",
|
||||
warning = "",
|
||||
hint = "",
|
||||
information = "",
|
||||
other = "",
|
||||
},
|
||||
use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
|
||||
}
|
||||
|
||||
|
||||
-- TODO: Any way to collect all the TODOs and its variants?
|
||||
require('todo-comments').setup()
|
||||
|
@ -922,10 +973,10 @@ require('mason-lspconfig').setup_handlers({
|
|||
defaultConfig = {
|
||||
indent_style = "space",
|
||||
indent_size = 4,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
["pyright"] = function()
|
||||
|
|
|
@ -4,11 +4,14 @@
|
|||
# Additional configurations goes to profiles/<user>
|
||||
# or inlined in flake.nix
|
||||
{
|
||||
config, # Represents the realized final configuration
|
||||
pkgs, # This is by default just ``= import <nixpkgs>{}`
|
||||
config,
|
||||
# Represents the realized final configuration
|
||||
pkgs,
|
||||
# This is by default just ``= import <nixpkgs>{}`
|
||||
myHome,
|
||||
myLib,
|
||||
option, # The options we're given, this might be useful for typesafety?
|
||||
option,
|
||||
# The options we're given, this might be useful for typesafety?
|
||||
proj_root,
|
||||
...
|
||||
}: let
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
pkgs.callPackage
|
||||
({runCommand}:
|
||||
# runCommand source: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix#L33
|
||||
runCommand outputPath {
|
||||
runCommand outputPath
|
||||
{
|
||||
inherit yamlContent;
|
||||
nativeBuildInputs = [pkgs.yq];
|
||||
}
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
naersk, # rust packages
|
||||
naersk,
|
||||
# rust packages
|
||||
...
|
||||
} @ pkgs_input: {
|
||||
# dot-hwtr = import "./dot-hwtr" pkgs_input;
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
lib,
|
||||
...
|
||||
}:
|
||||
with builtins; with lib; let
|
||||
with builtins;
|
||||
with lib; let
|
||||
pkgs2storeContents = l:
|
||||
map (x: {
|
||||
map
|
||||
(x: {
|
||||
object = x;
|
||||
symlink = "none";
|
||||
})
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
config,
|
||||
...
|
||||
}:
|
||||
with builtins; with lib; {
|
||||
with builtins;
|
||||
with lib; {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["wsl" "compatibility" "interopPreserveArgvZero"] ["wsl" "interop" "preserveArgvZero"])
|
||||
];
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
config,
|
||||
...
|
||||
}:
|
||||
with builtins; with lib; {
|
||||
with builtins;
|
||||
with lib; {
|
||||
options.wsl = with types; let
|
||||
coercedToStr = coercedTo (oneOf [bool path int]) toString str;
|
||||
in {
|
||||
|
|
|
@ -2,5 +2,4 @@
|
|||
inputs,
|
||||
cell,
|
||||
}: let
|
||||
in {
|
||||
}
|
||||
in {}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
inputs,
|
||||
cell,
|
||||
}: {
|
||||
}
|
||||
}: {}
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
# This is an interface for home-profiles and should not contain opinionated
|
||||
# configurations. It should provide alternative configurations, aggregates
|
||||
# or new configurations
|
||||
_imports@{inputs, cell}: let
|
||||
_imports@{ inputs, cell }:
|
||||
let
|
||||
namespace = "repo";
|
||||
imports = _imports // { inherit namespace; };
|
||||
in {
|
||||
git = { config , lib , ... }: let
|
||||
in
|
||||
{
|
||||
git = { config, lib, ... }:
|
||||
let
|
||||
cfg = config."${namespace}".git;
|
||||
baseAliases = {
|
||||
a = "add";
|
||||
|
@ -20,7 +23,8 @@ in {
|
|||
};
|
||||
default-user = "Pegasust";
|
||||
default-email = "pegasucksgg@gmail.com";
|
||||
in {
|
||||
in
|
||||
{
|
||||
options."${namespace}".git = {
|
||||
aliases = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
|
@ -87,10 +91,12 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
alacritty = {config, lib}: let
|
||||
alacritty = { config, lib }:
|
||||
let
|
||||
inherit (inputs.cells.repo.lib) fromYAML;
|
||||
cfg = config."${namespace}".alacritty;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options."${namespace}".alacritty = {
|
||||
font.family = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.singleLineStr;
|
||||
|
@ -125,9 +131,13 @@ in {
|
|||
};
|
||||
config.programs.alacritty = {
|
||||
enable = cfg.enable;
|
||||
settings = let ;
|
||||
actualConfig = if cfg.config-path != null then fromYAML (builtins.readFile cfg.config-path) else {};
|
||||
in lib.recursiveUpdate actualConfig {
|
||||
settings =
|
||||
let
|
||||
;
|
||||
actualConfig =
|
||||
if cfg.config-path != null then fromYAML (builtins.readFile cfg.config-path) else { };
|
||||
in
|
||||
lib.recursiveUpdate actualConfig {
|
||||
font.normal.family = lib.mkIf (font.family != null) font.family;
|
||||
font.size = lib.mkIf (font.size != null) font.size;
|
||||
};
|
||||
|
@ -135,9 +145,11 @@ in {
|
|||
};
|
||||
|
||||
# TODO: chromium is not really supported on darwin
|
||||
private_chromium = { config, pkgs, lib, ... }: let
|
||||
private_chromium = { config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config."${namespace}".private_chromium;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options."${namespace}".private_chromium = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
{inputs, cell}: let
|
||||
{ inputs, cell }:
|
||||
let
|
||||
namespace = "repo";
|
||||
|
||||
|
||||
yamlToJsonDrv = pkgs: yamlContent: outputPath: (pkgs.runCommand
|
||||
outputPath { inherit yamlContent; nativeBuildInputs = [ pkgs.yq ]; }
|
||||
outputPath
|
||||
{ inherit yamlContent; nativeBuildInputs = [ pkgs.yq ]; }
|
||||
# run yq which outputs '.' (no filter) on file at yamlPath
|
||||
# note that $out is passed onto the bash/sh script for execution
|
||||
''
|
||||
echo "$yamlContent" | yq >$out
|
||||
'')
|
||||
{ });
|
||||
in {
|
||||
in
|
||||
{
|
||||
fromYAML = yamlContent: bulitins.fromJSON (builtins.readFile (yamlToJsonDrv inputs.nixpkgs yamlContent "fromYaml.json"));
|
||||
|
||||
# NOTE: Deprecate
|
||||
|
|
|
@ -64,8 +64,7 @@
|
|||
rev = info.rev;
|
||||
shortRev = builtins.substring 0 7 info.rev;
|
||||
}
|
||||
else {
|
||||
}
|
||||
else {}
|
||||
)
|
||||
else if info.type == "path"
|
||||
then {
|
||||
|
@ -112,7 +111,9 @@
|
|||
callFlake4 = flakeSrc: locks: let
|
||||
flake = import (flakeSrc + "/flake.nix");
|
||||
|
||||
inputs = builtins.mapAttrs (n: v:
|
||||
inputs =
|
||||
builtins.mapAttrs
|
||||
(n: v:
|
||||
if v.flake or true
|
||||
then callFlake4 (fetchTree (v.locked // v.info)) v.inputs
|
||||
else fetchTree (v.locked // v.info))
|
||||
|
|
Loading…
Reference in New Issue