feat: kitty instead of alacritty -> pictures
This commit is contained in:
parent
fb16eec496
commit
f3a0d0d35f
11 changed files with 278 additions and 64 deletions
119
.zshrc
119
.zshrc
|
|
@ -37,3 +37,122 @@ alias gh='git push origin'
|
|||
alias gl='git pull origin'
|
||||
alias gm='git commit -m'
|
||||
|
||||
|
||||
# zoxide
|
||||
## =============================================================================
|
||||
#
|
||||
# Utility functions for zoxide.
|
||||
#
|
||||
|
||||
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
|
||||
function __zoxide_pwd() {
|
||||
\builtin pwd -L
|
||||
}
|
||||
|
||||
# cd + custom logic based on the value of _ZO_ECHO.
|
||||
function __zoxide_cd() {
|
||||
# shellcheck disable=SC2164
|
||||
\builtin cd -- "$@" >/dev/null
|
||||
}
|
||||
|
||||
# =============================================================================
|
||||
#
|
||||
# Hook configuration for zoxide.
|
||||
#
|
||||
|
||||
# Hook to add new entries to the database.
|
||||
function __zoxide_hook() {
|
||||
# shellcheck disable=SC2312
|
||||
\command zoxide add -- "$(__zoxide_pwd)"
|
||||
}
|
||||
|
||||
# Initialize hook.
|
||||
# shellcheck disable=SC2154
|
||||
if [[ ${precmd_functions[(Ie)__zoxide_hook]:-} -eq 0 ]] && [[ ${chpwd_functions[(Ie)__zoxide_hook]:-} -eq 0 ]]; then
|
||||
chpwd_functions+=(__zoxide_hook)
|
||||
fi
|
||||
|
||||
# =============================================================================
|
||||
#
|
||||
# When using zoxide with --no-cmd, alias these internal functions as desired.
|
||||
#
|
||||
|
||||
__zoxide_z_prefix='z#'
|
||||
|
||||
# Jump to a directory using only keywords.
|
||||
function __zoxide_z() {
|
||||
# shellcheck disable=SC2199
|
||||
if [[ "$#" -eq 0 ]]; then
|
||||
__zoxide_cd ~
|
||||
elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]$ ]]; }; then
|
||||
__zoxide_cd "$1"
|
||||
elif [[ "$@[-1]" == "${__zoxide_z_prefix}"* ]]; then
|
||||
# shellcheck disable=SC2124
|
||||
\builtin local result="${@[-1]}"
|
||||
__zoxide_cd "${result:${#__zoxide_z_prefix}}"
|
||||
else
|
||||
\builtin local result
|
||||
# shellcheck disable=SC2312
|
||||
result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -- "$@")" &&
|
||||
__zoxide_cd "${result}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Jump to a directory using interactive search.
|
||||
function __zoxide_zi() {
|
||||
\builtin local result
|
||||
result="$(\command zoxide query -i -- "$@")" && __zoxide_cd "${result}"
|
||||
}
|
||||
|
||||
# =============================================================================
|
||||
#
|
||||
# Commands for zoxide. Disable these using --no-cmd.
|
||||
#
|
||||
|
||||
\builtin unalias z &>/dev/null || \builtin true
|
||||
function z() {
|
||||
__zoxide_z "$@"
|
||||
}
|
||||
|
||||
\builtin unalias zi &>/dev/null || \builtin true
|
||||
function zi() {
|
||||
__zoxide_zi "$@"
|
||||
}
|
||||
|
||||
if [[ -o zle ]]; then
|
||||
function __zoxide_z_complete() {
|
||||
# Only show completions when the cursor is at the end of the line.
|
||||
# shellcheck disable=SC2154
|
||||
[[ "${#words[@]}" -eq "${CURRENT}" ]] || return
|
||||
|
||||
if [[ "${#words[@]}" -eq 2 ]]; then
|
||||
_files -/
|
||||
elif [[ "${words[-1]}" == '' ]]; then
|
||||
\builtin local result
|
||||
# shellcheck disable=SC2086,SC2312
|
||||
if result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -i -- ${words[2,-1]})"; then
|
||||
__zoxide_result="${result}"
|
||||
else
|
||||
__zoxide_result=''
|
||||
fi
|
||||
\builtin printf '\e[5n'
|
||||
fi
|
||||
}
|
||||
|
||||
function __zoxide_z_complete_helper() {
|
||||
\builtin local result="${__zoxide_z_prefix}${__zoxide_result}"
|
||||
# shellcheck disable=SC2296
|
||||
[[ -n "${__zoxide_result}" ]] && LBUFFER="${LBUFFER}${(q-)result}"
|
||||
\builtin zle reset-prompt
|
||||
}
|
||||
|
||||
\builtin zle -N __zoxide_z_complete_helper
|
||||
\builtin bindkey "\e[0n" __zoxide_z_complete_helper
|
||||
if [[ "${+functions[compdef]}" -ne 0 ]]; then
|
||||
\compdef -d z
|
||||
\compdef -d zi
|
||||
\compdef __zoxide_z_complete z
|
||||
fi
|
||||
fi
|
||||
|
||||
# =============================================================================
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ bind=SUPER,S,exec,grim -g "$(slurp)" - | wl-copy
|
|||
bind=SUPERSHIFTALT,S,exec,grim -g "$(slurp)" $HOME/gits/ost-3semester/Screenshots/$(date +'%Y-%m-%d:%I:%M:%S.png')
|
||||
bind=SUPERSHIFT,S,exec,grim -g "$(slurp)" - | swappy -f -
|
||||
bind=SUPER,F,exec,firefox
|
||||
bind=SUPER,T,exec,alacritty
|
||||
bind=SUPER,T,exec,kitty
|
||||
bind=SUPER,Q,killactive,
|
||||
bind=SUPER,M,exit,
|
||||
bind=SUPER,E,exec,nautilus --new-window
|
||||
|
|
|
|||
53
kitty/kitty.conf
Normal file
53
kitty/kitty.conf
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
enable_audio_bell no
|
||||
window_alert_on_bell no
|
||||
background_opacity 0.7
|
||||
cursor_blink_interval 0
|
||||
|
||||
background #1d1f21
|
||||
foreground #c5c8c6
|
||||
|
||||
selection_background #b2ceee
|
||||
selection_foreground #080808
|
||||
|
||||
selection_background #33467c
|
||||
selection_foreground #c0caf5
|
||||
url_color #73daca
|
||||
cursor #c0caf5
|
||||
cursor_text_color #1a1b26
|
||||
|
||||
# Tabs
|
||||
active_tab_background #7aa2f7
|
||||
active_tab_foreground #16161e
|
||||
inactive_tab_background #292e42
|
||||
inactive_tab_foreground #545c7e
|
||||
#tab_bar_background #15161e
|
||||
|
||||
# Windows
|
||||
active_border_color #7aa2f7
|
||||
inactive_border_color #292e42
|
||||
|
||||
# normal
|
||||
color0 #15161e
|
||||
color1 #c94448
|
||||
color2 #9ece6a
|
||||
color3 #e0af68
|
||||
color4 #7aa2f7
|
||||
color5 #bb9af7
|
||||
color6 #7dcfff
|
||||
color7 #a9b1d6
|
||||
|
||||
# bright
|
||||
color8 #414868
|
||||
color9 #f2201f
|
||||
color10 #9ece6a
|
||||
color11 #e0af68
|
||||
color12 #7aa2f7
|
||||
color13 #bb9af7
|
||||
color14 #7dcfff
|
||||
color15 #c0caf5
|
||||
|
||||
# extended colors
|
||||
color16 #ff9e64
|
||||
color17 #db4b4b
|
||||
|
||||
shell zsh
|
||||
|
|
@ -9,18 +9,17 @@ require("settings.pairs")
|
|||
require("settings.indentline")
|
||||
require("settings.project")
|
||||
require("settings.dashboard")
|
||||
require("settings.null-ls")
|
||||
require("settings.rainbow")
|
||||
require("settings.dap")
|
||||
require("settings.autocommands")
|
||||
require("settings.telescope")
|
||||
require("settings.keymaps")
|
||||
require("settings.barbar")
|
||||
|
||||
-- simple plugins that don't make sense to put in a seperate file, would clutter too much
|
||||
require("gitsigns").setup()
|
||||
require("feline").setup()
|
||||
require("telescope").setup({})
|
||||
require("telescope").load_extension("fzy_native")
|
||||
require("impatient").enable_profile()
|
||||
require("nightfox")
|
||||
require('Comment').setup()
|
||||
require("toggleterm").setup()
|
||||
|
|
|
|||
|
|
@ -14,10 +14,11 @@ dashboard.section.header.val = {
|
|||
}
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("f", " Find file", ":Telescope find_files <CR>"),
|
||||
dashboard.button("b", " Open File Browser", ":Telescope file_browser<CR>"),
|
||||
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
||||
dashboard.button("p", " Find project", ":Telescope project <CR>"),
|
||||
dashboard.button("r", " Recently used files", ":Telescope oldfiles <CR>"),
|
||||
dashboard.button("t", " Find text", ":Telescope live_grep <CR>"),
|
||||
dashboard.button("t", " Zoxide", ":Telescope zoxide list <CR>"),
|
||||
dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua <CR>"),
|
||||
dashboard.button("q", " Quit Neovim", ":qa<CR>"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,6 @@ local opts = { noremap = true, silent = true }
|
|||
local term_opts = { silent = true }
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
|
||||
-- space leader
|
||||
vim.g.mapleader = " "
|
||||
keymap("n", "<Space>", "<Nop>", { silent = true, noremap = false })
|
||||
|
||||
-- debug
|
||||
keymap("n", "<F5>", ':lua require("dap").toggle_breakpoint()<CR>', opts)
|
||||
keymap("n", "<F6>", ':lua require("dap").step_over()<CR>', opts)
|
||||
|
|
@ -15,8 +11,8 @@ keymap("n", "<F9>", ':lua require("dap").continue()<CR>', opts)
|
|||
keymap("n", "<F10>", ':lua require("dap").close()<CR> :lua require("dapui").toggle()<CR>', opts)
|
||||
|
||||
-- file tree
|
||||
keymap("n", "t", ':lua require("nvim-tree").toggle()<CR>', opts)
|
||||
keymap("n", "f", ':lua require("nvim-tree").focus()<CR>', opts)
|
||||
keymap("n", "t", ":ToggleTerm<CR>", opts)
|
||||
keymap("n", "n", ':lua require("nvim-tree").toggle()<CR>', opts)
|
||||
|
||||
-- tab switching
|
||||
keymap("n", "<F1>", ":BufferPrev<CR>", opts)
|
||||
|
|
@ -24,14 +20,22 @@ keymap("n", "<F2>", ":BufferNext<CR>", opts)
|
|||
|
||||
-- formatting
|
||||
keymap("n", "<F4>", ":lua vim.lsp.buf.format { async = true }<CR>", opts)
|
||||
keymap("n", "<leader>q", ":Telescope lsp_definitions<CR>", opts)
|
||||
keymap("n", "<leader>w", ":Telescope lsp_references<CR>", opts)
|
||||
keymap("n", "<leader>e", ":Telescope lsp_type_definitions<CR>", opts)
|
||||
keymap("n", "<leader>a", ":lua vim.lsp.buf.code_action()<CR>", opts)
|
||||
keymap("n", "<leader>s", ":lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
|
||||
-- telescope
|
||||
keymap("n", "fb", ":Telescope file_browser<CR>", {})
|
||||
keymap("n", "fc", ":Cheatsheet<CR>", {})
|
||||
keymap("n", "ff", ":lua require('telescope.builtin').find_files()<CR>", {})
|
||||
keymap("n", "fg", ":lua require('telescope.builtin').live_grep()<CR>", {})
|
||||
keymap("n", "fb", ":lua require('telescope.builtin').buffers()<CR>", {})
|
||||
keymap("n", "fh", ":lua require('telescope.builtin').help_tags()<CR>", {})
|
||||
keymap("n", "fp", ":lua require'telescope'.extensions.project.project{}<CR>", { noremap = true, silent = true })
|
||||
|
||||
vim.keymap.set("n", "<leader>z", ":lua require('telescope').extensions.zoxide.list{}<CR>")
|
||||
|
||||
-- trouble
|
||||
keymap("n", "<C-f>", "<cmd>TroubleToggle<CR>", term_opts)
|
||||
require("trouble").setup({
|
||||
|
|
@ -41,15 +45,3 @@ require("trouble").setup({
|
|||
},
|
||||
})
|
||||
|
||||
-- LSP
|
||||
local on_attach = function(client, bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
local opts = { noremap = true, silent = true, buffer = bufnr }
|
||||
keymap("n", "<leader>h", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
keymap("n", "<leader>j", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
keymap("n", "<leader>k", "<Cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
keymap("n", "<leader>l", "<Cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
keymap("n", "<leader>;", "<Cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
||||
keymap("n", "<leader>u", "<Cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
keymap("n", "<leader>g", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -18,10 +18,8 @@ require("mason-lspconfig").setup({
|
|||
"cssls", -- css
|
||||
"html", -- html
|
||||
"clangd", -- cpp / c
|
||||
"tsserver", -- javascript / typescript
|
||||
"sumneko_lua", -- lua
|
||||
"pyright", -- python
|
||||
"rust_analyzer", -- rust
|
||||
"cmake", -- cmake
|
||||
"bashls", -- shell
|
||||
"ansiblels", -- ansible
|
||||
|
|
@ -32,12 +30,50 @@ require("mason-lspconfig").setup({
|
|||
})
|
||||
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
-- LSP
|
||||
local on_attach = function(client, bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
local optslsp = { noremap = false, silent = true, buffer = bufnr }
|
||||
end
|
||||
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
function(server_name) -- default handler (optional)
|
||||
require("lspconfig")[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
-- Disable virtual_text
|
||||
virtual_text = true,
|
||||
}
|
||||
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
require("lsp-format").setup {}
|
||||
|
||||
local on_attach = function(client)
|
||||
require("lsp-format").on_attach(client)
|
||||
end
|
||||
|
||||
-- special server setups
|
||||
require("clangd_extensions").setup()
|
||||
require("rust-tools").setup({
|
||||
server = {
|
||||
standalone = false,
|
||||
root_dir = require('lspconfig').util.find_git_ancestor,
|
||||
loadOutputiDirs = false,
|
||||
}
|
||||
})
|
||||
require("typescript").setup({
|
||||
disable_commands = false, -- prevent the plugin from creating Vim commands
|
||||
debug = false, -- enable debug logging for commands
|
||||
go_to_source_definition = {
|
||||
fallback = true, -- fall back to standard LSP definition on failure
|
||||
},
|
||||
server = { -- pass options to lspconfig's setup method
|
||||
on_attach = on_attach,
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
local null_ls = require("null-ls")
|
||||
|
||||
require("mason-null-ls").setup({
|
||||
ensure_installed = {
|
||||
"prettierd",
|
||||
"clang_format",
|
||||
"shellharden",
|
||||
"sql_formatter",
|
||||
"fixjson",
|
||||
"autopep8",
|
||||
"stylua",
|
||||
"rustfmt",
|
||||
},
|
||||
})
|
||||
|
||||
null_ls.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
if client.server_capabilities.documentRangeFormattingProvider then
|
||||
vim.cmd("xnoremap <silent><buffer> <Leader>f :lua vim.lsp.buf.range_formatting({})<CR>")
|
||||
end
|
||||
end,
|
||||
sources = {
|
||||
require("null-ls").builtins.formatting.prettierd.with({
|
||||
env = {
|
||||
PRETTIERD_DEFAULT_CONFIG = vim.fn.expand("~/.config/nvim/lua/settings/.prettierrc"),
|
||||
},}
|
||||
),
|
||||
require("null-ls").builtins.formatting.clang_format,
|
||||
require("null-ls").builtins.formatting.shellharden,
|
||||
require("null-ls").builtins.formatting.sql_formatter,
|
||||
require("null-ls").builtins.formatting.fixjson,
|
||||
require("null-ls").builtins.formatting.autopep8,
|
||||
require("null-ls").builtins.formatting.stylua,
|
||||
require("null-ls").builtins.formatting.rustfmt,
|
||||
},
|
||||
})
|
||||
|
|
@ -23,11 +23,16 @@ local options = {
|
|||
syntax = "off",
|
||||
spelllang = "en_us",
|
||||
mousemodel = "popup_setpos",
|
||||
shell = "/usr/bin/zsh"
|
||||
}
|
||||
|
||||
vim.g.mkdp_browser = '/usr/bin/firefox'
|
||||
vim.g.mkdp_auto_start = 1
|
||||
|
||||
-- space leader
|
||||
vim.g.mapleader = " "
|
||||
vim.keymap.set("n", "<Space>", "<Nop>", { silent = true, noremap = false })
|
||||
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ Plug("nvim-lua/plenary.nvim") -- library, don't delete
|
|||
Plug("williamboman/mason.nvim") -- lsp and dap
|
||||
Plug("williamboman/mason-lspconfig.nvim") -- lsp to mason bridge
|
||||
Plug("neovim/nvim-lspconfig") -- nvim lsp
|
||||
Plug("jose-elias-alvarez/null-ls.nvim") -- enables formatters
|
||||
Plug("jayp0521/mason-null-ls.nvim") -- mason to formatter
|
||||
Plug("mfussenegger/nvim-dap") -- debugging capabilities
|
||||
Plug("rcarriga/nvim-dap-ui") -- debug ui
|
||||
Plug("theHamsta/nvim-dap-virtual-text") -- more debug ui
|
||||
|
|
@ -43,9 +41,21 @@ Plug("nvim-telescope/telescope-ui-select.nvim") -- telescope ui
|
|||
Plug("nvim-telescope/telescope-file-browser.nvim") -- telescope file browser
|
||||
Plug("nvim-telescope/telescope-fzy-native.nvim") -- telescope fuzzy search
|
||||
Plug('nvim-telescope/telescope-project.nvim') -- telescope projects
|
||||
Plug('nvim-telescope/telescope-symbols.nvim') -- symbol picker
|
||||
Plug('nvim-telescope/telescope-file-browser.nvim') -- telescope file browser
|
||||
Plug('nvim-telescope/telescope-dap.nvim') -- dap UI for telescope
|
||||
Plug('benfowler/telescope-luasnip.nvim') -- telescope luasnip integration
|
||||
Plug('sudormrfbin/cheatsheet.nvim') -- cheatsheet for keymaps
|
||||
Plug('jvgrootveld/telescope-zoxide') -- zoxide integration
|
||||
Plug('ThePrimeagen/harpoon') -- harpoonman
|
||||
Plug 'folke/trouble.nvim' -- provides warning/error explanation tab
|
||||
Plug('akinsho/toggleterm.nvim',{ ["tag"] = "*" }) -- better terminal integration
|
||||
Plug("iamcco/markdown-preview.nvim", -- markdown preview
|
||||
{ ["do"] = "cd app && yarn install" })
|
||||
Plug('p00f/clangd_extensions.nvim') -- clangd_extensions
|
||||
Plug('jose-elias-alvarez/typescript.nvim') -- typescript extensions
|
||||
Plug('kdarkhan/rust-tools.nvim') -- rust extensions
|
||||
Plug('preservim/tagbar') -- tags on the right
|
||||
Plug('lukas-reineke/lsp-format.nvim')
|
||||
vim.call("plug#end")
|
||||
|
||||
|
|
|
|||
35
nvim/lua/settings/telescope.lua
Normal file
35
nvim/lua/settings/telescope.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
|
||||
local t = require("telescope")
|
||||
local z_utils = require("telescope._extensions.zoxide.utils")
|
||||
|
||||
-- Configure the extension
|
||||
t.setup({
|
||||
extensions = {
|
||||
zoxide = {
|
||||
prompt_title = "[ Queries ]",
|
||||
mappings = {
|
||||
default = {
|
||||
after_action = function(selection)
|
||||
print("Update to (" .. selection.z_score .. ") " .. selection.path)
|
||||
end
|
||||
},
|
||||
["<C-s>"] = {
|
||||
before_action = function(selection) print("before C-s") end,
|
||||
action = function(selection)
|
||||
vim.cmd("edit " .. selection.path)
|
||||
end
|
||||
},
|
||||
["<C-q>"] = { action = z_utils.create_basic_command("split") },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Load the extension
|
||||
t.load_extension('zoxide')
|
||||
|
||||
-- Add a mapping
|
||||
require("telescope").load_extension("fzy_native")
|
||||
require("telescope").load_extension "file_browser"
|
||||
require('telescope').load_extension('dap')
|
||||
require("telescope").load_extension('harpoon')
|
||||
Loading…
Add table
Add a link
Reference in a new issue