1
Fork 0

feat: more volume aliases

This commit is contained in:
Matei Adriel 2022-03-01 11:49:59 +02:00
parent e7ab3b8f26
commit 0c4f5418a0
5 changed files with 50 additions and 56 deletions

View file

@ -2,40 +2,13 @@
"0 debug pnpm:scope": { "0 debug pnpm:scope": {
"selected": 1 "selected": 1
}, },
"1 debug pnpm:package-manifest": { "1 error pnpm": {
"initial": {}, "code": "ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND",
"prefix": "/home/adrielus/Projects/nixos-config"
},
"2 debug pnpm:context": {
"currentLockfileExists": false,
"storeDir": "/home/adrielus/.pnpm-store/v3",
"virtualStoreDir": "/home/adrielus/Projects/nixos-config/node_modules/.pnpm"
},
"3 debug pnpm:stage": {
"prefix": "/home/adrielus/Projects/nixos-config",
"stage": "resolution_started"
},
"4 debug pnpm:update-check": {
"currentVersion": "6.22.2",
"latestVersion": "6.29.1"
},
"5 error pnpm": {
"code": "ERR_PNPM_FETCH_404",
"hint": "prettierd is not in the npm registry, or you have no permission to fetch it.\n\nAn authorization header was used: Bearer 265b[hidden]",
"request": {
"authHeaderValue": "Bearer 265ba49b-cc14-402e-8c57-e070a7bc1997",
"url": "https://registry.npmjs.org/prettierd"
},
"response": {
"size": 0
},
"pkgName": "prettierd",
"pkgsStack": [],
"err": { "err": {
"name": "pnpm", "name": "pnpm",
"message": "GET https://registry.npmjs.org/prettierd: Not Found - 404", "message": "No package.json (or package.yaml, or package.json5) was found in \"/home/adrielus/Projects/nixos-config\".",
"code": "ERR_PNPM_FETCH_404", "code": "ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND",
"stack": "pnpm: GET https://registry.npmjs.org/prettierd: Not Found - 404\n at RetryOperation._fn (/nix/store/kh5rqvj2l82gznih1b5isc43mk2dnh6j-pnpm-6.22.2/lib/node_modules/pnpm/dist/pnpm.cjs:84952:18)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)" "stack": "pnpm: No package.json (or package.yaml, or package.json5) was found in \"/home/adrielus/Projects/nixos-config\".\n at readProjectManifest (/nix/store/iigpa453qi2achcz6mq83bnwif8m42mj-pnpm-6.22.2/lib/node_modules/pnpm/dist/pnpm.cjs:43046:13)\n at async Object.readProjectManifestOnly (/nix/store/iigpa453qi2achcz6mq83bnwif8m42mj-pnpm-6.22.2/lib/node_modules/pnpm/dist/pnpm.cjs:43050:28)\n at async readProjectManifestOnly (/nix/store/iigpa453qi2achcz6mq83bnwif8m42mj-pnpm-6.22.2/lib/node_modules/pnpm/dist/pnpm.cjs:43269:24)\n at async Object.handler (/nix/store/iigpa453qi2achcz6mq83bnwif8m42mj-pnpm-6.22.2/lib/node_modules/pnpm/dist/pnpm.cjs:129915:24)\n at async /nix/store/iigpa453qi2achcz6mq83bnwif8m42mj-pnpm-6.22.2/lib/node_modules/pnpm/dist/pnpm.cjs:134121:20\n at async run (/nix/store/iigpa453qi2achcz6mq83bnwif8m42mj-pnpm-6.22.2/lib/node_modules/pnpm/dist/pnpm.cjs:134095:34)\n at async runPnpm (/nix/store/iigpa453qi2achcz6mq83bnwif8m42mj-pnpm-6.22.2/lib/node_modules/pnpm/dist/pnpm.cjs:134307:5)\n at async /nix/store/iigpa453qi2achcz6mq83bnwif8m42mj-pnpm-6.22.2/lib/node_modules/pnpm/dist/pnpm.cjs:134299:7"
} }
} }
} }

View file

@ -1,6 +1,6 @@
local M = {} local M = {}
local function has_words_before () local function has_words_before()
local line, col = unpack(vim.api.nvim_win_get_cursor(0)) local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match('%s') == nil return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match('%s') == nil
end end
@ -8,8 +8,16 @@ end
function M.setup() function M.setup()
local cmp = require("cmp") local cmp = require("cmp")
local lspkind = require('lspkind') local lspkind = require('lspkind')
local luasnip = require("luasnip")
local options = { local options = {
formatting = {format = lspkind.cmp_format()}, formatting = {format = lspkind.cmp_format()},
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
require('luasnip').lsp_expand(args.body)
end
},
mapping = { mapping = {
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), {'i', 'c'}), ['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), {'i', 'c'}),
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}), ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}),
@ -17,28 +25,34 @@ function M.setup()
['<C-y>'] = cmp.config.disable, ['<C-y>'] = cmp.config.disable,
['<C-e>'] = cmp.mapping({i = cmp.mapping.abort(), c = cmp.mapping.close()}), ['<C-e>'] = cmp.mapping({i = cmp.mapping.abort(), c = cmp.mapping.close()}),
['<CR>'] = cmp.mapping.confirm({select = true}), ['<CR>'] = cmp.mapping.confirm({select = true}),
-- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings -- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings
['<C-Space>'] = cmp.mapping.confirm {behavior = cmp.ConfirmBehavior.Insert, select = true}, ['<C-Space>'] = cmp.mapping.confirm {behavior = cmp.ConfirmBehavior.Insert, select = true},
['<Tab>'] = function(fallback) -- TODO: abstract booth of those away perhaps?
if not cmp.select_next_item() then ["<Tab>"] = cmp.mapping(function(fallback)
if vim.bo.buftype ~= 'prompt' and has_words_before() then if cmp.visible() then
cmp.complete() cmp.select_next_item()
else elseif luasnip.expand_or_jumpable() then
fallback() luasnip.expand_or_jump()
end elseif has_words_before() then
cmp.complete()
else
fallback()
end end
end, end, {"i", "s"}),
['<S-Tab>'] = function(fallback) ["<S-Tab>"] = cmp.mapping(function(fallback)
if not cmp.select_prev_item() then if cmp.visible() then
if vim.bo.buftype ~= 'prompt' and has_words_before() then cmp.select_prev_item()
cmp.complete() elseif luasnip.jumpable(-1) then
else luasnip.jump(-1)
fallback() else
end fallback()
end end
end, end, {"i", "s"})
}, },
sources = cmp.config.sources({{name = 'nvim_lsp'}}, {{name = 'buffer'}}) sources = cmp.config.sources({
{name = 'nvim_lsp'}, -- lsp completion
{name = 'luasnip'} -- snippets
}, {{name = 'buffer'}})
} }
cmp.setup(options) cmp.setup(options)

View file

@ -70,7 +70,7 @@
# fceux # fceux
# games # games
# tetrio-desktop tetrio-desktop
# mindustry # mindustry
# edopro # edopro
]; ];

View file

@ -56,14 +56,16 @@ in
null-ls-nvim # generic language server null-ls-nvim # generic language server
telescope-file-browser-nvim # file creation/deletion using telescope telescope-file-browser-nvim # file creation/deletion using telescope
lspkind-nvim # show icons in lsp completion menus lspkind-nvim # show icons in lsp completion menus
symbols-outline-nvim # tree view for symbols in document # symbols-outline-nvim # tree view for symbols in document
# Cmp related stuff. See https://github.com/hrsh7th/nvim-cmp # Cmp related stuff. See https://github.com/hrsh7th/nvim-cmp
cmp-nvim-lsp cmp-nvim-lsp
cmp-buffer cmp-buffer
cmp-path cmp-path
cmp-cmdline cmp-cmdline
nvim-cmp cmp_luasnip
nvim-cmp # completion engine
luasnip # snippet engine
]; ];
}; };
} }

View file

@ -1,13 +1,18 @@
{ {
# Ls but looks nicer
ls = "exa -la"; ls = "exa -la";
# What even is this???
sl = "sl -e"; sl = "sl -e";
# WIfi stuff # WIfi stuff
wifi = "sudo nmcli con up id"; wifi = "sudo nmcli con up id";
# Volume controls # Volume controls
vup = "amixer set Master 8%+"; "v up" = "amixer set Master 8%+";
vdown = "amixer set Master 8%-"; "v down" = "amixer set Master 8%-";
"v min" = "amixer set Master 0%";
"v max" = "amixer set Master 100%";
# Rebuuild nixos # Rebuuild nixos
rebuild = "sudo nixos-rebuild switch --flake ~/Projects/nixos-config/"; rebuild = "sudo nixos-rebuild switch --flake ~/Projects/nixos-config/";