save
This commit is contained in:
1
nvim/.config/nvim/ftplugin/h.lua
Normal file
1
nvim/.config/nvim/ftplugin/h.lua
Normal file
@@ -0,0 +1 @@
|
||||
vim.bo.filetype = "c"
|
||||
5
nvim/.config/nvim/ftplugin/noext.lua
Normal file
5
nvim/.config/nvim/ftplugin/noext.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
vim.opt.spell = true
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.expandtab = true
|
||||
vim.opt_local.textwidth = 80
|
||||
@@ -17,21 +17,35 @@ vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
for _, k in ipairs({ "h", "j", "k", "l" }) do
|
||||
vim.keymap.set({ "n", "i", "v" }, "<C-" .. k .. ">", "<C-w><C-" .. k .. ">")
|
||||
end
|
||||
vim.keymap.set("n", "<leader>en", ":edit $HOME/.config/nvim/init.lua<CR>")
|
||||
vim.keymap.set("n", "<leader>ez", ":edit $HOME/.zshrc<CR>")
|
||||
|
||||
vim.keymap.set("n", "<leader>en", ":edit $XDG_CONFIG_HOME/nvim/init.lua<CR>")
|
||||
vim.keymap.set("n", "<leader>ez", ":edit $ZSHRC<CR>")
|
||||
vim.keymap.set("n", "<leader>ed", ":edit $DO<CR>")
|
||||
|
||||
vim.keymap.set("n", "<leader><leader>", function()
|
||||
local alt = vim.fn.expand("%:r") .. (vim.bo.filetype == "c" and ".h" or ".c")
|
||||
vim.cmd("edit " .. alt)
|
||||
end)
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
local ext = vim.fn.expand("%:e")
|
||||
local firstline = vim.fn.getline(1)
|
||||
if ext == "" and not firstline:match("^#!") then
|
||||
vim.bo.filetype = "noext"
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.pack.add {
|
||||
{ src = "https://github.com/echasnovski/mini.pick" },
|
||||
{ src = "https://github.com/mason-org/mason.nvim" },
|
||||
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
||||
}
|
||||
|
||||
require("mini.pick").setup()
|
||||
require("mason").setup()
|
||||
|
||||
vim.lsp.enable { "lua_ls", "clangd" }
|
||||
vim.lsp.enable { "lua_ls", "clangd", "beautysh" }
|
||||
vim.diagnostic.config { virtual_text = true, underline = true, signs = false }
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
add_newline = false
|
||||
|
||||
format = "$git_status$directory"
|
||||
format = "$git_status$custom$directory"
|
||||
|
||||
[custom.todo]
|
||||
command = "awk '/^TODAY/{getline; if (NF) {print; exit}}' ~/do"
|
||||
when = "grep -A1 '^TODAY' ~/do | tail -n1 | grep -q '.'"
|
||||
style = "bold white"
|
||||
format = "\"[$output]($style)\" "
|
||||
|
||||
13
zsh/.zshrc
13
zsh/.zshrc
@@ -6,8 +6,11 @@ export VISUAL=nvim
|
||||
export TERM="xterm-256color"
|
||||
export COLORTERM=truecolor
|
||||
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export PATH=$HOME/.local/bin:$PATH
|
||||
|
||||
export DO="$HOME/do"
|
||||
|
||||
alias ls='ls --color=auto'
|
||||
alias ll='ls -lah'
|
||||
alias gg='lazygit'
|
||||
@@ -18,6 +21,16 @@ take() {
|
||||
cd $1
|
||||
}
|
||||
|
||||
function show_todo_in_git_repo() {
|
||||
if git rev-parse --is-inside-work-tree &>/dev/null; then
|
||||
[ -f TODO ] && clear && cat TODO
|
||||
fi
|
||||
}
|
||||
|
||||
autoload -Uz add-zsh-hook
|
||||
add-zsh-hook chpwd show_todo_in_git_repo
|
||||
show_todo_in_git_repo
|
||||
|
||||
[ -f "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh" ] && source "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh"
|
||||
plug "zsh-users/zsh-autosuggestions"
|
||||
plug "zap-zsh/supercharge"
|
||||
|
||||
Reference in New Issue
Block a user