yamlls: remove keyOrdering enforcement

bare
Pegasust 2023-03-19 21:25:41 -07:00
parent 0a947801ab
commit dce680f2a8
2 changed files with 78 additions and 79 deletions

View File

@ -128,8 +128,8 @@ vim.api.nvim_create_autocmd({ "VimEnter" }, {
}) })
vim.g.gruvbox_contrast_dark="soft"; vim.g.gruvbox_contrast_dark = "soft";
vim.g.gruvbox_contrast_light="soft"; vim.g.gruvbox_contrast_light = "soft";
vim.opt.ignorecase = true; vim.opt.ignorecase = true;
vim.opt.smartcase = true; vim.opt.smartcase = true;
vim.opt.incsearch = true; vim.opt.incsearch = true;
@ -155,8 +155,8 @@ vim.api.nvim_create_user_command('Dark', function(opts)
local contrast = (opts.args and string.len(opts.args) > 0) and opts.args or vim.g.gruvbox_contrast_dark; local contrast = (opts.args and string.len(opts.args) > 0) and opts.args or vim.g.gruvbox_contrast_dark;
vim.g.gruvbox_contrast_dark = contrast; vim.g.gruvbox_contrast_dark = contrast;
vim.opt.background = "dark"; vim.opt.background = "dark";
end, end,
{nargs = "?";}) { nargs = "?", })
vim.api.nvim_create_user_command('Light', function(opts) vim.api.nvim_create_user_command('Light', function(opts)
-- opts: {name, args: str, fargs: Splited<str>, range, ...} -- opts: {name, args: str, fargs: Splited<str>, range, ...}
@ -164,8 +164,8 @@ vim.api.nvim_create_user_command('Light', function(opts)
local contrast = (opts.args and string.len(opts.args) > 0) and opts.args or vim.g.gruvbox_contrast_dark; local contrast = (opts.args and string.len(opts.args) > 0) and opts.args or vim.g.gruvbox_contrast_dark;
vim.g.gruvbox_contrast_light = contrast; vim.g.gruvbox_contrast_light = contrast;
vim.opt.background = "light"; vim.opt.background = "light";
end, end,
{nargs = "?";}) { nargs = "?", })
vim.opt.lazyredraw = true vim.opt.lazyredraw = true
vim.opt.termguicolors = true vim.opt.termguicolors = true
@ -173,7 +173,7 @@ vim.opt.cursorline = true
-- some plugins misbehave when we do swap files -- some plugins misbehave when we do swap files
vim.opt.swapfile = false vim.opt.swapfile = false
vim.opt.backup = false vim.opt.backup = false
vim.opt.undodir = vim.fn.stdpath('state')..'/.vim/undodir' vim.opt.undodir = vim.fn.stdpath('state') .. '/.vim/undodir'
vim.opt.undofile = true vim.opt.undofile = true
vim.opt.completeopt = 'menuone,noselect' vim.opt.completeopt = 'menuone,noselect'
-- vim.opt.clipboard = "unnamedplus" -- vim.opt.clipboard = "unnamedplus"
@ -355,7 +355,9 @@ end, { desc = '[Z]ettelkasten [G]rep' })
require 'treesitter-context' require 'treesitter-context'
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
yati = { yati = {
enable = true, default_lazy = true, default_fallback = "auto", enable = true,
default_lazy = true,
default_fallback = "auto",
disable = { "nix" } disable = { "nix" }
}, },
indent = { enable = false }, indent = { enable = false },
@ -502,12 +504,10 @@ local on_attach = function(client, bufnr)
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
nmap('<leader>wl', function() nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders())) print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders') end, '[W]orkspace [L]ist Folders')
-- enable inlay hints if available -- enable inlay hints if available
require('inlay-hints').on_attach(client, bufnr) require('inlay-hints').on_attach(client, bufnr)
end end
-- nvim-cmp -- nvim-cmp
local cmp = require 'cmp' local cmp = require 'cmp'
@ -620,7 +620,7 @@ require("mason").setup({
-- Which means Mason's installed path is prioritized against our local install -- Which means Mason's installed path is prioritized against our local install
-- see: https://git.pegasust.com/pegasust/aoc/commit/b45dc32c74d84c9f787ebce7a174c9aa1d411fc2 -- see: https://git.pegasust.com/pegasust/aoc/commit/b45dc32c74d84c9f787ebce7a174c9aa1d411fc2
-- This introduces some pitfalls, so we'll take the approach of trusting user's local installation -- This introduces some pitfalls, so we'll take the approach of trusting user's local installation
PATH = "append"; PATH = "append",
}) })
require('mason-lspconfig').setup({ require('mason-lspconfig').setup({
ensure_installed = servers, ensure_installed = servers,
@ -697,6 +697,17 @@ require('mason-lspconfig').setup_handlers({
root_dir = require('lspconfig.util').root_pattern("deno.json", "deno.jsonc"), root_dir = require('lspconfig.util').root_pattern("deno.json", "deno.jsonc"),
} }
end, end,
["yamlls"] = function()
require('lspconfig').yamlls.setup {
on_attach = on_attach,
capabilities = capabilities,
settings = {
yaml = {
keyOrdering = false,
}
},
}
end,
-- ["rust_analyzer"] = function() -- ["rust_analyzer"] = function()
-- require('lspconfig').rust_analyzer.setup { -- require('lspconfig').rust_analyzer.setup {
-- on_attach = on_attach, -- on_attach = on_attach,
@ -723,61 +734,48 @@ require('mason-lspconfig').setup_handlers({
-- end -- end
}) })
require("rust-tools").setup { require("rust-tools").setup {
tools = { -- rust-tools options tools = {
-- rust-tools options
-- how to execute terminal commands -- how to execute terminal commands
-- options right now: termopen / quickfix -- options right now: termopen / quickfix
executor = require("rust-tools/executors").termopen, executor = require("rust-tools/executors").termopen,
-- callback to execute once rust-analyzer is done initializing the workspace -- callback to execute once rust-analyzer is done initializing the workspace
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error" -- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
on_initialized = function() on_initialized = function()
require('inlay-hints').set_all() require('inlay-hints').set_all()
end, end,
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file. -- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
reload_workspace_from_cargo_toml = true, reload_workspace_from_cargo_toml = true,
-- These apply to the default RustSetInlayHints command -- These apply to the default RustSetInlayHints command
inlay_hints = { inlay_hints = {
-- automatically set inlay hints (type hints) -- automatically set inlay hints (type hints)
-- default: true -- default: true
auto = false, auto = false,
-- Only show inlay hints for the current line -- Only show inlay hints for the current line
only_current_line = false, only_current_line = false,
-- whether to show parameter hints with the inlay hints or not -- whether to show parameter hints with the inlay hints or not
-- default: true -- default: true
show_parameter_hints = true, show_parameter_hints = true,
-- prefix for parameter hints -- prefix for parameter hints
-- default: "<-" -- default: "<-"
parameter_hints_prefix = "<- ", parameter_hints_prefix = "<- ",
-- prefix for all the other hints (type, chaining) -- prefix for all the other hints (type, chaining)
-- default: "=>" -- default: "=>"
other_hints_prefix = "=> ", other_hints_prefix = "=> ",
-- whether to align to the length of the longest line in the file -- whether to align to the length of the longest line in the file
max_len_align = false, max_len_align = false,
-- padding from the left if max_len_align is true -- padding from the left if max_len_align is true
max_len_align_padding = 1, max_len_align_padding = 1,
-- whether to align to the extreme right or not -- whether to align to the extreme right or not
right_align = false, right_align = false,
-- padding from the right if right_align is true -- padding from the right if right_align is true
right_align_padding = 7, right_align_padding = 7,
-- The color of the hints -- The color of the hints
highlight = "Comment", highlight = "Comment",
}, },
-- options same as lsp hover / vim.lsp.util.open_floating_preview() -- options same as lsp hover / vim.lsp.util.open_floating_preview()
hover_actions = { hover_actions = {
-- the border that is used for the hover window -- the border that is used for the hover window
-- see vim.api.nvim_open_win() -- see vim.api.nvim_open_win()
border = { border = {
@ -790,12 +788,10 @@ require("rust-tools").setup {
{ "", "FloatBorder" }, { "", "FloatBorder" },
{ "", "FloatBorder" }, { "", "FloatBorder" },
}, },
-- whether the hover action window gets automatically focused -- whether the hover action window gets automatically focused
-- default: false -- default: false
auto_focus = false, auto_focus = false,
}, },
-- settings for showing the crate graph based on graphviz and the dot -- settings for showing the crate graph based on graphviz and the dot
-- command -- command
crate_graph = { crate_graph = {
@ -811,7 +807,6 @@ require("rust-tools").setup {
-- crates -- crates
-- default: true -- default: true
full = true, full = true,
-- List of backends found on: https://graphviz.org/docs/outputs/ -- List of backends found on: https://graphviz.org/docs/outputs/
-- Is used for input validation and autocompletion -- Is used for input validation and autocompletion
-- Last updated: 2021-08-26 -- Last updated: 2021-08-26
@ -892,7 +887,6 @@ require("rust-tools").setup {
on_attach(client, bufnr) on_attach(client, bufnr)
require('inlay-hints').on_attach(client, bufnr) require('inlay-hints').on_attach(client, bufnr)
nmap('K', require 'rust-tools'.hover_actions.hover_actions, 'Hover Documentation') nmap('K', require 'rust-tools'.hover_actions.hover_actions, 'Hover Documentation')
end, end,
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
@ -900,7 +894,6 @@ require("rust-tools").setup {
command = "clippy", command = "clippy",
} }
} }
}, -- rust-analyzer options }, -- rust-analyzer options
-- debugging stuff -- debugging stuff
@ -975,7 +968,8 @@ require('lualine').setup {
lualine_a = { 'mode' }, lualine_a = { 'mode' },
lualine_b = { 'branch', 'diff', 'diagnostics' }, lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = { lualine_c = {
{ 'filename', {
'filename',
file_status = true, file_status = true,
newfile_status = false, newfile_status = false,
path = 1, path = 1,

View File

@ -66,7 +66,7 @@
in in
cross_platform (system: cross_platform (system:
let let
overlays = import ./../../overlays.nix (flake_inputs // {inherit system;}); overlays = import ./../../overlays.nix (flake_inputs // { inherit system; });
# pkgs = nixpkgs.legacyPackages.${system}.appendOverlays overlays; # pkgs = nixpkgs.legacyPackages.${system}.appendOverlays overlays;
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system overlays; inherit system overlays;
@ -159,6 +159,11 @@
{ {
base.private_chromium.enable = false; base.private_chromium.enable = false;
} }
{
home.packages = [
pkgs.postman
];
}
]; ];
extraSpecialArgs = mkModuleArgs { extraSpecialArgs = mkModuleArgs {
inherit pkgs; inherit pkgs;
@ -181,7 +186,7 @@
base.graphics.enable = false; base.graphics.enable = false;
# don't want to deal with GL stuffs on mac yet :/ # don't want to deal with GL stuffs on mac yet :/
base.graphics.useNixGL.defaultPackage = null; base.graphics.useNixGL.defaultPackage = null;
# NOTE: this actually does not exist # FIXME: this actually does not exist
base.keepass.path = "/Users/htran/keepass.kdbx"; base.keepass.path = "/Users/htran/keepass.kdbx";
base.alacritty.font.size = 11.0; base.alacritty.font.size = 11.0;
base.git.name = "Hung"; base.git.name = "Hung";