This commit is contained in:
parent
6d47eebeee
commit
c50002b1f2
|
@ -0,0 +1,164 @@
|
|||
# fish completion for chezmoi -*- shell-script -*-
|
||||
|
||||
function __chezmoi_debug
|
||||
set file "$BASH_COMP_DEBUG_FILE"
|
||||
if test -n "$file"
|
||||
echo "$argv" >> $file
|
||||
end
|
||||
end
|
||||
|
||||
function __chezmoi_perform_completion
|
||||
__chezmoi_debug "Starting __chezmoi_perform_completion with: $argv"
|
||||
|
||||
set args (string split -- " " "$argv")
|
||||
set lastArg "$args[-1]"
|
||||
|
||||
__chezmoi_debug "args: $args"
|
||||
__chezmoi_debug "last arg: $lastArg"
|
||||
|
||||
set emptyArg ""
|
||||
if test -z "$lastArg"
|
||||
__chezmoi_debug "Setting emptyArg"
|
||||
set emptyArg \"\"
|
||||
end
|
||||
__chezmoi_debug "emptyArg: $emptyArg"
|
||||
|
||||
if not type -q "$args[1]"
|
||||
# This can happen when "complete --do-complete chezmoi" is called when running this script.
|
||||
__chezmoi_debug "Cannot find $args[1]. No completions."
|
||||
return
|
||||
end
|
||||
|
||||
set requestComp "$args[1] __complete $args[2..-1] $emptyArg"
|
||||
__chezmoi_debug "Calling $requestComp"
|
||||
|
||||
set results (eval $requestComp 2> /dev/null)
|
||||
set comps $results[1..-2]
|
||||
set directiveLine $results[-1]
|
||||
|
||||
# For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
|
||||
# completions must be prefixed with the flag
|
||||
set flagPrefix (string match -r -- '-.*=' "$lastArg")
|
||||
|
||||
__chezmoi_debug "Comps: $comps"
|
||||
__chezmoi_debug "DirectiveLine: $directiveLine"
|
||||
__chezmoi_debug "flagPrefix: $flagPrefix"
|
||||
|
||||
for comp in $comps
|
||||
printf "%s%s\n" "$flagPrefix" "$comp"
|
||||
end
|
||||
|
||||
printf "%s\n" "$directiveLine"
|
||||
end
|
||||
|
||||
# This function does three things:
|
||||
# 1- Obtain the completions and store them in the global __chezmoi_comp_results
|
||||
# 2- Set the __chezmoi_comp_do_file_comp flag if file completion should be performed
|
||||
# and unset it otherwise
|
||||
# 3- Return true if the completion results are not empty
|
||||
function __chezmoi_prepare_completions
|
||||
# Start fresh
|
||||
set --erase __chezmoi_comp_do_file_comp
|
||||
set --erase __chezmoi_comp_results
|
||||
|
||||
# Check if the command-line is already provided. This is useful for testing.
|
||||
if not set --query __chezmoi_comp_commandLine
|
||||
# Use the -c flag to allow for completion in the middle of the line
|
||||
set __chezmoi_comp_commandLine (commandline -c)
|
||||
end
|
||||
__chezmoi_debug "commandLine is: $__chezmoi_comp_commandLine"
|
||||
|
||||
set results (__chezmoi_perform_completion "$__chezmoi_comp_commandLine")
|
||||
set --erase __chezmoi_comp_commandLine
|
||||
__chezmoi_debug "Completion results: $results"
|
||||
|
||||
if test -z "$results"
|
||||
__chezmoi_debug "No completion, probably due to a failure"
|
||||
# Might as well do file completion, in case it helps
|
||||
set --global __chezmoi_comp_do_file_comp 1
|
||||
return 1
|
||||
end
|
||||
|
||||
set directive (string sub --start 2 $results[-1])
|
||||
set --global __chezmoi_comp_results $results[1..-2]
|
||||
|
||||
__chezmoi_debug "Completions are: $__chezmoi_comp_results"
|
||||
__chezmoi_debug "Directive is: $directive"
|
||||
|
||||
set shellCompDirectiveError 1
|
||||
set shellCompDirectiveNoSpace 2
|
||||
set shellCompDirectiveNoFileComp 4
|
||||
set shellCompDirectiveFilterFileExt 8
|
||||
set shellCompDirectiveFilterDirs 16
|
||||
|
||||
if test -z "$directive"
|
||||
set directive 0
|
||||
end
|
||||
|
||||
set compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
|
||||
if test $compErr -eq 1
|
||||
__chezmoi_debug "Received error directive: aborting."
|
||||
# Might as well do file completion, in case it helps
|
||||
set --global __chezmoi_comp_do_file_comp 1
|
||||
return 1
|
||||
end
|
||||
|
||||
set filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
|
||||
set dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
|
||||
if test $filefilter -eq 1; or test $dirfilter -eq 1
|
||||
__chezmoi_debug "File extension filtering or directory filtering not supported"
|
||||
# Do full file completion instead
|
||||
set --global __chezmoi_comp_do_file_comp 1
|
||||
return 1
|
||||
end
|
||||
|
||||
set nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
|
||||
set nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)
|
||||
|
||||
__chezmoi_debug "nospace: $nospace, nofiles: $nofiles"
|
||||
|
||||
# Important not to quote the variable for count to work
|
||||
set numComps (count $__chezmoi_comp_results)
|
||||
__chezmoi_debug "numComps: $numComps"
|
||||
|
||||
if test $numComps -eq 1; and test $nospace -ne 0
|
||||
# To support the "nospace" directive we trick the shell
|
||||
# by outputting an extra, longer completion.
|
||||
__chezmoi_debug "Adding second completion to perform nospace directive"
|
||||
set --append __chezmoi_comp_results $__chezmoi_comp_results[1].
|
||||
end
|
||||
|
||||
if test $numComps -eq 0; and test $nofiles -eq 0
|
||||
__chezmoi_debug "Requesting file completion"
|
||||
set --global __chezmoi_comp_do_file_comp 1
|
||||
end
|
||||
|
||||
# If we don't want file completion, we must return true even if there
|
||||
# are no completions found. This is because fish will perform the last
|
||||
# completion command, even if its condition is false, if no other
|
||||
# completion command was triggered
|
||||
return (not set --query __chezmoi_comp_do_file_comp)
|
||||
end
|
||||
|
||||
# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
|
||||
# so we can properly delete any completions provided by another script.
|
||||
# The space after the the program name is essential to trigger completion for the program
|
||||
# and not completion of the program name itself.
|
||||
complete --do-complete "chezmoi " > /dev/null 2>&1
|
||||
# Using '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
|
||||
|
||||
# Remove any pre-existing completions for the program since we will be handling all of them.
|
||||
complete -c chezmoi -e
|
||||
|
||||
# The order in which the below two lines are defined is very important so that __chezmoi_prepare_completions
|
||||
# is called first. It is __chezmoi_prepare_completions that sets up the __chezmoi_comp_do_file_comp variable.
|
||||
#
|
||||
# This completion will be run second as complete commands are added FILO.
|
||||
# It triggers file completion choices when __chezmoi_comp_do_file_comp is set.
|
||||
complete -c chezmoi -n 'set --query __chezmoi_comp_do_file_comp'
|
||||
|
||||
# This completion will be run first as complete commands are added FILO.
|
||||
# The call to __chezmoi_prepare_completions will setup both __chezmoi_comp_results and __chezmoi_comp_do_file_comp.
|
||||
# It provides the program's completion choices.
|
||||
complete -c chezmoi -n '__chezmoi_prepare_completions' -f -a '$__chezmoi_comp_results'
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
set -x HOSTNAME (hostname)
|
||||
set fish_greeting ""
|
||||
|
||||
set -x EDITOR nvim
|
||||
set -x VISUAL nvim
|
||||
|
||||
# make binaries available in $PATH
|
||||
|
||||
set PATH /snap/bin $PATH
|
||||
set PATH "$HOME/.local/bin" $PATH
|
||||
set PATH "$HOME/shelf/go/bin" $PATH
|
||||
set PATH "$HOME/.cargo/bin" $PATH
|
||||
set PATH "$HOME/.local/share/gem/ruby/3.1.0/bin" $PATH
|
||||
set -gx GOPATH "$HOME/shelf/go"
|
||||
|
||||
# customize fzf to hide preview and make it toggle
|
||||
|
||||
set -gx FZF_DEFAULT_OPTS "
|
||||
--preview-window=:hidden
|
||||
--preview='__fzf_preview {}'
|
||||
--bind '?:toggle-preview'
|
||||
"
|
||||
|
||||
# load up asdf completions
|
||||
if test -f ~/.asdf/asdf.fish
|
||||
source ~/.asdf/asdf.fish
|
||||
end
|
||||
|
||||
# load up gcloud completions
|
||||
if test -f ~/dev/google-cloud-sdk/path.fish.inc
|
||||
set PATH "$HOME/dev/google-clkud-sdk/bin" $PATH
|
||||
source ~/dev/google-cloud-sdk/path.fish.inc
|
||||
end
|
|
@ -0,0 +1,4 @@
|
|||
jorgebucaran/fisher
|
||||
edc/bass
|
||||
PatrickF1/fzf.fish
|
||||
jorgebucaran/hydro
|
|
@ -0,0 +1,22 @@
|
|||
function fish_title --argument-names last_cmd
|
||||
set prefix ""
|
||||
|
||||
if set -q SSH_CLIENT
|
||||
if not set -q TMUX
|
||||
set prefix "@$hostname "
|
||||
end
|
||||
end
|
||||
|
||||
set shortpwd (fish_prompt_pwd_dir_length=1 prompt_pwd)
|
||||
|
||||
if [ fish != $_ ]
|
||||
switch $_
|
||||
case vi vim nvim
|
||||
echo "$prefix$_ $(path basename $last_cmd)"
|
||||
case '*'
|
||||
echo "$prefix$last_cmd"
|
||||
end
|
||||
else
|
||||
echo "$prefix$shortpwd"
|
||||
end
|
||||
end
|
|
@ -0,0 +1,40 @@
|
|||
# gruvbox dark
|
||||
|
||||
# Syntax Highlighting Colors
|
||||
fish_color_normal ebdbb2 #fg1
|
||||
fish_color_command 8ec07c #cyan2
|
||||
fish_color_keyword 83a598 #blue2
|
||||
fish_color_quote fabd2f #yellow2
|
||||
fish_color_redirection ebdbb2 #fg1
|
||||
fish_color_end fe8019 #orange2
|
||||
fish_color_error fb4934 #red2
|
||||
fish_color_param d3869b #purple2
|
||||
fish_color_comment d6c4a1 #fg2
|
||||
fish_color_selection --background=504945 #bg2
|
||||
fish_color_search_match --background=504945 #bg2
|
||||
fish_color_operator b8bb26 #green2
|
||||
fish_color_escape 83a598 #blue2
|
||||
fish_color_autosuggestion d6c4a1 #fg2
|
||||
fish_color_cancel fb4934 --reverse #red2
|
||||
fish_color_option fe8019 #orange2
|
||||
|
||||
# Default Prompt Colors
|
||||
fish_color_cwd b8bb26 #green2
|
||||
fish_color_host d3869b #purple2
|
||||
fish_color_host_remote d3869b #purple2
|
||||
fish_color_user 8ec07c #cyan2
|
||||
|
||||
# Completion Pager Colors
|
||||
fish_pager_color_progress d6c4a1 #fg2
|
||||
fish_pager_color_background
|
||||
fish_pager_color_prefix 8ec07c #cyan2
|
||||
fish_pager_color_completion ebdbb2 #fg1
|
||||
fish_pager_color_description d6c4a1 #fg2
|
||||
fish_pager_color_selected_background --background=504945 #bg2
|
||||
fish_pager_color_selected_prefix 8ec07c #cyan2
|
||||
fish_pager_color_selected_completion ebdbb2 #fg1
|
||||
fish_pager_color_selected_description d6c4a1 #fg2
|
||||
fish_pager_color_secondary_background
|
||||
fish_pager_color_secondary_prefix 8ec07c #cyan2
|
||||
fish_pager_color_secondary_completion ebdbb2 #fg1
|
||||
fish_pager_color_secondary_description d6c4a1 #fg2
|
|
@ -0,0 +1,40 @@
|
|||
# gruvbox light
|
||||
|
||||
# Syntax Highlighting Colors
|
||||
fish_color_normal 3c3836 #fg1
|
||||
fish_color_command 427b58 #aqua2
|
||||
fish_color_keyword 076678 #blue2
|
||||
fish_color_quote b57614 #yellow2
|
||||
fish_color_redirection 3c3836 #fg1
|
||||
fish_color_end af3a03 #orange2
|
||||
fish_color_error 9d0006 #red2
|
||||
fish_color_param 8f3f71 #purple2
|
||||
fish_color_comment 504945 #fg2
|
||||
fish_color_selection --background=d5c4a1 #bg2
|
||||
fish_color_search_match --background=d5c4a1 #bg2
|
||||
fish_color_operator 79740e #green2
|
||||
fish_color_escape 076678 #blue2
|
||||
fish_color_autosuggestion 504945 #fg2
|
||||
fish_color_cancel 9d0006 --reverse #red2
|
||||
fish_color_option af3a03 #orange2
|
||||
|
||||
# Default Prompt Colors
|
||||
fish_color_cwd 79740e #green2
|
||||
fish_color_host 8f3f71 #purple2
|
||||
fish_color_host_remote 8f3f71 #purple2
|
||||
fish_color_user 427b58 #aqua2
|
||||
|
||||
# Completion Pager Colors
|
||||
fish_pager_color_progress 504945 #fg2
|
||||
fish_pager_color_background
|
||||
fish_pager_color_prefix 427b58 #aqua2
|
||||
fish_pager_color_completion 3c3836 #fg1
|
||||
fish_pager_color_description 504945 #fg2
|
||||
fish_pager_color_selected_background --background=d5c4a1 #bg2
|
||||
fish_pager_color_selected_prefix 427b58 #aqua2
|
||||
fish_pager_color_selected_completion 3c3836 #fg1
|
||||
fish_pager_color_selected_description 504945 #fg2
|
||||
fish_pager_color_secondary_background
|
||||
fish_pager_color_secondary_prefix 427b58 #aqua2
|
||||
fish_pager_color_secondary_completion 3c3836 #fg1
|
||||
fish_pager_color_secondary_description 504945 #fg2
|
|
@ -0,0 +1 @@
|
|||
read_globals = { "vim" }
|
|
@ -0,0 +1 @@
|
|||
au BufRead,BufNewFile *.fish set filetype=fish
|
|
@ -0,0 +1 @@
|
|||
au BufRead,BufNewFile *.prisma set filetype=prisma
|
|
@ -0,0 +1,74 @@
|
|||
-- lazy setup
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- set fish as default shell
|
||||
vim.cmd("set shell=/usr/bin/fish")
|
||||
|
||||
-- hide unsaved changes into buffer when opening a new buffer
|
||||
vim.cmd("set hidden")
|
||||
|
||||
-- don't give |ins-completion-menu| messages.
|
||||
vim.cmd("set shortmess+=c")
|
||||
|
||||
-- change split defaults to be more intuitive...
|
||||
vim.cmd("set splitbelow")
|
||||
vim.cmd("set splitright")
|
||||
|
||||
-- disable mouse
|
||||
vim.cmd("set mouse=")
|
||||
|
||||
-- in insertmode, replace tabs with spaces
|
||||
vim.cmd("set expandtab")
|
||||
|
||||
-- briefly show matching bracket when one is inserted
|
||||
vim.cmd("set showmatch")
|
||||
|
||||
-- always show gutter
|
||||
vim.cmd("set signcolumn=yes")
|
||||
|
||||
-- tabs are represented by 2 spaces in edit mode
|
||||
vim.cmd("set tabstop=2")
|
||||
|
||||
-- tabs are represented by 2 spaces during auto-indent
|
||||
vim.cmd("set shiftwidth=2")
|
||||
|
||||
-- set theme
|
||||
vim.cmd("set termguicolors")
|
||||
vim.cmd([["let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"]])
|
||||
vim.cmd([["let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"]])
|
||||
|
||||
-- tmux customization
|
||||
vim.cmd([[augroup tmux
|
||||
autocmd!
|
||||
if exists('$TMUX')
|
||||
autocmd BufReadPost,FileReadPost,BufNewFile,BufEnter * call
|
||||
\ system("tmux rename-window 'vim['" . expand("%:t") . "']")
|
||||
endif
|
||||
augroup END]])
|
||||
|
||||
vim.opt.completeopt = "menuone,noselect"
|
||||
|
||||
vim.diagnostic.config({ virtual_text = false, float = { border = border } })
|
||||
|
||||
-- https://github.com/neovim/neovim/issues/17070#issuecomment-1086775760
|
||||
if vim.env.TERM == "tmux-256color" then
|
||||
vim.loop.fs_write(2, "\27Ptmux;\27\27]11;?\7\27\\", -1, nil)
|
||||
end
|
||||
|
||||
-- load plugins folder with lazy.nvim
|
||||
require("lazy").setup("plugins")
|
|
@ -0,0 +1,70 @@
|
|||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-calc",
|
||||
"hrsh7th/cmp-vsnip",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
"hrsh7th/cmp-emoji",
|
||||
"hrsh7th/cmp-nvim-lsp-signature-help",
|
||||
"onsails/lspkind-nvim",
|
||||
},
|
||||
event = "InsertEnter",
|
||||
opts = function()
|
||||
local lspkind = require("lspkind")
|
||||
local cmp = require("cmp")
|
||||
|
||||
return {
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = {
|
||||
border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
|
||||
winhighlight = "Normal:CmpNormal",
|
||||
},
|
||||
documentation = {
|
||||
border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
|
||||
winhighlight = "Normal:CmpNormal",
|
||||
},
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "nvim_diagnostic" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ name = "calc" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "nvim_lsp_signature_help" },
|
||||
{ name = "emoji" },
|
||||
},
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = "symbol_text",
|
||||
menu = {
|
||||
buffer = "[Buffer]",
|
||||
nvim_lsp = "[LSP]",
|
||||
luasnip = "[LuaSnip]",
|
||||
nvim_lua = "[Lua]",
|
||||
latex_symbols = "[Latex]",
|
||||
},
|
||||
}),
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local gruvbox = require("gruvbox")
|
||||
local palette = require("gruvbox.palette")
|
||||
|
||||
gruvbox.setup({
|
||||
overrides = {
|
||||
NormalFloat = { bg = palette.bg0 },
|
||||
CmpNormal = { bg = palette.bg0 },
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd.colorscheme("gruvbox")
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"tpope/vim-sensible",
|
||||
"tmux-plugins/vim-tmux",
|
||||
{ "junegunn/fzf", build = ":call fzf#install()" },
|
||||
"github/copilot.vim",
|
||||
"farmergreg/vim-lastplace",
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
},
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
local border = {
|
||||
{ "╭", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╮", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
{ "╯", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╰", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
}
|
||||
|
||||
-- LSP settings (for overriding per client)
|
||||
local handlers = {
|
||||
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }),
|
||||
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border }),
|
||||
}
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.keymap.set("n", "<space>e", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
|
||||
vim.keymap.set("n", "<space>en", "<cmd>lua vim.diagnostic.goto_next()<CR>", opts)
|
||||
vim.keymap.set("n", "<space>ep", "<cmd>lua vim.diagnostic.goto_prev()<CR>", opts)
|
||||
vim.keymap.set("n", "<space>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
|
||||
|
||||
local on_attach = function(_, bufnr)
|
||||
-- Mappings.
|
||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set("n", "<space>f", vim.lsp.buf.formatting, bufopts)
|
||||
end
|
||||
|
||||
local function organize_imports()
|
||||
local params = {
|
||||
command = "_typescript.organizeImports",
|
||||
arguments = { vim.api.nvim_buf_get_name(0) },
|
||||
title = "",
|
||||
}
|
||||
vim.lsp.buf.execute_command(params)
|
||||
end
|
||||
|
||||
lspconfig.tsserver.setup({
|
||||
on_attach = on_attach,
|
||||
handlers = handlers,
|
||||
commands = {
|
||||
LspOrganizeImports = {
|
||||
organize_imports,
|
||||
description = "Organize Imports",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- lspconfig.eslint.setup{on_attach = on_attach, capabilities = capabilities, handlers = handlers}
|
||||
lspconfig.tailwindcss.setup({ on_attach = on_attach, capabilities = capabilities, handlers = handlers })
|
||||
lspconfig.flow.setup({ on_attach = on_attach, handlers = handlers })
|
||||
lspconfig.graphql.setup({ on_attach = on_attach, handlers = handlers })
|
||||
lspconfig.html.setup({ on_attach = on_attach, capabilities = capabilities, handlers = handlers })
|
||||
-- lspconfig.markdown.setup{on_attach = on_attach, capabilities = capabilities, handlers = handlers}
|
||||
lspconfig.intelephense.setup({ on_attach = on_attach, handlers = handlers })
|
||||
lspconfig.jsonls.setup({ on_attach = on_attach, handlers = handlers })
|
||||
lspconfig.pyright.setup({ on_attach = on_attach, handlers = handlers })
|
||||
lspconfig.vimls.setup({ on_attach = on_attach, handlers = handlers })
|
||||
lspconfig.prismals.setup({ on_attach = on_attach, handlers = handlers })
|
||||
lspconfig.solargraph.setup({ on_attach = on_attach, capabilities = capabilities, handlers = handlers })
|
||||
-- lspconfig.stylelint_lsp.setup{on_attach = on_attach, handlers = handlers}
|
||||
lspconfig.bashls.setup({ on_attach = on_attach, handlers = handlers })
|
||||
lspconfig.dockerls.setup({ on_attach = on_attach, handlers = handlers })
|
||||
lspconfig.gopls.setup({
|
||||
on_attach = on_attach,
|
||||
handlers = handlers,
|
||||
root_dir = function()
|
||||
return vim.loop.cwd()
|
||||
end,
|
||||
})
|
||||
lspconfig.yamlls.setup({ on_attach = on_attach, handlers = handlers })
|
||||
lspconfig.cssls.setup({ on_attach = on_attach, capabilities = capabilities, handlers = handlers })
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
return {
|
||||
"hoob3rt/lualine.nvim",
|
||||
dependencies = {
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
},
|
||||
opts = {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch" },
|
||||
lualine_c = {
|
||||
{
|
||||
"buffers",
|
||||
separator = { right = "", left = "" },
|
||||
},
|
||||
},
|
||||
lualine_x = {},
|
||||
lualine_y = {
|
||||
"progress",
|
||||
{
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
},
|
||||
},
|
||||
lualine_z = {
|
||||
"location",
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,146 @@
|
|||
return {
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
local async_formatting = function(bufnr)
|
||||
bufnr = bufnr or vim.api.nvim_get_current_buf()
|
||||
|
||||
vim.lsp.buf_request(
|
||||
bufnr,
|
||||
"textDocument/formatting",
|
||||
vim.lsp.util.make_formatting_params({}),
|
||||
function(err, res, ctx)
|
||||
if err then
|
||||
local err_msg = type(err) == "string" and err or err.message
|
||||
-- you can modify the log message / level (or ignore it completely)
|
||||
vim.notify("formatting: " .. err_msg, vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
-- don't apply results if buffer is unloaded or has been modified
|
||||
if not vim.api.nvim_buf_is_loaded(bufnr) or vim.api.nvim_buf_get_option(bufnr, "modified") then
|
||||
return
|
||||
end
|
||||
|
||||
if res then
|
||||
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
||||
vim.lsp.util.apply_text_edits(res, bufnr, client and client.offset_encoding or "utf-16")
|
||||
vim.api.nvim_buf_call(bufnr, function()
|
||||
vim.cmd("silent noautocmd update")
|
||||
end)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
null_ls.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
async_formatting(bufnr)
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
sources = {
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.diagnostics.eslint,
|
||||
null_ls.builtins.completion.spell,
|
||||
null_ls.builtins.diagnostics.erb_lint,
|
||||
null_ls.builtins.code_actions.gitsigns,
|
||||
null_ls.builtins.code_actions.shellcheck,
|
||||
null_ls.builtins.diagnostics.actionlint,
|
||||
null_ls.builtins.diagnostics.buf,
|
||||
null_ls.builtins.diagnostics.checkmake,
|
||||
null_ls.builtins.diagnostics.codespell,
|
||||
-- null_ls.builtins.diagnostics.cspell,
|
||||
-- null_ls.builtins.diagnostics.editorconfig_checker,
|
||||
null_ls.builtins.diagnostics.fish,
|
||||
null_ls.builtins.diagnostics.flake8,
|
||||
-- null_ls.builtins.diagnostics.gitlint,
|
||||
null_ls.builtins.diagnostics.golangci_lint,
|
||||
-- null_ls.builtins.diagnostics.hadolint,
|
||||
null_ls.builtins.diagnostics.jsonlint,
|
||||
null_ls.builtins.diagnostics.luacheck,
|
||||
null_ls.builtins.diagnostics.markdownlint,
|
||||
null_ls.builtins.formatting.markdownlint,
|
||||
-- null_ls.builtins.diagnostics.misspell,
|
||||
null_ls.builtins.diagnostics.mypy,
|
||||
null_ls.builtins.diagnostics.php,
|
||||
null_ls.builtins.diagnostics.pylint,
|
||||
null_ls.builtins.diagnostics.rubocop,
|
||||
null_ls.builtins.diagnostics.shellcheck,
|
||||
-- null_ls.builtins.diagnostics.standardrb,
|
||||
null_ls.builtins.diagnostics.stylelint,
|
||||
null_ls.builtins.diagnostics.tidy,
|
||||
-- null_ls.builtins.diagnostics.tsc,
|
||||
null_ls.builtins.diagnostics.yamllint,
|
||||
null_ls.builtins.formatting.autopep8,
|
||||
null_ls.builtins.formatting.beautysh,
|
||||
null_ls.builtins.formatting.black,
|
||||
-- null_ls.builtins.formatting.cbfmt,
|
||||
null_ls.builtins.formatting.erb_lint,
|
||||
null_ls.builtins.formatting.eslint,
|
||||
null_ls.builtins.formatting.fish_indent,
|
||||
null_ls.builtins.formatting.fixjson,
|
||||
null_ls.builtins.formatting.gofmt,
|
||||
null_ls.builtins.formatting.gofumpt,
|
||||
null_ls.builtins.formatting.goimports,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.json_tool,
|
||||
null_ls.builtins.formatting.nginx_beautifier,
|
||||
null_ls.builtins.formatting.pg_format,
|
||||
null_ls.builtins.formatting.prettier.with({
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
"css",
|
||||
"scss",
|
||||
"less",
|
||||
"html",
|
||||
"json",
|
||||
"jsonc",
|
||||
"yaml",
|
||||
"graphql",
|
||||
"handlebars",
|
||||
"markdown",
|
||||
},
|
||||
}),
|
||||
null_ls.builtins.formatting.prismaFmt,
|
||||
-- null_ls.builtins.formatting.remark,
|
||||
null_ls.builtins.formatting.rubocop,
|
||||
null_ls.builtins.formatting.rustywind.with({
|
||||
filetypes = {
|
||||
"eruby",
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
"svelte",
|
||||
"html",
|
||||
},
|
||||
}),
|
||||
null_ls.builtins.formatting.shfmt,
|
||||
-- null_ls.builtins.formatting.standardrb,
|
||||
-- null_ls.builtins.formatting.stylelint,
|
||||
null_ls.builtins.formatting.terraform_fmt,
|
||||
null_ls.builtins.formatting.yamlfmt,
|
||||
null_ls.builtins.formatting.tidy,
|
||||
null_ls.builtins.formatting.xmllint,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local layout = require("telescope.actions.layout")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
file_ignore_patterns = { "node_modules" },
|
||||
preview = { hide_on_startup = true },
|
||||
mappings = {
|
||||
n = {
|
||||
["<C-p>"] = layout.toggle_preview,
|
||||
},
|
||||
i = {
|
||||
["<C-p>"] = layout.toggle_preview,
|
||||
["<esc>"] = actions.close,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<space>ff",
|
||||
[[<Cmd>lua require('telescope.builtin').find_files()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<space>ft",
|
||||
[[<Cmd>lua require('telescope.builtin').treesitter()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<space>fg",
|
||||
[[<Cmd>lua require('telescope.builtin').live_grep()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<space>fb",
|
||||
[[<Cmd>lua require('telescope.builtin').buffers()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = "BufReadPost",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"fish",
|
||||
"go",
|
||||
"gomod",
|
||||
"graphql",
|
||||
"html",
|
||||
"java",
|
||||
"javascript",
|
||||
"lua",
|
||||
"php",
|
||||
"python",
|
||||
"regex",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"yaml",
|
||||
"comment",
|
||||
"tsx",
|
||||
"prisma",
|
||||
"markdown",
|
||||
"ruby",
|
||||
"vim",
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = false,
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = "<nop>",
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(_, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"folke/trouble.nvim",
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
## COLORSCHEME: gruvbox dark (medium)
|
||||
|
||||
color_bg="#3c3836" # bg1
|
||||
color_fg="#ebdbb2" # fg1
|
||||
color_status_bg="#bdae93" # fg3
|
||||
color_status_fg="#282828" # bg0
|
||||
color_status_info_bg="#504945" # bg2
|
||||
color_status_info_fg="#ebdbb2" # fg1
|
||||
color_window_bg="#fabd2f" # yellow
|
||||
color_window_fg="#282828" # bg0
|
||||
color_window_info_bg="#504945" # bg2
|
||||
color_window_info_fg="#a89984" # fg4
|
||||
|
||||
set-option -g status "on"
|
||||
|
||||
# default statusbar color
|
||||
set-option -g status-style "bg=${color_bg},fg=${color_fg}" # bg=bg1, fg=fg1
|
||||
|
||||
# default window title colors
|
||||
set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1
|
||||
|
||||
# default window with an activity alert
|
||||
set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3
|
||||
|
||||
# active window title colors
|
||||
set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1
|
||||
|
||||
# pane border
|
||||
set-option -g pane-active-border-style fg=colour250 #fg2
|
||||
set-option -g pane-border-style fg=colour237 #bg1
|
||||
|
||||
# message infos
|
||||
set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1
|
||||
|
||||
# writing commands inactive
|
||||
set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
|
||||
|
||||
# pane number display
|
||||
set-option -g display-panes-active-colour colour250 #fg2
|
||||
set-option -g display-panes-colour colour237 #bg1
|
||||
|
||||
# clock
|
||||
set-window-option -g clock-mode-colour colour109 #blue
|
||||
|
||||
# bell
|
||||
set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg
|
||||
|
||||
set-option -g status-justify "left"
|
||||
set-option -g status-left-style none
|
||||
set-option -g status-left-length "80"
|
||||
set-option -g status-right-style none
|
||||
set-option -g status-right-length "80"
|
||||
set-window-option -g window-status-separator ""
|
||||
|
||||
set -g status-left "#[fg=${color_status_fg},bg=${color_status_bg},bold] #h@#S #[fg=${color_status_bg},bg=${color_bg},nobold,nounderscore,noitalics]"
|
||||
set -g status-right "#[fg=${color_status_info_bg},bg=${color_bg},nobold,nounderscore,noitalics]#[fg=${color_status_info_fg},bg=${color_status_info_bg}] #{cpu_percentage} #[fg=${color_bg},bg=${color_status_info_bg},nobold,nounderscore,noitalics]#[fg=${color_status_info_fg},bg=${color_bg}] #{ram_percentage} #[fg=${color_status_info_bg},bg=${color_bg},nobold,nounderscore,noitalics]#[fg=${color_status_info_fg},bg=${color_status_info_bg}] #{battery_icon} #{battery_percentage} "
|
||||
setw -g window-status-format "#[fg=${color_window_info_fg},bg=${color_bg}] #I:#P #[fg=${color_window_info_fg},bg=${color_bg}] #T "
|
||||
setw -g window-status-current-format "#[fg=${color_bg},bg=${color_window_bg},nobold,nounderscore,noitalics]#[fg=${color_window_fg},bg=${color_window_bg}] #I:#P #[fg=${color_window_fg},bg=${color_window_bg}] #T #[fg=${color_window_bg},bg=${color_bg},nobold,nounderscore,noitalics]"
|
||||
|
||||
# vim: set ft=tmux tw=0 nowrap:
|
|
@ -0,0 +1,62 @@
|
|||
## COLORSCHEME: gruvbox light (medium)
|
||||
|
||||
color_bg="#ebdbb2" # bg1
|
||||
color_fg="#3c3836" # fg1
|
||||
color_status_bg="#665c54" # fg3
|
||||
color_status_fg="#fbf1c7" # bg0
|
||||
color_status_info_bg="#d5c4a1" # bg2
|
||||
color_status_info_fg="#3c3836" # fg1
|
||||
color_window_bg="#d79921" # yellow
|
||||
color_window_fg="#fbf1c7" # bg0
|
||||
color_window_info_bg="#d5c4a1" # bg2
|
||||
color_window_info_fg="#7c6f64" # fg4
|
||||
|
||||
|
||||
set-option -g status "on"
|
||||
|
||||
# default statusbar colors
|
||||
set-option -g status-style bg=colour252,fg=colour239 # bg=notInGruvboxPallete, #fg=fg1
|
||||
|
||||
# default window title colors
|
||||
set-window-option -g window-status-style bg=colour66,fg=colour229 # bg=aqua, fg=bg5
|
||||
|
||||
# default window with an activity alert
|
||||
set-window-option -g window-status-activity-style bg=colour237,fg=colour241 # bg=bg1, fg=notInGruvboxPallete
|
||||
|
||||
# active window title colors
|
||||
set-window-option -g window-status-current-style bg=default,fg=colour237 # bg=default, fg=bg1
|
||||
|
||||
# pane border
|
||||
set-option -g pane-active-border-style fg=colour241 # fg=notInGruvboxPallete
|
||||
set-option -g pane-border-style fg=colour252 # bg1=notInGruvboxPallete
|
||||
|
||||
# message infos (visible while writing command)
|
||||
set-option -g message-style bg=colour252,fg=colour241 # bg=notInGruvboxPallete, fg=notInGruvboxPallete
|
||||
|
||||
# writing commands inactive
|
||||
set-option -g message-command-style bg=colour124,fg=colour241 # bg=notInGruvboxPallete, fg=notInGruvboxPallete
|
||||
|
||||
# pane number display
|
||||
set-option -g display-panes-active-colour colour241 # notInGruvboxPallete
|
||||
set-option -g display-panes-colour colour248 # notInGruvboxPallete
|
||||
|
||||
# clock
|
||||
set-window-option -g clock-mode-colour colour172 # orange
|
||||
|
||||
# bell
|
||||
set-window-option -g window-status-bell-style bg=colour124,fg=colour229 # bg=red, fg=bg
|
||||
|
||||
## Theme settings mixed with colors (unfortunately, but there is no cleaner way)
|
||||
set-option -g status-justify "left"
|
||||
set-option -g status-left-style none
|
||||
set-option -g status-left-length "80"
|
||||
set-option -g status-right-style none
|
||||
set-option -g status-right-length "80"
|
||||
set-window-option -g window-status-separator ""
|
||||
|
||||
set -g status-left "#[fg=${color_status_fg},bg=${color_status_bg},bold] #h@#S #[fg=${color_status_bg},bg=${color_bg},nobold,nounderscore,noitalics]"
|
||||
set -g status-right "#[fg=${color_status_info_bg},bg=${color_bg},nobold,nounderscore,noitalics]#[fg=${color_status_info_fg},bg=${color_status_info_bg}] #{cpu_percentage} #[fg=${color_bg},bg=${color_status_info_bg},nobold,nounderscore,noitalics]#[fg=${color_status_info_fg},bg=${color_bg}] #{ram_percentage} #[fg=${color_status_info_bg},bg=${color_bg},nobold,nounderscore,noitalics]#[fg=${color_status_info_fg},bg=${color_status_info_bg}] #{battery_icon} #{battery_percentage} "
|
||||
setw -g window-status-format "#[fg=${color_window_info_fg},bg=${color_bg}] #I:#P #[fg=${color_window_info_fg},bg=${color_bg}] #T "
|
||||
setw -g window-status-current-format "#[fg=${color_bg},bg=${color_window_bg},nobold,nounderscore,noitalics]#[fg=${color_window_fg},bg=${color_window_bg}] #I:#P #[fg=${color_window_fg},bg=${color_window_bg}] #T #[fg=${color_window_bg},bg=${color_bg},nobold,nounderscore,noitalics]"
|
||||
|
||||
# vim: set ft=tmux tw=0 nowrap:
|
|
@ -0,0 +1,101 @@
|
|||
# List of plugins
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-battery'
|
||||
set -g @plugin 'tmux-plugins/tmux-cpu'
|
||||
|
||||
# reload tmux
|
||||
bind r source-file ~/.config/tmux/tmux.conf
|
||||
|
||||
# Make it use C-a, similar to screen...
|
||||
unbind C-b
|
||||
unbind l
|
||||
set -g prefix C-a
|
||||
bind-key C-a last-window
|
||||
bind-key a send-prefix
|
||||
|
||||
# Have new windows and panes open in the current directory
|
||||
# make splitting easier to remember
|
||||
unbind % # Remove default binding since we’re replacing
|
||||
bind | split-window -c '#{pane_current_path}' -h
|
||||
bind - split-window -c '#{pane_current_path}' -v
|
||||
bind c new-window -c '#{pane_current_path}'
|
||||
|
||||
#make moving in panes work like vi
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
|
||||
#colors!
|
||||
#set -g default-terminal 'screen-256color'
|
||||
set -g default-terminal 'tmux-256color'
|
||||
# should match $TERM outside tmux
|
||||
set -as terminal-overrides ',xterm-256color:Tc'
|
||||
|
||||
#remember last 1000 commands
|
||||
set -g history-limit 2000
|
||||
|
||||
# Automatically set window title
|
||||
set -g status-interval 5
|
||||
set -g automatic-rename on
|
||||
set -g renumber-windows on # renumber windows when a window is closed
|
||||
set -g set-titles on # set terminal title
|
||||
set -g set-titles-string "#T"
|
||||
|
||||
# Set window notification
|
||||
setw -g monitor-activity on
|
||||
set -g visual-activity on
|
||||
|
||||
# basic settings, make work like vi
|
||||
setw -g mode-keys vi # vi key
|
||||
set -g status-keys vi
|
||||
|
||||
set -g status-position bottom
|
||||
set -g status-justify left
|
||||
|
||||
# https://github.com/tmux-plugins/tmux-battery
|
||||
set -g @batt_icon_charge_tier8 ''
|
||||
set -g @batt_icon_charge_tier7 ''
|
||||
set -g @batt_icon_charge_tier6 ''
|
||||
set -g @batt_icon_charge_tier5 ''
|
||||
set -g @batt_icon_charge_tier4 ''
|
||||
set -g @batt_icon_charge_tier3 ''
|
||||
set -g @batt_icon_charge_tier2 ''
|
||||
set -g @batt_icon_charge_tier1 ''
|
||||
set -g @batt_icon_status_charged ''
|
||||
set -g @batt_icon_status_charging ''
|
||||
set -g @batt_icon_status_discharging ''
|
||||
set -g @batt_icon_status_unknown '盛'
|
||||
|
||||
# https://github.com/tmux-plugins/tmux-cpu
|
||||
set -g @cpu_percentage_format "%2d%%"
|
||||
set -g @ram_percentage_format "%2d%%"
|
||||
|
||||
# status
|
||||
set -g status-justify "left"
|
||||
set -g status "on"
|
||||
set -g status-left-style "none"
|
||||
set -g status-right-style "none"
|
||||
set -g status-right-length "100"
|
||||
set -g status-left-length "100"
|
||||
setw -g window-status-activity-style "none"
|
||||
setw -g window-status-separator ""
|
||||
|
||||
# VI-like binding for copy/paste mode
|
||||
unbind [
|
||||
bind Escape copy-mode
|
||||
unbind p
|
||||
bind p paste-buffer
|
||||
|
||||
# https://github.com/neovim/neovim/wiki/FAQ#esc-in-tmux-or-gnu-screen-is-delayed
|
||||
set -g escape-time 10
|
||||
|
||||
# customize status bar
|
||||
set -g status-position bottom
|
||||
bind t set-option status
|
||||
|
||||
source-file ~/.config/tmux/tmux-dark.conf
|
||||
bind R source-file ~/.config/tmux/tmux-light.conf
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.local/share/tmux/plugins/tpm/tpm'
|
|
@ -0,0 +1,13 @@
|
|||
root = true
|
||||
|
||||
[**.js]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[**.css]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[**.html]
|
||||
indent_style = space
|
||||
indent_size = 2
|
Loading…
Reference in New Issue