mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-26 07:15:37 +00:00
updates with ec2
This commit is contained in:
parent
0aade99d4a
commit
f1bc34e8fd
142
nixos/home.nix
142
nixos/home.nix
@ -9,8 +9,10 @@ in
|
|||||||
|
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
firefox
|
# firefox
|
||||||
unzip
|
unzip
|
||||||
|
neovim
|
||||||
|
gcc # for tree-sitter
|
||||||
# alacritty
|
# alacritty
|
||||||
# unstable.neovim
|
# unstable.neovim
|
||||||
tmux
|
tmux
|
||||||
@ -22,40 +24,40 @@ in
|
|||||||
sd
|
sd
|
||||||
jq
|
jq
|
||||||
tealdeer
|
tealdeer
|
||||||
unstable._1password-gui
|
/* unstable._1password-gui */
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.alacritty = {
|
#programs.alacritty = {
|
||||||
enable = true;
|
# enable = true;
|
||||||
settings = {
|
# settings = {
|
||||||
window = {
|
# window = {
|
||||||
dimensions = {
|
# dimensions = {
|
||||||
columns = 85;
|
# columns = 85;
|
||||||
lines = 30;
|
# lines = 30;
|
||||||
};
|
# };
|
||||||
padding = {
|
# padding = {
|
||||||
x = 20;
|
# x = 20;
|
||||||
y = 20;
|
# y = 20;
|
||||||
};
|
# };
|
||||||
};
|
# };
|
||||||
scrolling.history = 10000;
|
# scrolling.history = 10000;
|
||||||
font = {
|
# font = {
|
||||||
size = 15.0;
|
# size = 15.0;
|
||||||
};
|
# };
|
||||||
key_bindings = [
|
# key_bindings = [
|
||||||
{
|
# {
|
||||||
key = "F";
|
# key = "F";
|
||||||
mods = "Super";
|
# mods = "Super";
|
||||||
action = "ToggleFullscreen";
|
# action = "ToggleFullscreen";
|
||||||
}
|
# }
|
||||||
{
|
# {
|
||||||
key = "L";
|
# key = "L";
|
||||||
mods = "Super";
|
# mods = "Super";
|
||||||
chars = "\x1F";
|
# chars = "\x1F";
|
||||||
}
|
# }
|
||||||
];
|
# ];
|
||||||
};
|
# };
|
||||||
};
|
#};
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -114,9 +116,9 @@ in
|
|||||||
grl = "gh run view --log";
|
grl = "gh run view --log";
|
||||||
|
|
||||||
# Vim
|
# Vim
|
||||||
v = "vim";
|
v = "nvim";
|
||||||
vl = "vim -c 'normal! `0'";
|
vl = "nvim -c 'normal! `0'";
|
||||||
vll = "vim -c 'Hist'";
|
vll = "nvim -c 'Hist'";
|
||||||
|
|
||||||
# Notes
|
# Notes
|
||||||
qn = "quicknote";
|
qn = "quicknote";
|
||||||
@ -127,6 +129,7 @@ in
|
|||||||
# Improved CLI Tools
|
# Improved CLI Tools
|
||||||
cat = "bat"; # Swap cat with bat
|
cat = "bat"; # Swap cat with bat
|
||||||
h = "http -Fh --all"; # Curl site for headers
|
h = "http -Fh --all"; # Curl site for headers
|
||||||
|
j = "just";
|
||||||
|
|
||||||
# Fun CLI Tools
|
# Fun CLI Tools
|
||||||
weather = "curl wttr.in/$WEATHER_CITY";
|
weather = "curl wttr.in/$WEATHER_CITY";
|
||||||
@ -191,7 +194,7 @@ in
|
|||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
"starship.toml".source = ../starship/starship.toml.configlink;
|
"starship.toml".source = ../starship/starship.toml.configlink;
|
||||||
#"alacritty/alacritty.yml".source = ../alacritty.configlink/alacritty.yml;
|
#"alacritty/alacritty.yml".source = ../alacritty.configlink/alacritty.yml;
|
||||||
# "nvim/init.lua".source = ../nvim.configlink/init.lua;
|
"nvim/init.lua".source = ./init.lua;
|
||||||
};
|
};
|
||||||
|
|
||||||
# nixpkgs.overlays = [(
|
# nixpkgs.overlays = [(
|
||||||
@ -205,51 +208,26 @@ in
|
|||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.neovim = {
|
#programs.neovim = {
|
||||||
enable = true;
|
# enable = true;
|
||||||
package = pkgs.neovim-nightly;
|
# # package = pkgs.neovim-nightly;
|
||||||
vimAlias = true;
|
# vimAlias = true;
|
||||||
plugins = with pkgs.vimPlugins; [
|
# extraPackages = with pkgs; [
|
||||||
fzf-vim
|
# nodePackages.pyright
|
||||||
fzfWrapper
|
# rust-analyzer
|
||||||
vim-eunuch
|
# terraform-ls
|
||||||
vim-vinegar
|
# ];
|
||||||
surround
|
# #extraConfig = builtins.concatStringsSep "\n" [
|
||||||
commentary
|
# # ''
|
||||||
repeat
|
# # luafile ${builtins.toString ./init.lua}
|
||||||
gruvbox-nvim
|
# # ''
|
||||||
nvim-lspconfig
|
# #];
|
||||||
lsp-colors-nvim
|
# #extraConfig = ''
|
||||||
vim-vsnip
|
# # lua << EOF
|
||||||
vim-vsnip-integ
|
# # ${builtins.readFile ./init.lua}
|
||||||
nvim-compe
|
# # EOF
|
||||||
tabular
|
# #'';
|
||||||
vimwiki
|
#};
|
||||||
vim-rooter
|
|
||||||
lualine-nvim
|
|
||||||
nvim-web-devicons
|
|
||||||
nvim-treesitter
|
|
||||||
vim-fish
|
|
||||||
nginx-vim
|
|
||||||
vim-terraform
|
|
||||||
vim-toml
|
|
||||||
vim-helm
|
|
||||||
vim-nix
|
|
||||||
gitsigns-nvim
|
|
||||||
plenary-nvim
|
|
||||||
vim-hexokinase
|
|
||||||
];
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
nodePackages.pyright
|
|
||||||
rust-analyzer
|
|
||||||
terraform-ls
|
|
||||||
];
|
|
||||||
extraConfig = ''
|
|
||||||
lua << EOF
|
|
||||||
${builtins.readFile ./init.lua}
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# # Neovim config
|
# # Neovim config
|
||||||
# home.file = {
|
# home.file = {
|
||||||
|
729
nixos/init.lua
729
nixos/init.lua
@ -1,27 +1,157 @@
|
|||||||
-- LSP Settings
|
-- Bootstrap the Packer plugin manager
|
||||||
-- ============
|
local fn = vim.fn
|
||||||
|
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||||
require('lspconfig').rust_analyzer.setup{}
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
require('lspconfig').pyright.setup{
|
packer_bootstrap = fn.system(
|
||||||
cmd = { "poetry", "run", "pyright-langserver", "--stdio" }
|
{
|
||||||
|
'git', 'clone', '--depth', '1',
|
||||||
|
'https://github.com/wbthomason/packer.nvim', install_path
|
||||||
}
|
}
|
||||||
require'compe'.setup({
|
)
|
||||||
enabled = true,
|
end
|
||||||
source = {
|
|
||||||
path = true,
|
-- Packer plugin installations
|
||||||
buffer = true,
|
require('packer').startup(function(use)
|
||||||
nvim_lsp = true,
|
|
||||||
|
-- Maintain plugin manager
|
||||||
|
use 'wbthomason/packer.nvim'
|
||||||
|
|
||||||
|
-- Startup speed hacks
|
||||||
|
use {
|
||||||
|
'lewis6991/impatient.nvim',
|
||||||
|
config = function()
|
||||||
|
require('impatient')
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Important tweaks
|
||||||
|
use 'tpope/vim-surround' --- Manipulate parentheses
|
||||||
|
use 'tpope/vim-commentary' --- Use gc or gcc to add comments
|
||||||
|
|
||||||
|
-- Convenience tweaks
|
||||||
|
use 'tpope/vim-eunuch' --- File manipulation in Vim
|
||||||
|
use 'tpope/vim-vinegar' --- Fixes netrw file explorer
|
||||||
|
use 'tpope/vim-fugitive' --- Git commands and syntax
|
||||||
|
use 'tpope/vim-repeat' --- Actually repeat using .
|
||||||
|
use 'christoomey/vim-tmux-navigator' --- Hotkeys for tmux panes
|
||||||
|
|
||||||
|
-- Colorscheme
|
||||||
|
use {
|
||||||
|
'morhetz/gruvbox',
|
||||||
|
config = function()
|
||||||
|
vim.cmd[[colorscheme gruvbox]]
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Git next to line numbers
|
||||||
|
use {
|
||||||
|
'lewis6991/gitsigns.nvim',
|
||||||
|
branch = 'main',
|
||||||
|
requires = {'nvim-lua/plenary.nvim'},
|
||||||
|
config = function()
|
||||||
|
require('gitsigns').setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Status bar
|
||||||
|
-- use {
|
||||||
|
-- 'hoob3rt/lualine.nvim',
|
||||||
|
-- requires = { 'kyazdani42/nvim-web-devicons', opt = true },
|
||||||
|
-- config = function()
|
||||||
|
-- require('lualine').setup({
|
||||||
|
-- options = {
|
||||||
|
-- theme = 'gruvbox',
|
||||||
|
-- icons_enabled = true
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
-- end
|
||||||
|
-- }
|
||||||
|
|
||||||
|
-- Improve speed and filetype detection
|
||||||
|
use {
|
||||||
|
'nathom/filetype.nvim',
|
||||||
|
config = function()
|
||||||
|
-- Filetype for .env files
|
||||||
|
local envfiletype = function()
|
||||||
|
vim.bo.filetype = 'text'
|
||||||
|
vim.bo.syntax = 'sh'
|
||||||
|
end
|
||||||
|
-- Force filetype patterns that Vim doesn't know about
|
||||||
|
require('filetype').setup({
|
||||||
|
overrides = {
|
||||||
|
extensions = {
|
||||||
|
Brewfile = 'brewfile',
|
||||||
|
muttrc = 'muttrc',
|
||||||
|
hcl = 'terraform',
|
||||||
},
|
},
|
||||||
|
literal = {
|
||||||
|
Caskfile = 'brewfile',
|
||||||
|
[".gitignore"] = 'gitignore',
|
||||||
|
},
|
||||||
|
complex = {
|
||||||
|
[".*git/config"] = "gitconfig",
|
||||||
|
["tmux.conf%..*link"] = "tmux",
|
||||||
|
["gitconfig%..*link"] = "gitconfig",
|
||||||
|
[".*ignore%..*link"] = "gitignore",
|
||||||
|
[".*%.toml%..*link"] = "toml",
|
||||||
|
},
|
||||||
|
function_extensions = {},
|
||||||
|
function_literal = {
|
||||||
|
[".envrc"] = envfiletype,
|
||||||
|
[".env"] = envfiletype,
|
||||||
|
[".env.dev"] = envfiletype,
|
||||||
|
[".env.prod"] = envfiletype,
|
||||||
|
[".env.example"] = envfiletype,
|
||||||
|
},
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Alignment tool
|
||||||
|
use 'godlygeek/tabular'
|
||||||
|
|
||||||
|
-- Markdown renderer / wiki notes
|
||||||
|
use 'vimwiki/vimwiki'
|
||||||
|
|
||||||
|
-- Markdown pretty view
|
||||||
|
use 'ellisonleao/glow.nvim'
|
||||||
|
|
||||||
|
-- Navigation
|
||||||
|
use {
|
||||||
|
'ggandor/lightspeed.nvim',
|
||||||
|
branch = 'smart-autojump'
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Snippet engine
|
||||||
|
use 'L3MON4D3/LuaSnip'
|
||||||
|
|
||||||
|
-- =======================================================================
|
||||||
|
-- Language Server
|
||||||
|
-- =======================================================================
|
||||||
|
|
||||||
|
-- Language server engine
|
||||||
|
use {
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
requires = { 'hrsh7th/cmp-nvim-lsp' },
|
||||||
|
config = function()
|
||||||
|
local capabilities = require('cmp_nvim_lsp').update_capabilities(
|
||||||
|
vim.lsp.protocol.make_client_capabilities()
|
||||||
|
)
|
||||||
|
require('lspconfig').rust_analyzer.setup{ capabilities = capabilities }
|
||||||
|
require('lspconfig').tflint.setup{ capabilities = capabilities }
|
||||||
|
require('lspconfig').terraformls.setup{ capabilities = capabilities }
|
||||||
|
require('lspconfig').pyright.setup{
|
||||||
|
cmd = { "poetry", "run", "pyright-langserver", "--stdio" },
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
if require('lspconfig/util').has_bins('diagnostic-languageserver') then
|
if require('lspconfig/util').has_bins('diagnostic-languageserver') then
|
||||||
require('lspconfig').diagnosticls.setup{
|
require('lspconfig').diagnosticls.setup{
|
||||||
cmd = { "diagnostic-languageserver", "--stdio" },
|
cmd = { "diagnostic-languageserver", "--stdio" },
|
||||||
filetypes = { "sh" },
|
filetypes = { "sh" },
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
init_options = {
|
init_options = {
|
||||||
filetypes = {
|
filetypes = { sh = "shellcheck" },
|
||||||
sh = "shellcheck",
|
|
||||||
},
|
|
||||||
linters = {
|
linters = {
|
||||||
shellcheck = {
|
shellcheck = {
|
||||||
sourceName = "shellcheck",
|
sourceName = "shellcheck",
|
||||||
@ -33,137 +163,288 @@ if require('lspconfig/util').has_bins('diagnostic-languageserver') then
|
|||||||
formatLines = 1,
|
formatLines = 1,
|
||||||
formatPattern = {
|
formatPattern = {
|
||||||
"^[^:]+:(\\d+):(\\d+):\\s+([^:]+):\\s+(.*)$",
|
"^[^:]+:(\\d+):(\\d+):\\s+([^:]+):\\s+(.*)$",
|
||||||
|
{ line = 1, column = 2, message = 4, security = 3 }
|
||||||
|
},
|
||||||
|
securities = { error = "error", warning = "warning", }
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Pretty highlights
|
||||||
|
use 'folke/lsp-colors.nvim'
|
||||||
|
|
||||||
|
use {
|
||||||
|
'folke/trouble.nvim',
|
||||||
|
requires = 'kyazdani42/nvim-web-devicons',
|
||||||
|
config = function()
|
||||||
|
require("trouble").setup { }
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- =======================================================================
|
||||||
|
-- Completion System
|
||||||
|
-- =======================================================================
|
||||||
|
|
||||||
|
-- Completion sources
|
||||||
|
use 'hrsh7th/cmp-nvim-lsp' --- Language server completion plugin
|
||||||
|
use 'hrsh7th/cmp-buffer' --- Generic text completion
|
||||||
|
use 'hrsh7th/cmp-path' --- Local file completion
|
||||||
|
use 'hrsh7th/cmp-cmdline' --- Command line completion
|
||||||
|
use 'hrsh7th/cmp-nvim-lua' --- Nvim lua api completion
|
||||||
|
use 'saadparwaiz1/cmp_luasnip' --- Luasnip completion
|
||||||
|
use 'lukas-reineke/cmp-rg' --- Ripgrep completion
|
||||||
|
|
||||||
|
-- Completion engine
|
||||||
|
use {
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
requires = { 'L3MON4D3/LuaSnip', },
|
||||||
|
config = function()
|
||||||
|
local cmp = require('cmp')
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||||
|
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||||
|
['<Esc>'] = function(fallback)
|
||||||
|
cmp.mapping({
|
||||||
|
i = cmp.mapping.abort(),
|
||||||
|
c = cmp.mapping.close(),
|
||||||
|
})
|
||||||
|
vim.cmd('stopinsert') --- Abort and leave insert mode
|
||||||
|
end,
|
||||||
|
-- ['<Tab>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 's' }),
|
||||||
|
-- ['<S-Tab>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 's' }),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Insert,
|
||||||
|
select = true,
|
||||||
|
}),
|
||||||
|
['<C-r>'] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = true,
|
||||||
|
}),
|
||||||
|
['<C-l>'] = cmp.mapping(function(fallback)
|
||||||
|
if require('luasnip').expand_or_jumpable() then
|
||||||
|
require('luasnip').expand_or_jump()
|
||||||
|
end
|
||||||
|
end, {"i", "s"})
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = 'nvim_lua' },
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'path' },
|
||||||
|
{ name = 'luasnip' },
|
||||||
|
{ name = 'buffer', keyword_length = 3, max_item_count = 10 },
|
||||||
{
|
{
|
||||||
line = 1,
|
name = 'rg', keyword_length = 6, max_item_count = 10,
|
||||||
column = 2,
|
option = { additional_arguments = "--ignore-case" }
|
||||||
message = 4,
|
|
||||||
security = 3
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
securities = {
|
|
||||||
error = "error",
|
|
||||||
warning = "warning",
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
experimental = {
|
||||||
|
native_menu = false, --- Use cmp menu instead of Vim menu
|
||||||
|
ghost_text = true, --- Show preview auto-completion
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use buffer source for `/`
|
||||||
|
cmp.setup.cmdline('/', {
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer', keyword_length = 5 }
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use cmdline & path source for ':'
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- =======================================================================
|
||||||
|
-- Syntax
|
||||||
|
-- =======================================================================
|
||||||
|
|
||||||
|
-- Syntax engine
|
||||||
|
use {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
run = ':TSUpdate',
|
||||||
|
config = function()
|
||||||
|
require('nvim-treesitter.configs').setup {
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
}
|
||||||
|
|
||||||
-- Auto-complete
|
-- Additional syntax sources
|
||||||
-- ====================
|
use 'bfontaine/Brewfile.vim' --- Brewfile syntax
|
||||||
|
use 'chr4/nginx.vim' --- Nginx syntax
|
||||||
|
use 'hashivim/vim-terraform' --- Terraform formatting
|
||||||
|
use 'towolf/vim-helm' --- Helm syntax
|
||||||
|
use 'rodjek/vim-puppet' --- Puppet syntax
|
||||||
|
use 'blankname/vim-fish' --- Better fish syntax
|
||||||
|
|
||||||
-- Auto-complete mapping
|
-- =======================================================================
|
||||||
local t = function(str)
|
-- Fuzzy Launcher
|
||||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
-- =======================================================================
|
||||||
end
|
|
||||||
|
|
||||||
local check_back_space = function()
|
use {
|
||||||
local col = vim.fn.col('.') - 1
|
'nvim-telescope/telescope.nvim',
|
||||||
if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
requires = { 'nvim-lua/plenary.nvim' },
|
||||||
return true
|
config = function()
|
||||||
else
|
-- Telescope: quit instantly with escape
|
||||||
return false
|
local actions = require("telescope.actions")
|
||||||
end
|
require("telescope").setup({
|
||||||
end
|
defaults = {
|
||||||
-- Use (s-)tab to:
|
mappings = {
|
||||||
--- move to prev/next item in completion menuone
|
i = {
|
||||||
--- jump to prev/next snippet's placeholder
|
["<esc>"] = actions.close,
|
||||||
_G.tab_complete = function()
|
["<C-h>"] = "which_key",
|
||||||
if vim.fn.pumvisible() == 1 then
|
},
|
||||||
return t "<C-n>"
|
},
|
||||||
elseif vim.fn.call("vsnip#available", {1}) == 1 then
|
},
|
||||||
return t "<Plug>(vsnip-expand-or-jump)"
|
pickers = {
|
||||||
elseif check_back_space() then
|
find_files = { theme = "ivy" },
|
||||||
return t "<Tab>"
|
oldfiles = { theme = "ivy" },
|
||||||
else
|
buffers = { theme = "dropdown" },
|
||||||
return vim.fn['compe#complete']()
|
},
|
||||||
end
|
extensions = {
|
||||||
end
|
fzy_native = {},
|
||||||
_G.s_tab_complete = function()
|
tmux = {},
|
||||||
if vim.fn.pumvisible() == 1 then
|
zoxide = {},
|
||||||
return t "<C-p>"
|
-- neoclip = {},
|
||||||
elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then
|
project = {
|
||||||
return t "<Plug>(vsnip-jump-prev)"
|
base_dirs = { '~/dev/work', },
|
||||||
else
|
},
|
||||||
return t "<S-Tab>"
|
},
|
||||||
end
|
})
|
||||||
end
|
end
|
||||||
|
}
|
||||||
|
|
||||||
-- Auto-complete keybinds
|
-- Faster sorting
|
||||||
vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
use 'nvim-telescope/telescope-fzy-native.nvim'
|
||||||
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
|
||||||
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
|
||||||
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
|
||||||
|
|
||||||
|
-- Jump around tmux sessions
|
||||||
|
use 'camgraff/telescope-tmux.nvim'
|
||||||
|
|
||||||
|
-- Jump directories
|
||||||
|
use {
|
||||||
|
'jvgrootveld/telescope-zoxide',
|
||||||
|
requires = {'nvim-lua/popup.nvim'},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Jump projects
|
||||||
|
use {
|
||||||
|
'nvim-telescope/telescope-project.nvim',
|
||||||
|
requires = {'nvim-telescope/telescope.nvim'},
|
||||||
|
config = function()
|
||||||
|
require('telescope').load_extension('project')
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Clipboard history
|
||||||
|
-- use {
|
||||||
|
-- "AckslD/nvim-neoclip.lua",
|
||||||
|
-- branch = 'main',
|
||||||
|
-- requires = {
|
||||||
|
-- {'tami5/sqlite.lua', module = 'sqlite'},
|
||||||
|
-- {'nvim-telescope/telescope.nvim'},
|
||||||
|
-- },
|
||||||
|
-- config = function()
|
||||||
|
-- require('neoclip').setup({
|
||||||
|
-- enable_persistant_history = true,
|
||||||
|
-- default_register = {'+', '"'},
|
||||||
|
-- keys = {
|
||||||
|
-- i = { paste = '<c-v>' },
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
|
-- require('telescope').load_extension('neoclip')
|
||||||
|
-- end
|
||||||
|
-- }
|
||||||
|
|
||||||
|
-- Project bookmarks
|
||||||
|
use {
|
||||||
|
'ThePrimeagen/harpoon',
|
||||||
|
requires = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'nvim-telescope/telescope.nvim'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- TLDR Lookup
|
||||||
|
use {
|
||||||
|
'mrjones2014/tldr.nvim',
|
||||||
|
requires = {'nvim-telescope/telescope.nvim'}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- =======================================================================
|
||||||
|
|
||||||
|
-- Install on initial bootstrap
|
||||||
|
if packer_bootstrap then
|
||||||
|
require('packer').sync()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- ===========================================================================
|
||||||
-- Settings
|
-- Settings
|
||||||
-- ========
|
-- ===========================================================================
|
||||||
|
|
||||||
-- Basic Settings
|
vim.o.termguicolors = true --- Set to truecolor
|
||||||
vim.o.termguicolors = true -- Set to truecolor
|
vim.o.hidden = true --- Don't unload buffers when leaving them
|
||||||
vim.cmd[[colorscheme gruvbox]] -- Installed with a plugin
|
vim.wo.number = true --- Show line numbers
|
||||||
vim.o.hidden = true -- Don't unload buffers when leaving them
|
vim.wo.relativenumber = true --- Relative numbers instead of absolute
|
||||||
vim.wo.number = true -- Show line numbers
|
vim.o.list = true --- Reveal whitespace with dashes
|
||||||
vim.wo.relativenumber = true -- Relative numbers instead of absolute
|
vim.o.expandtab = true --- Tabs into spaces
|
||||||
vim.o.list = true -- Reveal whitespace with dashes
|
vim.o.shiftwidth = 4 --- Amount to shift with > key
|
||||||
vim.o.expandtab = true -- Tabs into spaces
|
vim.o.softtabstop = 4 --- Amount to shift with <TAB> key
|
||||||
vim.o.shiftwidth = 4 -- Amount to shift with > key
|
vim.o.ignorecase = true --- Ignore case when searching
|
||||||
vim.o.softtabstop = 4 -- Amount to shift with <TAB> key
|
vim.o.smartcase = true --- Check case when using capitals in search
|
||||||
vim.o.ignorecase = true -- Ignore case when searching
|
vim.o.infercase = true --- Don't match cases when completing suggestions
|
||||||
vim.o.smartcase = true -- Check case when using capitals in search
|
vim.o.incsearch = true --- Search while typing
|
||||||
vim.o.infercase = true -- Don't match cases when completing suggestions
|
vim.o.visualbell = true --- No sounds
|
||||||
vim.o.incsearch = true -- Search while typing
|
vim.o.scrolljump = 1 --- Number of lines to scroll
|
||||||
vim.o.visualbell = true -- No sounds
|
vim.o.scrolloff = 3 --- Margin of lines to see while scrolling
|
||||||
vim.o.scrolljump = 1 -- Number of lines to scroll
|
vim.o.splitright = true --- Vertical splits on the right side
|
||||||
vim.o.scrolloff = 3 -- Margin of lines to see while scrolling
|
vim.o.splitbelow = true --- Horizontal splits on the bottom side
|
||||||
vim.o.splitright = true -- Vertical splits on the right side
|
vim.o.pastetoggle = "<F3>" --- Use F3 to enter raw paste mode
|
||||||
vim.o.splitbelow = true -- Horizontal splits on the bottom side
|
vim.o.clipboard = "unnamedplus" --- Uses system clipboard for yanking
|
||||||
vim.o.pastetoggle = "<F3>" -- Use F3 to enter raw paste mode
|
vim.o.updatetime = 300 --- Faster diagnostics
|
||||||
vim.o.clipboard = "unnamedplus" -- Uses system clipboard for yanking
|
vim.o.mouse = "nv" --- Mouse interaction / scrolling
|
||||||
vim.o.updatetime = 300 -- Faster diagnostics
|
|
||||||
vim.o.mouse = "nv" -- Mouse interaction / scrolling
|
|
||||||
|
|
||||||
-- Neovim features
|
-- Neovim features
|
||||||
vim.o.inccommand = "split" -- Live preview search and replace
|
vim.o.inccommand = "split" --- Live preview search and replace
|
||||||
vim.o.completeopt = "menuone,noselect" -- Required for nvim-compe completion
|
vim.o.completeopt = "menu,menuone,noselect" --- Required for nvim-cmp completion
|
||||||
|
-- Required until 0.6.0: do not source the default filetype.vim
|
||||||
|
vim.g.did_load_filetypes = 1
|
||||||
|
|
||||||
-- Remember last position when reopening file
|
-- Remember last position when reopening file
|
||||||
vim.api.nvim_exec([[
|
vim.api.nvim_exec([[
|
||||||
if has("autocmd")
|
|
||||||
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
||||||
endif
|
|
||||||
]], false)
|
]], false)
|
||||||
|
|
||||||
-- Better backup, swap and undo storage
|
-- Better backup, swap and undo storage
|
||||||
vim.o.backup = true -- Easier to recover and more secure
|
vim.o.backup = true --- Easier to recover and more secure
|
||||||
vim.bo.swapfile = false -- Instead of swaps, create backups
|
vim.bo.swapfile = false --- Instead of swaps, create backups
|
||||||
vim.bo.undofile = true -- Keeps undos after quit
|
vim.bo.undofile = true --- Keeps undos after quit
|
||||||
|
|
||||||
-- Create backup directories if they don't exist
|
-- Create backup directories if they don't exist
|
||||||
|
-- Should be fixed in 0.6 by https://github.com/neovim/neovim/pull/15433
|
||||||
|
vim.o.backupdir = vim.fn.stdpath('cache') .. '/backup'
|
||||||
vim.api.nvim_exec([[
|
vim.api.nvim_exec([[
|
||||||
set backupdir=~/.local/share/nvim/backup
|
|
||||||
set undodir=~/.local/share/nvim/undo
|
|
||||||
if !isdirectory(&backupdir)
|
if !isdirectory(&backupdir)
|
||||||
call mkdir(&backupdir, "p")
|
call mkdir(&backupdir, "p")
|
||||||
endif
|
endif
|
||||||
if !isdirectory(&undodir)
|
|
||||||
call mkdir(&undodir, "p")
|
|
||||||
endif
|
|
||||||
]], false)
|
|
||||||
|
|
||||||
-- Keep selection when tabbing
|
|
||||||
vim.api.nvim_set_keymap("v", "<", "<gv", {noremap=true})
|
|
||||||
vim.api.nvim_set_keymap("v", ">", ">gv", {noremap=true})
|
|
||||||
|
|
||||||
-- Force filetype patterns that Vim doesn't know about
|
|
||||||
vim.api.nvim_exec([[
|
|
||||||
au BufRead,BufNewFile *.Brewfile setfiletype brewfile
|
|
||||||
au BufRead,BufNewFile tmux.conf* setfiletype tmux
|
|
||||||
au BufRead,BufNewFile *ignore.*link setfiletype gitignore
|
|
||||||
au BufRead,BufNewFile gitconfig.*link setfiletype gitconfig
|
|
||||||
au BufRead,BufNewFile *.toml.*link setfiletype toml
|
|
||||||
au BufRead,BufNewFile *.muttrc setfiletype muttrc
|
|
||||||
au BufRead,BufNewFile .env* set ft=text | set syntax=sh
|
|
||||||
]], false)
|
]], false)
|
||||||
|
|
||||||
-- LaTeX options
|
-- LaTeX options
|
||||||
@ -177,14 +458,6 @@ vim.api.nvim_exec([[
|
|||||||
au TextYankPost * silent! lua vim.highlight.on_yank { timeout = 250 }
|
au TextYankPost * silent! lua vim.highlight.on_yank { timeout = 250 }
|
||||||
]], false)
|
]], false)
|
||||||
|
|
||||||
-- Rust stuff
|
|
||||||
-- vim.api.nvim_exec([[
|
|
||||||
-- au BufWritePost *.rs silent! execute "%! rustfmt"
|
|
||||||
-- ]], false)
|
|
||||||
|
|
||||||
-- Auto-pairs
|
|
||||||
vim.g.AutoPairsFlyMode = 0
|
|
||||||
|
|
||||||
-- Netrw
|
-- Netrw
|
||||||
vim.g.netrw_liststyle = 3 -- Change style to 'tree' view
|
vim.g.netrw_liststyle = 3 -- Change style to 'tree' view
|
||||||
vim.g.netrw_banner = 0 -- Remove useless banner
|
vim.g.netrw_banner = 0 -- Remove useless banner
|
||||||
@ -192,7 +465,7 @@ vim.g.netrw_winsize = 15 -- Explore window takes % of page
|
|||||||
vim.g.netrw_browse_split = 4 -- Open in previous window
|
vim.g.netrw_browse_split = 4 -- Open in previous window
|
||||||
vim.g.netrw_altv = 1 -- Always split left
|
vim.g.netrw_altv = 1 -- Always split left
|
||||||
|
|
||||||
-- Polyglot
|
-- Formatting
|
||||||
vim.g.terraform_fmt_on_save = 1 -- Formats with terraform plugin
|
vim.g.terraform_fmt_on_save = 1 -- Formats with terraform plugin
|
||||||
vim.g.rustfmt_autosave = 1 -- Formats with rust plugin
|
vim.g.rustfmt_autosave = 1 -- Formats with rust plugin
|
||||||
|
|
||||||
@ -224,62 +497,184 @@ vim.api.nvim_exec([[
|
|||||||
command! AddTag call fzf#run({'source': 'rg "#[A-Za-z/]+[ |\$]" -o --no-filename --no-line-number | sort | uniq', 'sink': function('PInsert')})
|
command! AddTag call fzf#run({'source': 'rg "#[A-Za-z/]+[ |\$]" -o --no-filename --no-line-number | sort | uniq', 'sink': function('PInsert')})
|
||||||
]], false)
|
]], false)
|
||||||
|
|
||||||
-- Status bar
|
-- ===========================================================================
|
||||||
require('lualine').setup({
|
-- Custom Functions
|
||||||
options = { theme = 'gruvbox' }
|
-- ===========================================================================
|
||||||
})
|
|
||||||
|
grep_notes = function()
|
||||||
|
local opts = {
|
||||||
|
prompt_title = "Search Notes",
|
||||||
|
cwd = '$NOTES_PATH',
|
||||||
|
}
|
||||||
|
require('telescope.builtin').live_grep(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
find_notes = function()
|
||||||
|
local opts = {
|
||||||
|
prompt_title = "Find Notes",
|
||||||
|
cwd = '$NOTES_PATH',
|
||||||
|
}
|
||||||
|
require('telescope.builtin').find_files(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
find_downloads = function()
|
||||||
|
local opts = {
|
||||||
|
prompt_title = "Find Downloads",
|
||||||
|
cwd = '~/Downloads',
|
||||||
|
}
|
||||||
|
require('telescope.builtin').file_browser(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
choose_project = function()
|
||||||
|
local opts = require("telescope.themes").get_ivy {
|
||||||
|
layout_config = {
|
||||||
|
bottom_pane = {
|
||||||
|
height = 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
require('telescope').extensions.project.project(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
clipboard_history = function()
|
||||||
|
local opts = require("telescope.themes").get_cursor {
|
||||||
|
layout_config = {
|
||||||
|
cursor = {
|
||||||
|
width = 150,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
require('telescope').extensions.neoclip.neoclip(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
command_history = function()
|
||||||
|
local opts = require("telescope.themes").get_ivy {
|
||||||
|
layout_config = {
|
||||||
|
bottom_pane = {
|
||||||
|
height = 15,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
require('telescope.builtin').command_history(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- ===========================================================================
|
||||||
|
-- Key Mapping
|
||||||
|
-- ===========================================================================
|
||||||
|
|
||||||
|
-- Function to cut down config boilerplate
|
||||||
|
local key = function(mode, key_sequence, action, params)
|
||||||
|
params = params or {}
|
||||||
|
params["noremap"] = true
|
||||||
|
vim.api.nvim_set_keymap(mode, key_sequence, action, params)
|
||||||
|
end
|
||||||
|
|
||||||
-- Remap space as leader key
|
-- Remap space as leader key
|
||||||
vim.api.nvim_set_keymap("", "<Space>", "<Nop>", {noremap=true, silent=true})
|
key("", "<Space>", "<Nop>", {silent=true})
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = " "
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
-- Unset search pattern register
|
-- Keep selection when changing indentation
|
||||||
vim.api.nvim_set_keymap("n", "<CR>", ":noh<CR><CR>", {noremap=true, silent=true})
|
key("v", "<", "<gv")
|
||||||
|
key("v", ">", ">gv")
|
||||||
|
|
||||||
|
-- Clear search register
|
||||||
|
key("n", "<CR>", ":noh<CR><CR>", {silent=true})
|
||||||
|
|
||||||
-- Shuffle lines around
|
-- Shuffle lines around
|
||||||
vim.api.nvim_set_keymap("n", "<A-j>", ":m .+1<CR>==", {noremap=true})
|
key("n", "<A-j>", ":m .+1<CR>==")
|
||||||
vim.api.nvim_set_keymap("n", "<A-k>", ":m .-2<CR>==", {noremap=true})
|
key("n", "<A-k>", ":m .-2<CR>==")
|
||||||
vim.api.nvim_set_keymap("i", "<A-j>", "<Esc>:m .+1<CR>==gi", {noremap=true})
|
key("i", "<A-j>", "<Esc>:m .+1<CR>==gi")
|
||||||
vim.api.nvim_set_keymap("i", "<A-k>", "<Esc>:m .-2<CR>==gi", {noremap=true})
|
key("i", "<A-k>", "<Esc>:m .-2<CR>==gi")
|
||||||
vim.api.nvim_set_keymap("v", "<A-j>", ":m '>+1<CR>gv=gv", {noremap=true})
|
key("v", "<A-j>", ":m '>+1<CR>gv=gv")
|
||||||
vim.api.nvim_set_keymap("v", "<A-k>", ":m '<-2<CR>gv=gv", {noremap=true})
|
key("v", "<A-k>", ":m '<-2<CR>gv=gv")
|
||||||
|
|
||||||
-- Fzf (fuzzy finder)
|
-- Telescope (fuzzy finder)
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>/", ":Rg<CR>", {noremap=true})
|
key("n", "<Leader>k", ":Telescope keymaps<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>ff", ":Files<CR>", {noremap=true})
|
key("n", "<Leader>/", ":Telescope live_grep<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fr", ":History<CR>", {noremap=true})
|
key("n", "<Leader>ff", ":Telescope find_files<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>b", ":Buffers<CR>", {noremap=true})
|
key("n", "<Leader>fp", ":Telescope git_files<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>s", ":BLines<CR>", {noremap=true})
|
key("n", "<Leader>fN", "<Cmd>lua find_notes()<CR>")
|
||||||
|
key("n", "<Leader>N", "<Cmd>lua grep_notes()<CR>")
|
||||||
|
key("n", "<Leader>fD", "<Cmd>lua find_downloads()<CR>")
|
||||||
|
key("n", "<Leader>fa", ":Telescope file_browser<CR>")
|
||||||
|
key("n", "<Leader>fw", ":Telescope grep_string<CR>")
|
||||||
|
key("n", "<Leader>wt", ":Telescope tmux sessions<CR>")
|
||||||
|
key("n", "<Leader>ww", ":Telescope tmux windows<CR>")
|
||||||
|
key("n", "<Leader>w/", ":Telescope tmux pane_contents<CR>")
|
||||||
|
key("n", "<Leader>fz", ":Telescope zoxide list<CR>")
|
||||||
|
key("n", "<Leader>b", ":Telescope buffers<CR>")
|
||||||
|
key("n", "<Leader>hh", ":Telescope help_tags<CR>")
|
||||||
|
key("n", "<Leader>fr", ":Telescope oldfiles<CR>")
|
||||||
|
key("n", "<Leader>cc", ":Telescope commands<CR>")
|
||||||
|
key("n", "<Leader>cr", "<Cmd>lua command_history()<CR>")
|
||||||
|
key("n", "<Leader>y", "<Cmd>lua clipboard_history()<CR>")
|
||||||
|
key("i", "<c-y>", "<Cmd>lua clipboard_history()<CR>")
|
||||||
|
key("n", "<Leader>s", ":Telescope current_buffer_fuzzy_find<CR>")
|
||||||
|
key("n", "<Leader>gc", ":Telescope git_commits<CR>")
|
||||||
|
key("n", "<Leader>gf", ":Telescope git_bcommits<CR>")
|
||||||
|
key("n", "<Leader>gb", ":Telescope git_branches<CR>")
|
||||||
|
key("n", "<Leader>gs", ":Telescope git_status<CR>")
|
||||||
|
key("n", "<C-p>", "<Cmd>lua choose_project()<CR>")
|
||||||
|
|
||||||
|
-- Harpoon
|
||||||
|
key("n", "<Leader>m", "<Cmd>lua require('harpoon.mark').add_file()<CR><Esc>")
|
||||||
|
key("n", "<Leader>`", "<Cmd>lua require('harpoon.ui').toggle_quick_menu()<CR><Esc>")
|
||||||
|
key("n", "<Leader>1", "<Cmd>lua require('harpoon.ui').nav_file(1)<CR><Esc>")
|
||||||
|
key("n", "<Leader>2", "<Cmd>lua require('harpoon.ui').nav_file(2)<CR><Esc>")
|
||||||
|
key("n", "<Leader>3", "<Cmd>lua require('harpoon.ui').nav_file(3)<CR><Esc>")
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
key("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", {silent=true})
|
||||||
|
key("n", "gi", "<Cmd>lua vim.lsp.buf.implementation()<CR>", {silent=true})
|
||||||
|
key("n", "gh", "<Cmd>lua vim.lsp.buf.hover()<CR>", {silent=true})
|
||||||
|
key("n", "]e", "<Cmd>lua vim.lsp.diagnostic.goto_next()<CR>", {silent=true})
|
||||||
|
key("n", "[e", "<Cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", {silent=true})
|
||||||
|
key("n", "<Leader>e", "<Cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", {silent=true})
|
||||||
|
|
||||||
-- File commands
|
-- File commands
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>q", ":quit<CR>", {noremap=true})
|
key("n", "<Leader>q", ":quit<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>Q", ":quitall<CR>", {noremap=true})
|
key("n", "<Leader>Q", ":quitall<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fs", ":write<CR>", {noremap=true})
|
key("n", "<Leader>fs", ":write<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fe", ":!chmod 755 %<CR><CR>", {noremap=true})
|
key("n", "<Leader>fd", ":lcd %:p:h<CR>", {silent=true})
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fn", ":!chmod 644 %<CR><CR>", {noremap=true})
|
key("n", "<Leader>fu", ":lcd ..<CR>", {silent=true})
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fd", ":lcd %:p:h<CR>", {silent=true, noremap=true})
|
key("n", "<Leader><Tab>", ":b#<CR>", {silent=true})
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fu", ":lcd ..<CR>", {silent=true, noremap=true})
|
key("n", "<Leader>gr", ":!gh repo view -w<CR><CR>", {silent=true})
|
||||||
vim.api.nvim_set_keymap("n", "<Leader><Tab>", ":b#<CR>", {silent=true, noremap=true})
|
key("n", "<Leader>tt",
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>gr", ":!gh repo view -w<CR><CR>", {silent=true, noremap=true})
|
[[<Cmd>exe 'edit $NOTES_PATH/journal/'.strftime("%Y-%m-%d_%a").'.md'<CR>]]
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>tt", [[<Cmd>exe 'edit ~/notes/journal/'.strftime("%Y-%m-%d_%a").'.md'<CR>]], {noremap=true})
|
)
|
||||||
|
key("n", "<Leader>jj", ":!journal<CR>:e<CR>")
|
||||||
|
|
||||||
-- Window commands
|
-- Window commands
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>wv", ":vsplit<CR>", {noremap=true})
|
key("n", "<Leader>wv", ":vsplit<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>wh", ":split<CR>", {noremap=true})
|
key("n", "<Leader>wh", ":split<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>wm", ":only<CR>", {noremap=true})
|
key("n", "<Leader>wm", ":only<CR>")
|
||||||
|
|
||||||
-- Tabularize
|
-- Tabularize
|
||||||
vim.api.nvim_set_keymap("", "<Leader>ta", ":Tabularize /", {noremap=true})
|
key("", "<Leader>ta", ":Tabularize /")
|
||||||
vim.api.nvim_set_keymap("", "<Leader>t#", ":Tabularize /#<CR>", {noremap=true})
|
key("", "<Leader>t#", ":Tabularize /#<CR>")
|
||||||
vim.api.nvim_set_keymap("", "<Leader>t\"", ":Tabularize /\"<CR>", {noremap=true})
|
key("", "<Leader>tl", ":Tabularize /---<CR>")
|
||||||
|
|
||||||
-- Vimrc
|
-- Vimrc editing
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fv", ":edit $MYVIMRC<CR>", {noremap=true})
|
key("n", "<Leader>fv", ":edit $MYVIMRC<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>rr", ":luafile $MYVIMRC<CR>", {noremap=true})
|
key("n", "<Leader>rr", ":luafile $MYVIMRC<CR>")
|
||||||
|
key("n", "<Leader>rp", ":luafile $MYVIMRC<CR>:PackerInstall<CR>:")
|
||||||
|
key("n", "<Leader>rc", ":luafile $MYVIMRC<CR>:PackerCompile<CR>")
|
||||||
|
|
||||||
|
-- Keep cursor in place
|
||||||
|
key("n", 'n', "nzz")
|
||||||
|
key("n", 'N', "Nzz")
|
||||||
|
key("n", 'J', "mzJ`z") --- Mark and jump back to it
|
||||||
|
|
||||||
|
-- Add undo breakpoints
|
||||||
|
key("i", ',', ",<C-g>u")
|
||||||
|
key("i", '.', ".<C-g>u")
|
||||||
|
key("i", '!', "!<C-g>u")
|
||||||
|
key("i", '?', "?<C-g>u")
|
||||||
|
|
||||||
-- Other
|
-- Other
|
||||||
vim.api.nvim_set_keymap("n", "<Leader><Space>", ":HopWord<CR>", {noremap=true})
|
key("t", "<A-CR>", "<C-\\><C-n>") --- Exit terminal mode
|
||||||
vim.api.nvim_set_keymap("t", "<A-CR>", "<C-\\><C-n>", {noremap=true}) -- Exit terminal mode
|
key("n", "<A-CR>", ":noh<CR>", {silent=true}) --- Clear search in VimWiki
|
||||||
vim.api.nvim_set_keymap("n", "<A-CR>", ":noh<CR>", {noremap=true, silent=true})
|
key("n", "Y", "y$") --- Copy to end of line
|
||||||
vim.api.nvim_set_keymap('n', 'Y', 'y$', { noremap = true})
|
key("v", "<C-r>", "y<Esc>:%s/<C-r>+//gc<left><left><left>") --- Substitute selected
|
||||||
|
key("v", "D", "y'>gp") --- Duplicate selected
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
default:
|
default:
|
||||||
@just --list --list-heading $'Update NixOS config:\n'
|
@just --list --list-heading $'Update NixOS config:\n'
|
||||||
|
|
||||||
|
channel:
|
||||||
|
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixos-unstable
|
||||||
|
nix-channel --update
|
||||||
|
|
||||||
# Update the system
|
# Update the system
|
||||||
system:
|
system:
|
||||||
nixos-rebuild switch -I nixos-config=./configuration.nix
|
nixos-rebuild switch -I nixos-config=./configuration.nix
|
||||||
|
Loading…
Reference in New Issue
Block a user