This commit is contained in:
parent
7e5d880156
commit
d93f63cf82
40 changed files with 448 additions and 649 deletions
|
|
@ -1,4 +1,3 @@
|
|||
clipmenud &
|
||||
flameshot &
|
||||
|
||||
# vim: ft=sh
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ CompileFlags:
|
|||
If:
|
||||
PathMatch: '.*\.(cpp|hpp)'
|
||||
CompileFlags:
|
||||
Add: [ -std=c++20 ]
|
||||
Add: [ -std=c++23 ]
|
||||
|
|
|
|||
1
.config/nvim/.gitignore
vendored
Normal file
1
.config/nvim/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
.luarc.json
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
{
|
||||
"workspace.library": [
|
||||
"/home/wzray/.local/share/nvim/lazy/neodev.nvim/types/stable",
|
||||
"/usr/share/nvim/runtime/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-surround/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/telescope-fzf-native.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-tree.lua/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/cmp-nvim-lsp/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/cmp-buffer/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/lspkind.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/lualine.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-web-devicons/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-treesitter-textobjects/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-treesitter-context/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-treesitter/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/indent-blankline.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-notify/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-colorizer.lua/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/mason.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/lazy.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/LuaSnip/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-lastplace/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/telescope.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/Navigator.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/trouble.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/bufferline.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/Comment.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-lspconfig/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/neodev.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/onedark.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/plenary.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/fidget.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-autopairs/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/todo-comments.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-cmp/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/telescope-emoji.nvim/lua",
|
||||
"/usr/share/nvim/runtime",
|
||||
"/home/wzray/.dotfiles/.config/nvim/lua",
|
||||
"${3rd}/luv/library"
|
||||
]
|
||||
}
|
||||
|
|
@ -1,43 +1,55 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "c1851d5c519611dfc451b6582961b2602e0af89b" },
|
||||
"LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" },
|
||||
"Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"iptables": { "branch": "master", "commit": "0d18b1e468f547dd7e2c494d42bc134a1e0eac7e" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" },
|
||||
"mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" },
|
||||
"multilayout.nvim": { "branch": "main", "commit": "613ec4ace9097a4464a558777aaf6a15b3d8bd78" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "3ddd1b4edefa425fda5a9f95a4f25578727c0bb3" },
|
||||
"lua-async-await": { "branch": "main", "commit": "652d94df34e97abe2d4a689edbc4270e7ead1a98" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||
"multilayout.nvim": { "branch": "main", "commit": "105f22f6329f19a1824f58774d1899f2a69a5e77" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "106c4bcc053a5da783bf4a9d907b6f22485c2ea0" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||
"nvim-dap": { "branch": "master", "commit": "4c0e3a98465fac963dfde898cc8b878094153a43" },
|
||||
"nvim-java": { "branch": "main", "commit": "3d56b7461facb42f135e25b2636bf220a7f0ed42" },
|
||||
"nvim-java-core": { "branch": "main", "commit": "229ebcdfa33c75cf746f97c46c2893b2de3626e5" },
|
||||
"nvim-java-dap": { "branch": "main", "commit": "55f239532f7a3789d21ea68d1e795abc77484974" },
|
||||
"nvim-java-refactor": { "branch": "main", "commit": "b51a57d862338999059e1d1717df3bc80a3a15c0" },
|
||||
"nvim-java-test": { "branch": "main", "commit": "7f0f40e9c5b7eab5096d8bec6ac04251c6e81468" },
|
||||
"nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "61e5109c8cf24807e4ae29813a3a82b31821dd45" },
|
||||
"nvim-notify": { "branch": "master", "commit": "b5825cf9ee881dd8e43309c93374ed5b87b7a896" },
|
||||
"nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "e7d1b7dadc62fe2eccc17d814354b0a5688621ce" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "5c48b8ba1b0b7b25feb6e34e7eb293ea893aedc4" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "0e3be38005e9673d044e994b1e4b123adb040179" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "f1420728f59843eb2ef084406b3d0201a0a0932d" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "11de4da47f3e69cb70c3ae9816bd8af166cbe121" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "2010fc6ec03e2da552b4886fceb2f7bc0fc2e9c0" },
|
||||
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
||||
"nvim-surround": { "branch": "main", "commit": "fcfa7e02323d57bfacc3a141f8a74498e1522064" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "68c67adfabfd1ce923839570507ef2e81ab8a408" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "660861b1849256398f70450afdf93908d28dc945" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" },
|
||||
"nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "918e89e6993b2901eea47b9f4eb666d53c2542a6" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
|
||||
"quickfix-reflector.vim": { "branch": "master", "commit": "6a6a9e28e1713b9e9db99eec1e6672e5666c01b9" },
|
||||
"spring-boot.nvim": { "branch": "main", "commit": "218c0c26c14d99feca778e4d13f5ec3e8b1b60f0" },
|
||||
"telescope-emoji.nvim": { "branch": "master", "commit": "86248d97be84a1ce83f0541500ef9edc99ea2aa1" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||
"vim-bbcode": { "branch": "master", "commit": "6fb28c6deae5844ee2bf0b97ef2fea04bd3d4eac" },
|
||||
"vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" },
|
||||
"vim-caddyfile": { "branch": "master", "commit": "6d60d5af0d73f20b88ec388a9d70188d55ed8223" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||
"vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" },
|
||||
"vim-peekaboo": { "branch": "master", "commit": "cc4469c204099c73dd7534531fa8ba271f704831" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }
|
||||
"vim-peekaboo": { "branch": "master", "commit": "2a8a3187ba6b15201b2563a3f0331fcdf49da36c" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"vim-wakatime": { "branch": "master", "commit": "d7973b157a632d1edeff01818f18d67e584eeaff" }
|
||||
}
|
||||
|
|
|
|||
36
.config/nvim/lua/config/filetypes.lua
Normal file
36
.config/nvim/lua/config/filetypes.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
local function has_ansible_root(path, recursive)
|
||||
if not recursive then
|
||||
return vim.uv.fs_stat(
|
||||
vim.fs.joinpath(vim.fs.dirname(path), 'ansible.cfg')
|
||||
)
|
||||
end
|
||||
|
||||
return vim.fs.find('ansible.cfg', {
|
||||
path = vim.fs.dirname(path),
|
||||
upward = true,
|
||||
limit = 1
|
||||
})[1]
|
||||
end
|
||||
|
||||
local function yaml_filetype(recursive, p2)
|
||||
return function (path)
|
||||
print(p2)
|
||||
if has_ansible_root(path, recursive) then
|
||||
return "yaml.ansible"
|
||||
else
|
||||
return "yaml"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
['yaml'] = yaml_filetype(false),
|
||||
['yml'] = yaml_filetype(false),
|
||||
},
|
||||
pattern = {
|
||||
[".*/roles/.*/tasks/.*%.ya?ml"] = yaml_filetype(true),
|
||||
[".*/roles/.*/handlers/.*%.ya?ml"] = yaml_filetype(true),
|
||||
[".*/playbooks/.*%.ya?ml"] = yaml_filetype(true),
|
||||
},
|
||||
})
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
require("config.mappings")
|
||||
require("config.options")
|
||||
require("config.mappings")
|
||||
require("config.autocmd")
|
||||
require("config.filetypes")
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ map({ 'n', 'v' }, 'j', 'v:count == 0 ? "gj" : "j"', { expr = true, silent = true
|
|||
|
||||
-- Copy and paste from clipboard
|
||||
map({ 'n', 'v' }, '<leader>y', '"+y')
|
||||
map({ 'n', 'v' }, '<leader>Y', '"+Y')
|
||||
map({ 'n', 'v' }, '<leader>Y', '"+y$')
|
||||
map({ 'n', 'v' }, '<leader>p', '"+p<ESC>')
|
||||
map({ 'n', 'v' }, '<leader>P', '"+P<ESC>')
|
||||
|
||||
|
|
@ -49,3 +49,8 @@ map('i', '<M-BS>', '<C-w>')
|
|||
-- Move lines quickly
|
||||
map('n', '<C-M-k>', ':m-2<CR>', { silent = true })
|
||||
map('n', '<C-M-j>', ':m+1<CR>', { silent = true })
|
||||
|
||||
map('n', '<Leader>dt', ':diffthis<CR>', { silent = true })
|
||||
map('n', '<Leader>do', ':diffoff<CR>', { silent = true })
|
||||
|
||||
map('n', '<Leader>lr', ':LspR<CR>')
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ local servers = {
|
|||
yamlls = require('lsp.yamlls'),
|
||||
}
|
||||
|
||||
vim.lsp.set_log_level('info')
|
||||
-- vim.lsp.set_log_level('info')
|
||||
|
||||
local on_attach = function(_, bufnr)
|
||||
local nmap = function(keys, func)
|
||||
|
|
@ -33,6 +33,10 @@ local on_attach = function(_, bufnr)
|
|||
nmap('gr', require('telescope.builtin').lsp_references)
|
||||
nmap('gt', require('telescope.builtin').lsp_type_definitions)
|
||||
|
||||
-- nmap('gd', vim.lsp.buf.definition)
|
||||
-- nmap('gr', vim.lsp.buf.references)
|
||||
-- nmap('gt', vim.lsp.buf.type_definition)
|
||||
|
||||
nmap('<leader>sd', require('telescope.builtin').diagnostics)
|
||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols)
|
||||
nmap('<leader>as', require('telescope.builtin').lsp_dynamic_workspace_symbols)
|
||||
|
|
@ -42,17 +46,22 @@ local on_attach = function(_, bufnr)
|
|||
nmap('<C-k>', vim.lsp.buf.signature_help)
|
||||
|
||||
nmap('gI', require('telescope.builtin').lsp_implementations)
|
||||
-- nmap('gI', vim.lsp.buf.implementation)
|
||||
nmap('gD', vim.lsp.buf.declaration)
|
||||
|
||||
nmap('<leader>F', vim.lsp.buf.format)
|
||||
end
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local lspconfig = require('lspconfig')
|
||||
capabilities.textDocument.foldingRange = {
|
||||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true
|
||||
}
|
||||
|
||||
for server_name, config in pairs(servers) do
|
||||
lspconfig[server_name].setup(vim.tbl_deep_extend('keep', {
|
||||
vim.lsp.config(server_name, vim.tbl_deep_extend('keep', {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}, config))
|
||||
vim.lsp.enable(server_name)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
return {
|
||||
'Winseven4lyf/vim-bbcode',
|
||||
'isobit/vim-caddyfile',
|
||||
'junegunn/vim-peekaboo',
|
||||
'nfnty/vim-nftables',
|
||||
'rcarriga/nvim-notify',
|
||||
'stefandtw/quickfix-reflector.vim',
|
||||
'nfnty/vim-nftables',
|
||||
'tpope/vim-fugitive',
|
||||
'junegunn/vim-peekaboo',
|
||||
'tpope/vim-sleuth',
|
||||
'vim-scripts/iptables',
|
||||
{ 'akinsho/bufferline.nvim', opts = {}, dependencies = { 'navarasu/onedark.nvim' } },
|
||||
|
|
@ -13,36 +14,7 @@ return {
|
|||
{ 'kylechui/nvim-surround', version = '*', event = 'VeryLazy', opts = {} },
|
||||
{ 'lukas-reineke/indent-blankline.nvim', main = 'ibl', opts = {} },
|
||||
{ 'norcalli/nvim-colorizer.lua', opts={ '*' }, dependencies = { 'navarasu/onedark.nvim' } },
|
||||
-- { 'wakatime/vim-wakatime', event = 'VeryLazy' },
|
||||
{ 'wakatime/vim-wakatime', event = 'VeryLazy' },
|
||||
{ 'williamboman/mason.nvim', opts = {} },
|
||||
'Winseven4lyf/vim-bbcode',
|
||||
|
||||
|
||||
{ 'mrsobakin/multilayout.nvim' , opts = {
|
||||
layouts = {
|
||||
ru = {
|
||||
-- Names of this layout, as `libukb` reports.
|
||||
names = { "Russian" },
|
||||
from = [[ёйцукенгшщзхъфывапролджэячсмитьбю.Ё"№;:?ЙЦУКЕНГШЩЗХЪ/ФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,]],
|
||||
to = [[`qwertyuiop[]asdfghjkl;'zxcvbnm,./~@#$^&QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?]],
|
||||
}
|
||||
},
|
||||
aliases = {
|
||||
-- Maximum length of default commands aliases.
|
||||
-- Increasing this value leads to longer startup times.
|
||||
max_length = 2,
|
||||
-- Extra commands that you want to alias.
|
||||
-- They are aliased regardless of `max_length`.
|
||||
extra = { "sort" },
|
||||
},
|
||||
-- Whether to use `libukb`. If this is set to false, `langmap`
|
||||
-- won't automatically switch when your layout does.
|
||||
use_libukb = true,
|
||||
-- Path to the `libukb.so`. If `nil`, ukb will be automatically
|
||||
-- downloaded, builded and installed in the neovim data directory.
|
||||
libukb_path = nil,
|
||||
-- Function of type `callback(layout: string)`. Called whenever
|
||||
-- current keyboard layout changes.
|
||||
callback = nil,
|
||||
}}
|
||||
{ dir = '~/.local/share/nvim/preseed/' }, -- 'https://git.netizen.se/vim-preseed',
|
||||
}
|
||||
|
|
|
|||
30
.config/nvim/lua/plugins/multilayout.lua
Normal file
30
.config/nvim/lua/plugins/multilayout.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
'mrsobakin/multilayout.nvim',
|
||||
opts = {
|
||||
layouts = {
|
||||
ru = {
|
||||
-- Names of this layout, as `libukb` reports.
|
||||
names = { "Russian" },
|
||||
from = [[ёйцукенгшщзхъфывапролджэячсмитьбю.Ё"№;:?ЙЦУКЕНГШЩЗХЪ/ФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,]],
|
||||
to = [[`qwertyuiop[]asdfghjkl;'zxcvbnm,./~@#$^&QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?]],
|
||||
}
|
||||
},
|
||||
aliases = {
|
||||
-- Maximum length of default commands aliases.
|
||||
-- Increasing this value leads to longer startup times.
|
||||
max_length = 2,
|
||||
-- Extra commands that you want to alias.
|
||||
-- They are aliased regardless of `max_length`.
|
||||
extra = { "sort" },
|
||||
},
|
||||
-- Whether to use `libukb`. If this is set to false, `langmap`
|
||||
-- won't automatically switch when your layout does.
|
||||
use_libukb = true,
|
||||
-- Path to the `libukb.so`. If `nil`, ukb will be automatically
|
||||
-- downloaded, builded and installed in the neovim data directory.
|
||||
libukb_path = nil,
|
||||
-- Function of type `callback(layout: string)`. Called whenever
|
||||
-- current keyboard layout changes.
|
||||
callback = nil,
|
||||
}
|
||||
}
|
||||
|
|
@ -10,6 +10,7 @@ return {
|
|||
|
||||
config = function()
|
||||
local actions = require('telescope.actions')
|
||||
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
|
|
@ -18,8 +19,12 @@ return {
|
|||
['<C-d>'] = false,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||
-- ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||
["<C-b>"] = require("trouble.sources.telescope").open
|
||||
},
|
||||
n = {
|
||||
["<C-q>"] = require("trouble.sources.telescope").open
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -34,11 +39,17 @@ return {
|
|||
})
|
||||
end)
|
||||
|
||||
vim.keymap.set('n', '<leader>?', require('telescope.builtin').live_grep)
|
||||
vim.keymap.set('n', '<leader>wf', require('telescope.builtin').grep_string)
|
||||
vim.keymap.set('n', '<leader>?', require('telescope.builtin').live_grep)
|
||||
vim.keymap.set('n', '<leader>wf', require('telescope.builtin').grep_string)
|
||||
vim.keymap.set('n', '<leader>of', require('telescope.builtin').oldfiles)
|
||||
vim.keymap.set('n', '<leader>af', require('telescope.builtin').git_files)
|
||||
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files)
|
||||
vim.keymap.set('n', '<leader>.', require('telescope').extensions.emoji.emoji)
|
||||
|
||||
|
||||
-- Use this to add more results without clearing the trouble list
|
||||
-- local add_to_trouble = require("trouble.sources.telescope").add
|
||||
|
||||
local telescope = require("telescope")
|
||||
end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,5 +38,6 @@ return {
|
|||
}
|
||||
vim.o.termguicolors = true
|
||||
vim.cmd.colorscheme 'onedark'
|
||||
vim.cmd.hi 'clear @spell'
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,30 +1,23 @@
|
|||
return {
|
||||
-- 'kevinhwang91/nvim-ufo',
|
||||
-- dependencies = {
|
||||
-- 'kevinhwang91/promise-async'
|
||||
-- },
|
||||
-- config = function()
|
||||
-- vim.defer_fn(function()
|
||||
-- vim.o.foldcolumn = '0'
|
||||
-- vim.o.foldlevel = 99
|
||||
-- vim.o.foldlevelstart = 99
|
||||
-- vim.o.foldenable = true
|
||||
--
|
||||
-- vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
|
||||
-- vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
|
||||
--
|
||||
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- capabilities.textDocument.foldingRange = {
|
||||
-- dynamicRegistration = false,
|
||||
-- lineFoldingOnly = true
|
||||
-- }
|
||||
-- local language_servers = vim.lsp.get_clients()
|
||||
-- for _, ls in ipairs(language_servers) do
|
||||
-- require('lspconfig')[ls].setup({
|
||||
-- capabilities = capabilities
|
||||
-- })
|
||||
-- end
|
||||
-- require('ufo').setup()
|
||||
-- end, 0)
|
||||
-- end
|
||||
'kevinhwang91/nvim-ufo',
|
||||
dependencies = {
|
||||
'kevinhwang91/promise-async'
|
||||
},
|
||||
config = function()
|
||||
vim.defer_fn(function()
|
||||
vim.o.foldcolumn = '0'
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
|
||||
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
|
||||
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
|
||||
|
||||
require('ufo').setup({
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
return {'treesitter', 'indent'}
|
||||
end
|
||||
})
|
||||
end, 0)
|
||||
end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ unbind-key -T copy-mode-vi V
|
|||
unbind-key -T copy-mode-vi C-v
|
||||
unbind-key -T copy-mode-vi C-c
|
||||
unbind-key -T copy-mode-vi Escape
|
||||
# unbind-key -T copy-mode-vi /
|
||||
# unbind-key -T copy-mode-vi ?
|
||||
|
||||
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
|
||||
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
||||
|
|
@ -40,4 +42,7 @@ bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
|||
bind-key -T copy-mode-vi C-c send-keys -X cancel
|
||||
bind-key -T copy-mode-vi Escape send-keys -X clear-selection
|
||||
|
||||
bind-key -T copy-mode-vi ? command-prompt -T search -p "(search down)" { send-keys -X search-forward "%%" }
|
||||
bind-key -T copy-mode-vi / command-prompt -T search -p "(search up)" { send-keys -X search-backward "%%" }
|
||||
|
||||
# vim: ft=tmux
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
set -a
|
||||
|
||||
PATH="$HOME/.local/share/go/bin:$PATH"
|
||||
PATH="\
|
||||
$HOME/.local/share/go/bin:\
|
||||
$HOME/.local/share/dotnet:\
|
||||
$PATH"
|
||||
PATH="${$(find -L ~/.local/bin ! -name '.*' -type d -printf %p:)%%:}:$PATH"
|
||||
|
||||
TIMEFMT=$'\ncmd\t%J\nreal\t%*E\nuser\t%U\nsys\t%S\ncpu\t%P'
|
||||
|
||||
# lc vars
|
||||
LANG="en_US.UTF-8"
|
||||
LANGUAGE="en_US.UTF-8"
|
||||
|
|
@ -35,14 +40,15 @@ XDG_PICTURES_DIR="$HOME/"
|
|||
XDG_VIDEOS_DIR="$HOME/"
|
||||
|
||||
# default configs
|
||||
ANDROID_HOME="${HOME}/.local/share/android"
|
||||
ANDROID_HOME="${HOME}/.local/share/android-home"
|
||||
ANDROID_USER_HOME="${HOME}/.local/share/android-home"
|
||||
ANDROID_AVD_HOME="${ANDROID_HOME}/avd"
|
||||
BAT_THEME="TwoDark"
|
||||
EDITOR="/usr/bin/nvim"
|
||||
GNUPGHOME='~/.local/share/gnupg'
|
||||
GOPATH="${HOME}/.local/share/go"
|
||||
GPG_TTY="$(tty)"
|
||||
JAVA_HOME="/usr/lib/jvm/java-23-openjdk"
|
||||
JAVA_HOME="/usr/lib/jvm/java-21-openjdk"
|
||||
LESS="-x4 --wheel-lines 3 --mouse"
|
||||
MANPAGER="sh -c 'col -bx | bat -l man -p --theme Monokai\ Extended'"
|
||||
MANROFFOPT="-c"
|
||||
|
|
@ -53,5 +59,7 @@ GRADLE_USER_HOME="${HOME}/.local/share/gradle"
|
|||
DOCKER_CONFIG="${HOME}/.local/share/docker"
|
||||
COMPOSE_BAKE=true
|
||||
GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT=1 # clippy <3
|
||||
DOTNET_ROOT="${HOME}/.local/share/dotnet"
|
||||
|
||||
set +a
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ autoload -U select-word-style
|
|||
select-word-style b
|
||||
|
||||
# options
|
||||
setopt extendedglob
|
||||
setopt auto_pushd
|
||||
|
||||
# keybinds
|
||||
|
|
@ -58,7 +57,10 @@ alias lsd='/usr/bin/ls'
|
|||
alias l="ls -lh"
|
||||
alias la="ls -lah"
|
||||
alias ll="ls -lh"
|
||||
alias ltr='ls -lt'
|
||||
alias lt="ls -ltr"
|
||||
alias lss='ls -lS'
|
||||
alias lsr='ls -lSr'
|
||||
|
||||
# set bat as help pager
|
||||
alias -g -- --help='--help 2>&1 | bat --language=help --style=plain --theme Monokai\ Extended'
|
||||
|
|
@ -84,12 +86,12 @@ alias sudo='sudo ' # allow aliases with sudo
|
|||
alias rz='exec zsh'
|
||||
alias venv='source src_venv'
|
||||
alias ex='source src_example'
|
||||
alias ap='source src_add_path'
|
||||
alias pa='source src_add_path'
|
||||
alias info='pinfo'
|
||||
alias bat='bat '
|
||||
alias img='nsxiv'
|
||||
alias xclip='xclip -selection clipboard'
|
||||
alias xxclip='head -c-1 | xclip -selection clipboard'
|
||||
alias xcp='perl -pe "chomp if eof" | xclip -selection clipboard'
|
||||
alias rgf='rg --files | rg'
|
||||
alias wt='watch --color -d -cn 0.1 '
|
||||
alias .e='set -a && source .env && set +a'
|
||||
|
|
@ -97,30 +99,37 @@ alias vimu='vim -u /dev/null'
|
|||
alias reswap="sudo bash -c 'echo Working...; swapoff /swapfile && sudo swapon /swapfile'"
|
||||
alias make="make -j$(nproc)"
|
||||
alias py='python3'
|
||||
alias q='qalc'
|
||||
alias neofetch='fastfetch'
|
||||
alias open='xdg-open'
|
||||
alias m.='if mount | grep -q "$(pwd)"; then umount -l .; cd .; else mount .; cd .; fi'
|
||||
alias rs='stow -R .'
|
||||
alias sst='ssh -t'
|
||||
alias rdj='rmdir ./*'
|
||||
alias qr='qrencode -t ansiutf8'
|
||||
|
||||
# function aliases
|
||||
bl() { brightnessctl set "$1"% > /dev/null; }
|
||||
nosw() { alacritty --class 'noswallow' -e "$@"; }; compdef _command nosw
|
||||
t() { taskell "${1:-${HOME}/.taskell.md}"; }
|
||||
vims() { filepath="$(type "$1" | rev | cut -d ' ' -f 1 | rev)"; [ $? -eq 0 ] && vim "${filepath}"; }; compdef _command vims
|
||||
tl() { tree -C "$@" | bat }; compdef _tree tl
|
||||
diff() { /usr/bin/diff --color -u "$@" | delta; }; compdef _files di
|
||||
diff() { /usr/bin/diff --color -u "$@" | delta; }; compdef _files di;
|
||||
|
||||
# compdef
|
||||
compdef -a '_git; _git-commit' gdc # todo
|
||||
compdef '_files -g "*.md"' md
|
||||
compdef _ollama ollama
|
||||
|
||||
# ansible
|
||||
alias ap='ansible-playbook'
|
||||
alias ag='ansible-galaxy'
|
||||
|
||||
# git aliases
|
||||
gl() { git log --decorate "$@" | bat }; compdef '_git; _git-log' gl
|
||||
gus() { git branch --set-upstream-to="${1:?}/${2:?}" "${2:?}"}; compdef '_git; _git-push' gus
|
||||
gpo() { git push --set-upstream origin "$(git rev-parse --abbrev-ref HEAD)" "$@"}
|
||||
gus() { git branch --set-upstream-to="${1:?}/${2:?}" "${2:?}" }; compdef '_git; _git-push' gus
|
||||
gpo() { git push --set-upstream origin "$(git rev-parse --abbrev-ref HEAD)" "$@" }
|
||||
gru() { git remote get-url "${1-origin}" }; compdef '_gor' gru
|
||||
alias ga="git add"
|
||||
alias ga.="git add ." # always fatfinger this
|
||||
alias gb="git branch"
|
||||
alias gc="git commit"
|
||||
alias gca="git commit --allow-empty-message --amend --no-edit"
|
||||
|
|
@ -131,7 +140,8 @@ alias gcls="git clone --depth=1"
|
|||
alias gcm="git commit --allow-empty-message -m ''"
|
||||
alias gcd='git commit --no-gpg-sign'
|
||||
alias gcmd="git commit --allow-empty-message -m '' --no-gpg-sign"
|
||||
alias gcn="git clean"
|
||||
alias gcn="git clean -nfd"
|
||||
alias gcn!="git clean -fd"
|
||||
alias gcp="git cherry-pick"
|
||||
alias gd="git diff"
|
||||
alias gds="gd --staged"
|
||||
|
|
@ -148,10 +158,12 @@ alias grjs="git rebase --cancel"
|
|||
alias grm="git remote"
|
||||
alias grs="git restore --staged"
|
||||
alias grt="git reset"
|
||||
alias grt!="git reset --hard"
|
||||
alias gsm='git submodule'
|
||||
alias grc='git rm --cached'
|
||||
alias gs="git status"
|
||||
alias gsc="git switch -c"
|
||||
alias gs.='git status .'
|
||||
alias gsc="git switch -C"
|
||||
alias gsh="git show"
|
||||
alias gsj="git stash"
|
||||
alias gsp="git stash pop"
|
||||
|
|
@ -159,6 +171,10 @@ alias gt="git tag"
|
|||
alias gus="git fetch --unshallow"
|
||||
alias gdj='DELTA_FEATURES="+side-by-side" gd'
|
||||
alias gdsj='DELTA_FEATURES="+side-by-side" gds'
|
||||
alias gshj='DELTA_FEATURES="+side-by-side" gsh'
|
||||
alias gcln='git clean -nxfd'
|
||||
alias gcln!='git clean -xfd'
|
||||
alias gct="gc -am 'Add files via upload :trollface:'"
|
||||
|
||||
# docker aliases
|
||||
alias d='docker'
|
||||
|
|
@ -166,17 +182,22 @@ alias dc='docker compose'
|
|||
alias d!='/usr/bin/docker'
|
||||
alias dc!='d! compose'
|
||||
|
||||
alias dj='dc up -d --force-recreate'
|
||||
alias djl='dc up -d --force-recreate && dl'
|
||||
alias dl='dc logs -f'
|
||||
alias dk='dc down'
|
||||
alias dv='d volume'
|
||||
alias di='d image'
|
||||
alias dj='dc up -d --force-recreate'
|
||||
alias djb='dj --build'
|
||||
alias djbl='djb && dl'
|
||||
alias djl='dj && dl'
|
||||
alias dk='dc down'
|
||||
alias dl='dc logs -f'
|
||||
alias dr='d run --rm -it'
|
||||
alias drs='dc restart'
|
||||
alias drsl='dc restart && dl'
|
||||
alias dv='d volume'
|
||||
|
||||
# tmux stuff
|
||||
tn() { tmux new-session -s "${1-"$(basename "$(pwd)")"}" }
|
||||
alias ta="tmux a -t"
|
||||
alias ta='tmux a -t'
|
||||
# ta() { tmux a -t "$1" }; compdef '_tmux; _tmux-attach-session' ta
|
||||
|
||||
# disable xon control chars
|
||||
stty -ixon
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/zsh
|
||||
|
||||
mode::enable() {
|
||||
local mode_path="${HOME}/.config/zsh/modes/$1.sh"
|
||||
[ ! -f "$mode_path" ] && echo "Mode not found!" && return 1
|
||||
|
|
@ -11,6 +13,18 @@ mode::enable() {
|
|||
}
|
||||
|
||||
|
||||
mode::get_functions() {
|
||||
perl -ne '/^(?>function\s+)?([\x21-\x7e]+)\s*\(\)/ && print "$1\n"' < "$1"
|
||||
}
|
||||
|
||||
mode::get_variables() {
|
||||
perl -ne '/^(?>declare\s+(?>--?\w+\s*)+\s*)?\s*([\x21-\x3c\x3e-\x7e]+)=.*$/ && print "$1\n"' < "$1"
|
||||
}
|
||||
|
||||
mode::get_aliases() {
|
||||
perl -ne '/^(?:noglob\s+)?alias ([\x21-\x3c\x3e-\x7e]+)=/ && print "$1\n"' < "$1"
|
||||
}
|
||||
|
||||
mode::disable() {
|
||||
export PS1="${MODE__OLD_PS1}"
|
||||
local mode_path="${HOME}/.config/zsh/modes/$MODE__ACTIVE_MODE.sh"
|
||||
|
|
@ -18,45 +32,78 @@ mode::disable() {
|
|||
unset -v "MODE__OLD_PS1"
|
||||
unset -v "MODE__ACTIVE_MODE"
|
||||
|
||||
for mode_variable in $(perl -ne '/^(?>declare\s+(?>--?\w+\s*)+\s*)?\s*([\x21-\x3c\x3e-\x7e]+)=.*$/ && print "$1\n"' < "$mode_path"); do
|
||||
for mode_variable in $(mode::get_variables "$mode_path"); do
|
||||
unset "$mode_variable"
|
||||
done
|
||||
|
||||
for mode_function in $(perl -ne '/^(?>function\s+)?([\x21-\x7e]+)\s*\(\)/ && print "$1\n"' < "$mode_path"); do
|
||||
for mode_function in $(mode::get_functions "$mode_path"); do
|
||||
unset -f "$mode_function"
|
||||
done
|
||||
|
||||
for mode_alias in $(perl -ne '/^alias ([\x21-\x3c\x3e-\x7e]+)=/ && print "$1\n"'< "$mode_path"); do
|
||||
for mode_alias in $(mode::get_aliases "$mode_path"); do
|
||||
unalias "$mode_alias"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
mode::help() {
|
||||
echo "USAGE"
|
||||
echo " mode [-h]"
|
||||
echo "Usage:"
|
||||
echo " mode <MODENAME>"
|
||||
echo " mode"
|
||||
echo
|
||||
echo "OPTIONS"
|
||||
echo " -h for help lol"
|
||||
echo
|
||||
echo "AVAILABLE MODES"
|
||||
echo "Available modes:"
|
||||
for mode in ~/.config/zsh/modes/*; do
|
||||
printf " %s\n" "$(basename "${mode%.sh}")"
|
||||
done
|
||||
}
|
||||
|
||||
m() {
|
||||
[ -n "$MODE__ACTIVE_MODE" ] && mode::disable && return
|
||||
local cmd="${1:?}"
|
||||
|
||||
case "$cmd" in
|
||||
m() {
|
||||
[ -n "$MODE__ACTIVE_MODE" ] && {
|
||||
mode::disable
|
||||
[ -z "$1" ] && return
|
||||
}
|
||||
|
||||
[ -z "$1" ] && {
|
||||
echo 'Error: Missing mode name!'
|
||||
mode::help
|
||||
return 1
|
||||
} >&2
|
||||
|
||||
case "$1" in
|
||||
"-h"|"--help")
|
||||
mode::help
|
||||
;;
|
||||
*)
|
||||
mode::enable "$cmd" || mode::help >&2
|
||||
mode::enable "$1" || mode::help >&2
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
mm() {
|
||||
[ -z "$MODE__ACTIVE_MODE" ] && return 1
|
||||
|
||||
local mode_path="${HOME}/.config/zsh/modes/$MODE__ACTIVE_MODE.sh"
|
||||
|
||||
echo "Active mode: $MODE__ACTIVE_MODE"
|
||||
|
||||
echo
|
||||
echo 'Aliases: '
|
||||
for mode_alias in $(mode::get_aliases "$mode_path"); do
|
||||
printf ' '
|
||||
alias "$mode_alias"
|
||||
done
|
||||
|
||||
echo
|
||||
echo 'Functions:'
|
||||
for mode_function in $(mode::get_functions "$mode_path"); do
|
||||
echo " $mode_function"
|
||||
done
|
||||
|
||||
echo
|
||||
echo 'Variables:'
|
||||
for mode_variable in $(mode::get_variables "$mode_path"); do
|
||||
echo " $mode_variable"
|
||||
done
|
||||
}
|
||||
|
||||
alias 'm?'=mm
|
||||
|
|
|
|||
7
.config/zsh/modes/dt.sh
Normal file
7
.config/zsh/modes/dt.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
alias db='dotnet build'
|
||||
alias df='dotnet format'
|
||||
alias dt='dotnet test'
|
||||
alias dr='dotnet restore'
|
||||
noglob alias df?='dotnet format --verify-no-changes'
|
||||
alias dff='df; df; df?'
|
||||
alias da='dff && db && dt'
|
||||
Loading…
Add table
Add a link
Reference in a new issue