From 6ebc6fe6a88e8d7a7f68682c27e3d88b00810a5e Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Sun, 17 Jan 2021 17:54:23 -0800 Subject: [PATCH 001/126] polonius-init --- .config/terminator/config | 9 +++------ .tmux.conf | 2 +- bin/pk | 16 +++++++++------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.config/terminator/config b/.config/terminator/config index 7303597..8150711 100644 --- a/.config/terminator/config +++ b/.config/terminator/config @@ -8,23 +8,20 @@ [keybindings] cycle_next = j cycle_prev = k - split_vert = "" + split_vert = v close_term = w - paste = v - help = "" + paste = Insert [profiles] [[default]] - allow_bold = False background_darkness = 0.8 background_type = transparent cursor_color = "#ffffff" - font = Iosevka Berkeley Light 18 + font = Iosevka Berkeley weight=453 21 foreground_color = "#ffffff" show_titlebar = False scrollbar_position = hidden scrollback_infinite = True use_system_font = False - bold_is_bright = True [[4k]] background_darkness = 0.8 background_type = transparent diff --git a/.tmux.conf b/.tmux.conf index b408322..47e3e77 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -52,7 +52,7 @@ set-window-option -g window-status-style fg=white,bg=default,dim # active window title colors set-window-option -g window-status-current-style fg=cyan,bg=default,bright -set-window-option -g window-style fg=#aaaaaa,bg=terminal +set-window-option -g window-style fg=#aaaaaa,bg=#111111 set-window-option -g window-active-style fg=terminal,bg=terminal set -g status-left '#[fg=green][ #H ][ ' diff --git a/bin/pk b/bin/pk index a7edbdf..1bd1a29 100755 --- a/bin/pk +++ b/bin/pk @@ -1,7 +1,9 @@ #!/bin/sh search () { shift - if command -v pacman &> /dev/null; then + if command -v apt &> /dev/null; then + apt search $1 + elif command -v pacman &> /dev/null; then pacman -Ss $1 || yay -Ss $1 elif command -v dnf &> /dev/null; then dnf search $1 @@ -19,7 +21,9 @@ search () { update () { shift - if command -v pacman &> /dev/null; then + if command -v apt-get &> /dev/null; then + sudo apt-get update + elif command -v pacman &> /dev/null; then sudo pacman -Sy elif command -v dnf &> /dev/null; then sudo dnf update @@ -27,14 +31,14 @@ update () { sudo port selfupdate elif command -v portsnap &> /dev/null; then sudo portsnap fetch && sudo portsnap upgrade - elif command -v apt-get &> /dev/null; then - sudo apt-get update fi } install () { shift - if command -v pacman &> /dev/null; then + if command -v apt-get &> /dev/null; then + sudo apt-get install $* + elif command -v pacman &> /dev/null; then sudo pacman -S $* || yay -S $* elif command -v dnf &> /dev/null; then sudo dnf install $* @@ -42,8 +46,6 @@ install () { sudo port install $* elif command -v portmaster &> /dev/null; then sudo portmaster $* - elif command -v apt-get &> /dev/null; then - sudo apt-get install $* fi } From 0cf8ef3dbb3dc9899bfc4d9e8ecc8393373b29ae Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 14 Jun 2021 19:51:52 -0700 Subject: [PATCH 002/126] polonius diff --- .config/alacritty/alacritty.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 15b423e..4000282 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -29,9 +29,9 @@ window: # Number of lines/columns (not pixels) in the terminal. The number of columns # must be at least `2`, while using a value of `0` for columns and lines will # fall back to the window manager's recommended size. - #dimensions: - # columns: 0 - # lines: 0 + dimensions: + columns: 147 + lines: 40 # Window position (changes require restart) # @@ -72,7 +72,7 @@ window: # # Values for `startup_mode` (macOS only): # - SimpleFullscreen - #startup_mode: Windowed + startup_mode: Fullscreen # Window title #title: Alacritty @@ -151,7 +151,7 @@ font: style: Oblique # Point size - size: 17.0 + size: 14.5 # Offset is the extra space around each character. `offset.y` can be thought # of as modifying the line spacing, and `offset.x` as modifying the letter @@ -830,7 +830,7 @@ key_bindings: #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } # (Windows only) - #- { key: Return, mods: Alt, action: ToggleFullscreen } + - { key: Return, mods: Alt, action: ToggleFullscreen } # (macOS only) #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } From e8626f8108abd5235cbaadbeee2d2f74cd826643 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 7 Feb 2022 09:57:31 -0800 Subject: [PATCH 003/126] config fixes for fish on fedora --- .config/fish/conf.d/virtualfish-loader.fish | 4 ++-- .config/fish/config.fish | 3 ++- .vimrc | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.config/fish/conf.d/virtualfish-loader.fish b/.config/fish/conf.d/virtualfish-loader.fish index eee0754..1bfbcb8 100644 --- a/.config/fish/conf.d/virtualfish-loader.fish +++ b/.config/fish/conf.d/virtualfish-loader.fish @@ -1,4 +1,4 @@ set -g VIRTUALFISH_VERSION 2.5.4 -set -g VIRTUALFISH_PYTHON_EXEC /bin/python -source /usr/lib/python3.10/site-packages/virtualfish/virtual.fish +set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python3 +source /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish emit virtualfish_did_setup_plugins \ No newline at end of file diff --git a/.config/fish/config.fish b/.config/fish/config.fish index bb445b0..a271bc3 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,5 +1,6 @@ -set PATH ~/bin ~/.go/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin $PATH +set PATH ~/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin $PATH set fish_greeting "" +set EDITOR vi . ~/.config/fish/fish_aliases.fish diff --git a/.vimrc b/.vimrc index 47c70c4..651f0a7 100644 --- a/.vimrc +++ b/.vimrc @@ -205,6 +205,7 @@ Plug 'onsails/lspkind-nvim' Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' +Plug 'sindrets/diffview.nvim' Plug 'kyazdani42/nvim-web-devicons' " for file icons "Plug 'kyazdani42/nvim-tree.lua' @@ -260,7 +261,7 @@ nnoremap gy lua vim.lsp.buf.type_definition() nnoremap K lua vim.lsp.buf.hover() nnoremap gs lua vim.lsp.buf.signature_help() nnoremap gR lua vim.lsp.buf.rename() -"nnoremap gr lua vim.lsp.buf.references() +nnoremap gr lua vim.lsp.buf.references() nnoremap gr lua require('telescope.builtin').lsp_references({initial_mode = "normal"}) nnoremap g0 lua vim.lsp.buf.document_symbol() nnoremap gW lua vim.lsp.buf.workspace_symbol() From d10da3b71a23fc578d83218357b3dd87a3c44e6c Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 7 Feb 2022 12:14:24 -0800 Subject: [PATCH 004/126] fish path and add treesitter --- .config/fish/config.fish | 2 +- .vim/nvim.lua | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ .vimrc | 2 ++ 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/.config/fish/config.fish b/.config/fish/config.fish index a271bc3..649d657 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,4 +1,4 @@ -set PATH ~/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin $PATH +set PATH ~/bin ~/.local/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin $PATH set fish_greeting "" set EDITOR vi diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 6d6f7ae..3246572 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -256,6 +256,60 @@ local dropdown = require'telescope.themes'.get_dropdown({ --winblend = 10 }) +-- +-- Treesitter +-- + +require'nvim-treesitter.configs'.setup { + -- One of "all", "maintained" (parsers with maintainers), or a list of languages + ensure_installed = { + "c", + "rust", + "python", + "go", + "javascript", + "typescript", + "markdown", + "fish", + "css", + "json", + "lua", + "make", + "svelte", + "vim", + "yaml", + }, + + -- Install languages synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- List of parsers to ignore installing + -- ignore_install = { "javascript" }, + + highlight = { + -- `false` will disable the whole extension + enable = true, + + -- list of language that will be disabled + disable = { "c", "rust" }, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, + + indent = { + enable = true + }, +} + + +-- +-- Helper functions for my own grepping commands. +-- + live_grep_repo = function(conf) --local opt = dropdown local opt = { @@ -275,6 +329,9 @@ git_grep_word = function(conf) end +--- +--- My own "where" clause generator for Rust +--- function string.insert(str1, str2, pos) return str1:sub(1,pos)..str2..str1:sub(pos+1) end diff --git a/.vimrc b/.vimrc index 651f0a7..58df56e 100644 --- a/.vimrc +++ b/.vimrc @@ -223,6 +223,8 @@ Plug 'folke/trouble.nvim' Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'kristijanhusak/defx-icons' +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + "Plug 'ggandor/lightspeed.nvim' Plug 'justinmk/vim-sneak' From 15dc08f81a7976eb413f45581f4801ec495f0d98 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Fri, 11 Feb 2022 13:11:24 -0800 Subject: [PATCH 005/126] treesitter playground --- .vim/nvim.lua | 40 +++++++++++++++++++++++++++++++++------- .vimrc | 1 + 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 3246572..6bba63a 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -152,7 +152,12 @@ vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) require('lspkind').init({ -- disables text annotations --with_text = false, - with_text = true, + --with_text = true, + + -- defines how annotations are shown + -- default: symbol + -- options: 'text', 'text_symbol', 'symbol_text', 'symbol' + mode = 'symbol', -- default symbol map -- can be either 'default' or 'codicons' @@ -264,18 +269,20 @@ require'nvim-treesitter.configs'.setup { -- One of "all", "maintained" (parsers with maintainers), or a list of languages ensure_installed = { "c", - "rust", - "python", + "cpp", + "css", + "fish", "go", "javascript", - "typescript", - "markdown", - "fish", - "css", "json", "lua", "make", + "markdown", + "python", + "query", + "rust", "svelte", + "typescript", "vim", "yaml", }, @@ -303,6 +310,25 @@ require'nvim-treesitter.configs'.setup { indent = { enable = true }, + + playground = { + enable = true, + disable = {}, + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code + persist_queries = false, -- Whether the query persists across vim sessions + keybindings = { + toggle_query_editor = 'o', + toggle_hl_groups = 'i', + toggle_injected_languages = 't', + toggle_anonymous_nodes = 'a', + toggle_language_display = 'I', + focus_language = 'f', + unfocus_language = 'F', + update = 'R', + goto_node = '', + show_help = '?', + }, + } } diff --git a/.vimrc b/.vimrc index 58df56e..8962fd5 100644 --- a/.vimrc +++ b/.vimrc @@ -224,6 +224,7 @@ Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'kristijanhusak/defx-icons' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} +Plug 'nvim-treesitter/playground' "Plug 'ggandor/lightspeed.nvim' Plug 'justinmk/vim-sneak' From d2210226d8db288cf9b7c05325d82d2049ef880d Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Sun, 13 Feb 2022 15:22:47 -0800 Subject: [PATCH 006/126] fallback fish loading --- .config/fish/conf.d/virtualfish-loader.fish | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.config/fish/conf.d/virtualfish-loader.fish b/.config/fish/conf.d/virtualfish-loader.fish index 1bfbcb8..43dc4c0 100644 --- a/.config/fish/conf.d/virtualfish-loader.fish +++ b/.config/fish/conf.d/virtualfish-loader.fish @@ -1,4 +1,12 @@ set -g VIRTUALFISH_VERSION 2.5.4 set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python3 -source /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish -emit virtualfish_did_setup_plugins \ No newline at end of file +if test -e /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish + source /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish +else if test -e /usr/local/lib/python3.9/site-packages/virtualfish/virtual.fish + source /usr/local/lib/python3.9/site-packages/virtualfish/virtual.fish +else if test -e /usr/lib/python3.9/site-packages/virtualfish/virtual.fish + source /usr/lib/python3.9/site-packages/virtualfish/virtual.fish +else if test -e /usr/lib/python3.10/site-packages/virtualfish/virtual.fish + source /usr/lib/python3.10/site-packages/virtualfish/virtual.fish +end +emit virtualfish_did_setup_plugins From 1b9408c46e2a080af1efca230cc6efe1e042214c Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Tue, 8 Mar 2022 14:36:17 -0800 Subject: [PATCH 007/126] add some fish configs --- .config/fish/completions/cargo.fish | 802 ++++++++++ .config/fish/completions/git.fish | 2162 ++++++++++++++++++++++++++ .config/fish/completions/go.fish | 174 +++ .config/fish/completions/nc.fish | 12 + .config/fish/completions/nc.openbsd.fish | 1 + .config/fish/completions/nc.traditional.fish | 1 + .config/fish/completions/ncat.fish | 74 + .config/fish/completions/netcat.fish | 12 + 8 files changed, 3238 insertions(+) create mode 100644 .config/fish/completions/cargo.fish create mode 100644 .config/fish/completions/git.fish create mode 100644 .config/fish/completions/go.fish create mode 100644 .config/fish/completions/nc.fish create mode 100644 .config/fish/completions/nc.openbsd.fish create mode 100644 .config/fish/completions/nc.traditional.fish create mode 100644 .config/fish/completions/ncat.fish create mode 100644 .config/fish/completions/netcat.fish diff --git a/.config/fish/completions/cargo.fish b/.config/fish/completions/cargo.fish new file mode 100644 index 0000000..3c1f8c5 --- /dev/null +++ b/.config/fish/completions/cargo.fish @@ -0,0 +1,802 @@ +# Tab completion for cargo (https://github.com/rust-lang/cargo). + +## --- WRITTEN MANUALLY --- +set -l __fish_cargo_subcommands (cargo --list 2>&1 | string replace -rf '^\s+([^\s]+)\s*(.*)' '$1\t$2' | string escape) + +complete -c cargo -f -c cargo -n __fish_use_subcommand -a "$__fish_cargo_subcommands" +complete -c cargo -x -c cargo -n '__fish_seen_subcommand_from help' -a "$__fish_cargo_subcommands" + +for x in bench b build rustc t test + complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bench -a "(cargo bench --bench 2>&1 | string replace -rf '^\s+' '')" + complete -c cargo -n "__fish_seen_subcommand_from $x" -l lib -d 'Only this package\'s library' + complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l test -a "(cargo test --test 2>&1 | string replace -rf '^\s+' '')" +end + +for x in bench b build r run rustc t test + complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bin -a "(cargo run --bin 2>&1 | string replace -rf '^\s+' '')" + complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l example -a "(cargo run --example 2>&1 | string replace -rf '^\s+' '')" +end + +function __fish_cargo_packages + find . -name Cargo.toml | string replace -rf '.*/([^/]+)/?Cargo.toml' '$1' +end +complete -c cargo -n '__fish_seen_subcommand_from run test build debug check' -l package \ + -xa "(__fish_cargo_packages)" + +## --- AUTO-GENERATED WITH `cargo complete fish` --- +complete -c cargo -n __fish_use_subcommand -l explain -d 'Run `rustc --explain CODE`' +complete -c cargo -n __fish_use_subcommand -l color -d 'Coloring: auto, always, never' +complete -c cargo -n __fish_use_subcommand -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n __fish_use_subcommand -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n __fish_use_subcommand -s V -l version -d 'Print version info and exit' +complete -c cargo -n __fish_use_subcommand -l list -d 'List installed commands' +complete -c cargo -n __fish_use_subcommand -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n __fish_use_subcommand -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n __fish_use_subcommand -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n __fish_use_subcommand -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n __fish_use_subcommand -l offline -d 'Run without accessing the network' +complete -c cargo -n __fish_use_subcommand -s h -l help -d 'Prints help information' +complete -c cargo -n __fish_use_subcommand -f -a bench -d 'Execute all benchmarks of a local package' +complete -c cargo -n __fish_use_subcommand -f -a build -d 'Compile a local package and all of its dependencies' +complete -c cargo -n __fish_use_subcommand -f -a check -d 'Check a local package and all of its dependencies for errors' +complete -c cargo -n __fish_use_subcommand -f -a clean -d 'Remove artifacts that cargo has generated in the past' +complete -c cargo -n __fish_use_subcommand -f -a complete -d 'Generate completion file for a shell' +complete -c cargo -n __fish_use_subcommand -f -a describe-future-incompatibilities -d 'Reports any crates which will eventually stop compiling' +complete -c cargo -n __fish_use_subcommand -f -a doc -d 'Build a package\'s documentation' +complete -c cargo -n __fish_use_subcommand -f -a fetch -d 'Fetch dependencies of a package from the network' +complete -c cargo -n __fish_use_subcommand -f -a fix -d 'Automatically fix lint warnings reported by rustc' +complete -c cargo -n __fish_use_subcommand -f -a generate-lockfile -d 'Generate the lockfile for a package' +complete -c cargo -n __fish_use_subcommand -f -a git-checkout -d 'This subcommand has been removed' +complete -c cargo -n __fish_use_subcommand -f -a init -d 'Create a new cargo package in an existing directory' +complete -c cargo -n __fish_use_subcommand -f -a install -d 'Install a Rust binary. Default location is $HOME/.cargo/bin' +complete -c cargo -n __fish_use_subcommand -f -a locate-project -d 'Print a JSON representation of a Cargo.toml file\'s location' +complete -c cargo -n __fish_use_subcommand -f -a login -d 'Save an api token from the registry locally. If token is not specified, it will be read from stdin.' +complete -c cargo -n __fish_use_subcommand -f -a logout -d 'Remove an API token from the registry locally' +complete -c cargo -n __fish_use_subcommand -f -a metadata -d 'Output the resolved dependencies of a package, the concrete used versions including overrides, in machine-readable format' +complete -c cargo -n __fish_use_subcommand -f -a new -d 'Create a new cargo package at ' +complete -c cargo -n __fish_use_subcommand -f -a owner -d 'Manage the owners of a crate on the registry' +complete -c cargo -n __fish_use_subcommand -f -a package -d 'Assemble the local package into a distributable tarball' +complete -c cargo -n __fish_use_subcommand -f -a pkgid -d 'Print a fully qualified package specification' +complete -c cargo -n __fish_use_subcommand -f -a publish -d 'Upload a package to the registry' +complete -c cargo -n __fish_use_subcommand -f -a read-manifest -d 'Print a JSON representation of a Cargo.toml manifest. + +Deprecated, use `cargo metadata --no-deps` instead.' +complete -c cargo -n __fish_use_subcommand -f -a run -d 'Run a binary or example of the local package' +complete -c cargo -n __fish_use_subcommand -f -a rustc -d 'Compile a package, and pass extra options to the compiler' +complete -c cargo -n __fish_use_subcommand -f -a rustdoc -d 'Build a package\'s documentation, using specified custom flags.' +complete -c cargo -n __fish_use_subcommand -f -a search -d 'Search packages in crates.io' +complete -c cargo -n __fish_use_subcommand -f -a test -d 'Execute all unit and integration tests and build examples of a local package' +complete -c cargo -n __fish_use_subcommand -f -a tree -d 'Display a tree visualization of a dependency graph' +complete -c cargo -n __fish_use_subcommand -f -a uninstall -d 'Remove a Rust binary' +complete -c cargo -n __fish_use_subcommand -f -a update -d 'Update dependencies as recorded in the local lock file' +complete -c cargo -n __fish_use_subcommand -f -a vendor -d 'Vendor all dependencies for a project locally' +complete -c cargo -n __fish_use_subcommand -f -a verify-project -d 'Check correctness of crate manifest' +complete -c cargo -n __fish_use_subcommand -f -a version -d 'Show version information' +complete -c cargo -n __fish_use_subcommand -f -a yank -d 'Remove a pushed crate from the index' +complete -c cargo -n __fish_use_subcommand -f -a help -d 'Prints this message or the help of the given subcommand(s)' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l bin -d 'Benchmark only the specified binary' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l example -d 'Benchmark only the specified example' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l test -d 'Benchmark only the specified test target' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l bench -d 'Benchmark only the specified bench target' +complete -c cargo -n "__fish_seen_subcommand_from bench" -s p -l package -d 'Package to run benchmarks for' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l exclude -d 'Exclude packages from the benchmark' +complete -c cargo -n "__fish_seen_subcommand_from bench" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l target -d 'Build for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l message-format -d 'Error format' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from bench" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from bench" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l lib -d 'Benchmark only this package\'s library' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l bins -d 'Benchmark all binaries' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l examples -d 'Benchmark all examples' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l tests -d 'Benchmark all tests' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l benches -d 'Benchmark all benches' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l all-targets -d 'Benchmark all targets' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l no-run -d 'Compile, but don\'t run benchmarks' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l all -d 'Alias for --workspace (deprecated)' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l workspace -d 'Benchmark all packages in the workspace' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l no-fail-fast -d 'Run all benchmarks regardless of failure' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l unit-graph -d 'Output build graph in JSON (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from bench" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from bench" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from bench" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from bench" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from build" -s p -l package -d 'Package to build (see `cargo help pkgid`)' +complete -c cargo -n "__fish_seen_subcommand_from build" -l exclude -d 'Exclude packages from the build' +complete -c cargo -n "__fish_seen_subcommand_from build" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from build" -l bin -d 'Build only the specified binary' +complete -c cargo -n "__fish_seen_subcommand_from build" -l example -d 'Build only the specified example' +complete -c cargo -n "__fish_seen_subcommand_from build" -l test -d 'Build only the specified test target' +complete -c cargo -n "__fish_seen_subcommand_from build" -l bench -d 'Build only the specified bench target' +complete -c cargo -n "__fish_seen_subcommand_from build" -l profile -d 'Build artifacts with the specified profile' +complete -c cargo -n "__fish_seen_subcommand_from build" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from build" -l target -d 'Build for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from build" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from build" -l out-dir -d 'Copy final artifacts to this directory (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from build" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from build" -l message-format -d 'Error format' +complete -c cargo -n "__fish_seen_subcommand_from build" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from build" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from build" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from build" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from build" -l all -d 'Alias for --workspace (deprecated)' +complete -c cargo -n "__fish_seen_subcommand_from build" -l workspace -d 'Build all packages in the workspace' +complete -c cargo -n "__fish_seen_subcommand_from build" -l lib -d 'Build only this package\'s library' +complete -c cargo -n "__fish_seen_subcommand_from build" -l bins -d 'Build all binaries' +complete -c cargo -n "__fish_seen_subcommand_from build" -l examples -d 'Build all examples' +complete -c cargo -n "__fish_seen_subcommand_from build" -l tests -d 'Build all tests' +complete -c cargo -n "__fish_seen_subcommand_from build" -l benches -d 'Build all benches' +complete -c cargo -n "__fish_seen_subcommand_from build" -l all-targets -d 'Build all targets' +complete -c cargo -n "__fish_seen_subcommand_from build" -l release -d 'Build artifacts in release mode, with optimizations' +complete -c cargo -n "__fish_seen_subcommand_from build" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from build" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from build" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from build" -l build-plan -d 'Output the build plan in JSON (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from build" -l unit-graph -d 'Output build graph in JSON (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from build" -l future-incompat-report -d 'Ouputs a future incompatibility report at the end of the build (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from build" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from build" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from build" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from build" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from build" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from build" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from check" -s p -l package -d 'Package(s) to check' +complete -c cargo -n "__fish_seen_subcommand_from check" -l exclude -d 'Exclude packages from the check' +complete -c cargo -n "__fish_seen_subcommand_from check" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from check" -l bin -d 'Check only the specified binary' +complete -c cargo -n "__fish_seen_subcommand_from check" -l example -d 'Check only the specified example' +complete -c cargo -n "__fish_seen_subcommand_from check" -l test -d 'Check only the specified test target' +complete -c cargo -n "__fish_seen_subcommand_from check" -l bench -d 'Check only the specified bench target' +complete -c cargo -n "__fish_seen_subcommand_from check" -l profile -d 'Check artifacts with the specified profile' +complete -c cargo -n "__fish_seen_subcommand_from check" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from check" -l target -d 'Check for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from check" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from check" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from check" -l message-format -d 'Error format' +complete -c cargo -n "__fish_seen_subcommand_from check" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from check" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from check" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from check" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from check" -l all -d 'Alias for --workspace (deprecated)' +complete -c cargo -n "__fish_seen_subcommand_from check" -l workspace -d 'Check all packages in the workspace' +complete -c cargo -n "__fish_seen_subcommand_from check" -l lib -d 'Check only this package\'s library' +complete -c cargo -n "__fish_seen_subcommand_from check" -l bins -d 'Check all binaries' +complete -c cargo -n "__fish_seen_subcommand_from check" -l examples -d 'Check all examples' +complete -c cargo -n "__fish_seen_subcommand_from check" -l tests -d 'Check all tests' +complete -c cargo -n "__fish_seen_subcommand_from check" -l benches -d 'Check all benches' +complete -c cargo -n "__fish_seen_subcommand_from check" -l all-targets -d 'Check all targets' +complete -c cargo -n "__fish_seen_subcommand_from check" -l release -d 'Check artifacts in release mode, with optimizations' +complete -c cargo -n "__fish_seen_subcommand_from check" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from check" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from check" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from check" -l unit-graph -d 'Output build graph in JSON (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from check" -l future-incompat-report -d 'Ouputs a future incompatibility report at the end of the build (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from check" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from check" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from check" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from check" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from check" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from check" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from clean" -s p -l package -d 'Package to clean artifacts for' +complete -c cargo -n "__fish_seen_subcommand_from clean" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from clean" -l target -d 'Target triple to clean output for' +complete -c cargo -n "__fish_seen_subcommand_from clean" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from clean" -l profile -d 'Clean artifacts of the specified profile' +complete -c cargo -n "__fish_seen_subcommand_from clean" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from clean" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from clean" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from clean" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from clean" -l release -d 'Whether or not to clean release artifacts' +complete -c cargo -n "__fish_seen_subcommand_from clean" -l doc -d 'Whether or not to clean just the documentation directory' +complete -c cargo -n "__fish_seen_subcommand_from clean" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from clean" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from clean" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from clean" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from clean" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from clean" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from complete" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from complete" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from complete" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from complete" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from complete" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from complete" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from complete" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from complete" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from complete" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l id -d 'identifier of the report [generated by a Cargo command invocation' +complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from doc" -s p -l package -d 'Package to document' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l exclude -d 'Exclude packages from the build' +complete -c cargo -n "__fish_seen_subcommand_from doc" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l bin -d 'Document only the specified binary' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l profile -d 'Build artifacts with the specified profile' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l target -d 'Build for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l message-format -d 'Error format' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from doc" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from doc" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l open -d 'Opens the docs in a browser after the operation' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l all -d 'Alias for --workspace (deprecated)' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l workspace -d 'Document all packages in the workspace' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l no-deps -d 'Don\'t build documentation for dependencies' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l document-private-items -d 'Document private items' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l lib -d 'Document only this package\'s library' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l bins -d 'Document all binaries' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l release -d 'Build artifacts in release mode, with optimizations' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l unit-graph -d 'Output build graph in JSON (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from doc" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from doc" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from doc" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from doc" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -l target -d 'Fetch dependencies for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from fetch" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from fix" -s p -l package -d 'Package(s) to fix' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l exclude -d 'Exclude packages from the fixes' +complete -c cargo -n "__fish_seen_subcommand_from fix" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l bin -d 'Fix only the specified binary' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l example -d 'Fix only the specified example' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l test -d 'Fix only the specified test target' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l bench -d 'Fix only the specified bench target' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l profile -d 'Build artifacts with the specified profile' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l target -d 'Fix for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l message-format -d 'Error format' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from fix" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from fix" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l all -d 'Alias for --workspace (deprecated)' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l workspace -d 'Fix all packages in the workspace' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l lib -d 'Fix only this package\'s library' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l bins -d 'Fix all binaries' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l examples -d 'Fix all examples' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l tests -d 'Fix all tests' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l benches -d 'Fix all benches' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l all-targets -d 'Fix all targets (default)' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l release -d 'Fix artifacts in release mode, with optimizations' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l broken-code -d 'Fix code even if it already has compiler errors' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l edition -d 'Fix in preparation for the next edition' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l edition-idioms -d 'Fix warnings to migrate to the idioms of an edition' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l allow-no-vcs -d 'Fix code even if a VCS was not detected' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l allow-dirty -d 'Fix code even if the working directory is dirty' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l allow-staged -d 'Fix code even if the working directory has staged changes' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from fix" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from fix" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from fix" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from fix" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from init" -l registry -d 'Registry to use' +complete -c cargo -n "__fish_seen_subcommand_from init" -l vcs -d 'Initialize a new repository for the given version control system (git, hg, pijul, or fossil) or do not initialize any version control at all (none), overriding a global configuration.' -r -f -a "git hg pijul fossil none" +complete -c cargo -n "__fish_seen_subcommand_from init" -l edition -d 'Edition to set for the crate generated' -r -f -a "2015 2018 2021" +complete -c cargo -n "__fish_seen_subcommand_from init" -l name -d 'Set the resulting package name, defaults to the directory name' +complete -c cargo -n "__fish_seen_subcommand_from init" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from init" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from init" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from init" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from init" -l bin -d 'Use a binary (application) template [default]' +complete -c cargo -n "__fish_seen_subcommand_from init" -l lib -d 'Use a library template' +complete -c cargo -n "__fish_seen_subcommand_from init" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from init" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from init" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from init" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from init" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from init" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from install" -l version -d 'Specify a version to install' +complete -c cargo -n "__fish_seen_subcommand_from install" -l git -d 'Git URL to install the specified crate from' +complete -c cargo -n "__fish_seen_subcommand_from install" -l branch -d 'Branch to use when installing from git' +complete -c cargo -n "__fish_seen_subcommand_from install" -l tag -d 'Tag to use when installing from git' +complete -c cargo -n "__fish_seen_subcommand_from install" -l rev -d 'Specific commit to use when installing from git' +complete -c cargo -n "__fish_seen_subcommand_from install" -l path -d 'Filesystem path to local crate to install' +complete -c cargo -n "__fish_seen_subcommand_from install" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from install" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from install" -l profile -d 'Install artifacts with the specified profile' +complete -c cargo -n "__fish_seen_subcommand_from install" -l bin -d 'Install only the specified binary' +complete -c cargo -n "__fish_seen_subcommand_from install" -l example -d 'Install only the specified example' +complete -c cargo -n "__fish_seen_subcommand_from install" -l target -d 'Build for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from install" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from install" -l root -d 'Directory to install packages into' +complete -c cargo -n "__fish_seen_subcommand_from install" -l index -d 'Registry index to install from' +complete -c cargo -n "__fish_seen_subcommand_from install" -l registry -d 'Registry to use' +complete -c cargo -n "__fish_seen_subcommand_from install" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from install" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from install" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from install" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from install" -l list -d 'list all installed packages and their versions' +complete -c cargo -n "__fish_seen_subcommand_from install" -s f -l force -d 'Force overwriting existing crates or binaries' +complete -c cargo -n "__fish_seen_subcommand_from install" -l no-track -d 'Do not save tracking information' +complete -c cargo -n "__fish_seen_subcommand_from install" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from install" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from install" -l debug -d 'Build in debug mode instead of release mode' +complete -c cargo -n "__fish_seen_subcommand_from install" -l bins -d 'Install all binaries' +complete -c cargo -n "__fish_seen_subcommand_from install" -l examples -d 'Install all examples' +complete -c cargo -n "__fish_seen_subcommand_from install" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from install" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from install" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from install" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from install" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l message-format -d 'Output representation [possible values: json, plain]' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l workspace -d 'Locate Cargo.toml of the workspace root' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from login" -l host -d 'Host to set the token for' +complete -c cargo -n "__fish_seen_subcommand_from login" -l registry -d 'Registry to use' +complete -c cargo -n "__fish_seen_subcommand_from login" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from login" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from login" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from login" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from login" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from login" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from login" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from login" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from login" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from login" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from logout" -l registry -d 'Registry to use' +complete -c cargo -n "__fish_seen_subcommand_from logout" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from logout" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from logout" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from logout" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from logout" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from logout" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from logout" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from logout" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from logout" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from logout" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l filter-platform -d 'Only include resolve dependencies matching the given target-triple' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l format-version -d 'Format version' -r -f -a 1 +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -s q -l quiet -d 'Do not print cargo log messages' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l no-deps -d 'Output information only about the workspace members and don\'t fetch dependencies' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from metadata" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from new" -l registry -d 'Registry to use' +complete -c cargo -n "__fish_seen_subcommand_from new" -l vcs -d 'Initialize a new repository for the given version control system (git, hg, pijul, or fossil) or do not initialize any version control at all (none), overriding a global configuration.' -r -f -a "git hg pijul fossil none" +complete -c cargo -n "__fish_seen_subcommand_from new" -l edition -d 'Edition to set for the crate generated' -r -f -a "2015 2018 2021" +complete -c cargo -n "__fish_seen_subcommand_from new" -l name -d 'Set the resulting package name, defaults to the directory name' +complete -c cargo -n "__fish_seen_subcommand_from new" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from new" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from new" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from new" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from new" -l bin -d 'Use a binary (application) template [default]' +complete -c cargo -n "__fish_seen_subcommand_from new" -l lib -d 'Use a library template' +complete -c cargo -n "__fish_seen_subcommand_from new" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from new" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from new" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from new" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from new" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from new" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from owner" -s a -l add -d 'Name of a user or team to invite as an owner' +complete -c cargo -n "__fish_seen_subcommand_from owner" -s r -l remove -d 'Name of a user or team to remove as an owner' +complete -c cargo -n "__fish_seen_subcommand_from owner" -l index -d 'Registry index to modify owners for' +complete -c cargo -n "__fish_seen_subcommand_from owner" -l token -d 'API token to use when authenticating' +complete -c cargo -n "__fish_seen_subcommand_from owner" -l registry -d 'Registry to use' +complete -c cargo -n "__fish_seen_subcommand_from owner" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from owner" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from owner" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from owner" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from owner" -s l -l list -d 'List owners of a crate' +complete -c cargo -n "__fish_seen_subcommand_from owner" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from owner" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from owner" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from owner" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from owner" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from owner" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from package" -l target -d 'Build for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from package" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from package" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from package" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from package" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from package" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from package" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from package" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from package" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from package" -s l -l list -d 'Print files included in a package without making one' +complete -c cargo -n "__fish_seen_subcommand_from package" -l no-verify -d 'Don\'t verify the contents by building them' +complete -c cargo -n "__fish_seen_subcommand_from package" -l no-metadata -d 'Ignore warnings about a lack of human-usable metadata' +complete -c cargo -n "__fish_seen_subcommand_from package" -l allow-dirty -d 'Allow dirty working directories to be packaged' +complete -c cargo -n "__fish_seen_subcommand_from package" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from package" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from package" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from package" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from package" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from package" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from package" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from package" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s p -l package -d 'Argument to get the package ID specifier for' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l index -d 'Registry index URL to upload the package to' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l host -d 'DEPRECATED, renamed to \'--index\'' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l token -d 'Token to use when uploading' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l target -d 'Build for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from publish" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l registry -d 'Registry to publish to' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from publish" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from publish" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l no-verify -d 'Don\'t verify the contents by building them' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l allow-dirty -d 'Allow dirty working directories to be packaged' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l dry-run -d 'Perform all checks without uploading' +complete -c cargo -n "__fish_seen_subcommand_from publish" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from publish" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from publish" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from publish" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from run" -l bin -d 'Name of the bin target to run' +complete -c cargo -n "__fish_seen_subcommand_from run" -l example -d 'Name of the example target to run' +complete -c cargo -n "__fish_seen_subcommand_from run" -s p -l package -d 'Package with the target to run' +complete -c cargo -n "__fish_seen_subcommand_from run" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from run" -l profile -d 'Build artifacts with the specified profile' +complete -c cargo -n "__fish_seen_subcommand_from run" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from run" -l target -d 'Build for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from run" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from run" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from run" -l message-format -d 'Error format' +complete -c cargo -n "__fish_seen_subcommand_from run" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from run" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from run" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from run" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from run" -l release -d 'Build artifacts in release mode, with optimizations' +complete -c cargo -n "__fish_seen_subcommand_from run" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from run" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from run" -l unit-graph -d 'Output build graph in JSON (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from run" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from run" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from run" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from run" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from run" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from run" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from run" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -s p -l package -d 'Package to build' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l bin -d 'Build only the specified binary' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l example -d 'Build only the specified example' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l test -d 'Build only the specified test target' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l bench -d 'Build only the specified bench target' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l profile -d 'Build artifacts with the specified profile' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l target -d 'Target triple which compiles will be for' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l print -d 'Output compiler information without compiling' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l message-format -d 'Error format' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l lib -d 'Build only this package\'s library' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l bins -d 'Build all binaries' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l examples -d 'Build all examples' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l tests -d 'Build all tests' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l benches -d 'Build all benches' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l all-targets -d 'Build all targets' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l release -d 'Build artifacts in release mode, with optimizations' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l unit-graph -d 'Output build graph in JSON (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l future-incompat-report -d 'Ouputs a future incompatibility report at the end of the build (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from rustc" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s p -l package -d 'Package to document' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l bin -d 'Build only the specified binary' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l example -d 'Build only the specified example' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l test -d 'Build only the specified test target' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l bench -d 'Build only the specified bench target' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l profile -d 'Build artifacts with the specified profile' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l target -d 'Build for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l message-format -d 'Error format' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l open -d 'Opens the docs in a browser after the operation' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l lib -d 'Build only this package\'s library' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l bins -d 'Build all binaries' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l examples -d 'Build all examples' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l tests -d 'Build all tests' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l benches -d 'Build all benches' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l all-targets -d 'Build all targets' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l release -d 'Build artifacts in release mode, with optimizations' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l unit-graph -d 'Output build graph in JSON (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from search" -l index -d 'Registry index URL to upload the package to' +complete -c cargo -n "__fish_seen_subcommand_from search" -l host -d 'DEPRECATED, renamed to \'--index\'' +complete -c cargo -n "__fish_seen_subcommand_from search" -l limit -d 'Limit the number of results (default: 10, max: 100)' +complete -c cargo -n "__fish_seen_subcommand_from search" -l registry -d 'Registry to use' +complete -c cargo -n "__fish_seen_subcommand_from search" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from search" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from search" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from search" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from search" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from search" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from search" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from search" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from search" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from search" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from test" -l bin -d 'Test only the specified binary' +complete -c cargo -n "__fish_seen_subcommand_from test" -l example -d 'Test only the specified example' +complete -c cargo -n "__fish_seen_subcommand_from test" -l test -d 'Test only the specified test target' +complete -c cargo -n "__fish_seen_subcommand_from test" -l bench -d 'Test only the specified bench target' +complete -c cargo -n "__fish_seen_subcommand_from test" -s p -l package -d 'Package to run tests for' +complete -c cargo -n "__fish_seen_subcommand_from test" -l exclude -d 'Exclude packages from the test' +complete -c cargo -n "__fish_seen_subcommand_from test" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs' +complete -c cargo -n "__fish_seen_subcommand_from test" -l profile -d 'Build artifacts with the specified profile' +complete -c cargo -n "__fish_seen_subcommand_from test" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from test" -l target -d 'Build for the target triple' +complete -c cargo -n "__fish_seen_subcommand_from test" -l target-dir -d 'Directory for all generated artifacts' +complete -c cargo -n "__fish_seen_subcommand_from test" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from test" -l message-format -d 'Error format' +complete -c cargo -n "__fish_seen_subcommand_from test" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from test" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from test" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from test" -s q -l quiet -d 'Display one character per test instead of one line' +complete -c cargo -n "__fish_seen_subcommand_from test" -l lib -d 'Test only this package\'s library unit tests' +complete -c cargo -n "__fish_seen_subcommand_from test" -l bins -d 'Test all binaries' +complete -c cargo -n "__fish_seen_subcommand_from test" -l examples -d 'Test all examples' +complete -c cargo -n "__fish_seen_subcommand_from test" -l tests -d 'Test all tests' +complete -c cargo -n "__fish_seen_subcommand_from test" -l benches -d 'Test all benches' +complete -c cargo -n "__fish_seen_subcommand_from test" -l all-targets -d 'Test all targets' +complete -c cargo -n "__fish_seen_subcommand_from test" -l doc -d 'Test only this library\'s documentation' +complete -c cargo -n "__fish_seen_subcommand_from test" -l no-run -d 'Compile, but don\'t run tests' +complete -c cargo -n "__fish_seen_subcommand_from test" -l no-fail-fast -d 'Run all tests regardless of failure' +complete -c cargo -n "__fish_seen_subcommand_from test" -l all -d 'Alias for --workspace (deprecated)' +complete -c cargo -n "__fish_seen_subcommand_from test" -l workspace -d 'Test all packages in the workspace' +complete -c cargo -n "__fish_seen_subcommand_from test" -l release -d 'Build artifacts in release mode, with optimizations' +complete -c cargo -n "__fish_seen_subcommand_from test" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from test" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from test" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from test" -l unit-graph -d 'Output build graph in JSON (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from test" -l future-incompat-report -d 'Ouputs a future incompatibility report at the end of the build (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from test" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from test" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from test" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from test" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from test" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from test" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from tree" -s p -l package -d 'Package to be used as the root of the tree' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l exclude -d 'Exclude specific workspace members' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l features -d 'Space or comma separated list of features to activate' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l target -d 'Filter dependencies matching the given target-triple (default host platform). Pass `all` to include all targets.' +complete -c cargo -n "__fish_seen_subcommand_from tree" -s e -l edges -d 'The kinds of dependencies to display (features, normal, build, dev, all, no-dev, no-build, no-normal)' +complete -c cargo -n "__fish_seen_subcommand_from tree" -s i -l invert -d 'Invert the tree direction and focus on the given package' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l prefix -d 'Change the prefix (indentation) of how each entry is displayed' -r -f -a "depth indent none" +complete -c cargo -n "__fish_seen_subcommand_from tree" -l charset -d 'Character set to use in output: utf8, ascii' -r -f -a "utf8 ascii" +complete -c cargo -n "__fish_seen_subcommand_from tree" -s f -l format -d 'Format string used for printing dependencies' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from tree" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from tree" -s q -l quiet -d 'Suppress status messages' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l workspace -d 'Display the tree for all packages in the workspace' +complete -c cargo -n "__fish_seen_subcommand_from tree" -s a -l all +complete -c cargo -n "__fish_seen_subcommand_from tree" -l all-targets +complete -c cargo -n "__fish_seen_subcommand_from tree" -l all-features -d 'Activate all available features' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l no-default-features -d 'Do not activate the `default` feature' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l no-dev-dependencies +complete -c cargo -n "__fish_seen_subcommand_from tree" -l no-indent +complete -c cargo -n "__fish_seen_subcommand_from tree" -l prefix-depth +complete -c cargo -n "__fish_seen_subcommand_from tree" -l no-dedupe -d 'Do not de-duplicate (repeats all shared dependencies)' +complete -c cargo -n "__fish_seen_subcommand_from tree" -s d -l duplicates -d 'Show only dependencies which come in multiple versions (implies -i)' +complete -c cargo -n "__fish_seen_subcommand_from tree" -s V -l version +complete -c cargo -n "__fish_seen_subcommand_from tree" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from tree" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from tree" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s p -l package -d 'Package to uninstall' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l bin -d 'Only uninstall the binary NAME' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l root -d 'Directory to uninstall packages from' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from update" -s p -l package -d 'Package to update' +complete -c cargo -n "__fish_seen_subcommand_from update" -l precise -d 'Update a single dependency to exactly PRECISE when used with -p' +complete -c cargo -n "__fish_seen_subcommand_from update" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from update" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from update" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from update" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from update" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from update" -s w -l workspace -d 'Only update the workspace packages' +complete -c cargo -n "__fish_seen_subcommand_from update" -l aggressive -d 'Force updating all dependencies of SPEC as well when used with -p' +complete -c cargo -n "__fish_seen_subcommand_from update" -l dry-run -d 'Don\'t actually write the lockfile' +complete -c cargo -n "__fish_seen_subcommand_from update" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from update" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from update" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from update" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from update" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from update" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -s s -l sync -d 'Additional `Cargo.toml` to sync and vendor' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l no-delete -d 'Don\'t delete older crates in the vendor directory' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l respect-source-config -d 'Respect `[source]` config in `.cargo/config`' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l versioned-dirs -d 'Always include version in subdir name' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l no-merge-sources +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l relative-path +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l only-git-deps +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l disallow-duplicates +complete -c cargo -n "__fish_seen_subcommand_from vendor" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from vendor" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l manifest-path -d 'Path to Cargo.toml' +complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from verify-project" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from verify-project" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from verify-project" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from verify-project" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from verify-project" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from version" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from version" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from version" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from version" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from version" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from version" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from version" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from version" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from version" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from version" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from yank" -l vers -d 'The version to yank or un-yank' +complete -c cargo -n "__fish_seen_subcommand_from yank" -l index -d 'Registry index to yank from' +complete -c cargo -n "__fish_seen_subcommand_from yank" -l token -d 'API token to use when authenticating' +complete -c cargo -n "__fish_seen_subcommand_from yank" -l registry -d 'Registry to use' +complete -c cargo -n "__fish_seen_subcommand_from yank" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from yank" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from yank" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from yank" -s q -l quiet -d 'No output printed to stdout' +complete -c cargo -n "__fish_seen_subcommand_from yank" -l undo -d 'Undo a yank, putting a version back into the index' +complete -c cargo -n "__fish_seen_subcommand_from yank" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from yank" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from yank" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from yank" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from yank" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from yank" -l offline -d 'Run without accessing the network' +complete -c cargo -n "__fish_seen_subcommand_from help" -l color -d 'Coloring: auto, always, never' +complete -c cargo -n "__fish_seen_subcommand_from help" -l config -d 'Override a configuration value (unstable)' +complete -c cargo -n "__fish_seen_subcommand_from help" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' +complete -c cargo -n "__fish_seen_subcommand_from help" -s h -l help -d 'Prints help information' +complete -c cargo -n "__fish_seen_subcommand_from help" -s V -l version -d 'Prints version information' +complete -c cargo -n "__fish_seen_subcommand_from help" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)' +complete -c cargo -n "__fish_seen_subcommand_from help" -l frozen -d 'Require Cargo.lock and cache are up to date' +complete -c cargo -n "__fish_seen_subcommand_from help" -l locked -d 'Require Cargo.lock is up to date' +complete -c cargo -n "__fish_seen_subcommand_from help" -l offline -d 'Run without accessing the network' diff --git a/.config/fish/completions/git.fish b/.config/fish/completions/git.fish new file mode 100644 index 0000000..0fa768d --- /dev/null +++ b/.config/fish/completions/git.fish @@ -0,0 +1,2162 @@ +# fish completion for git + +# Use this instead of calling git directly; it passes the commands that are +# already present on the commandline to git. This is relevant for --work-tree etc, see issue #6219. +function __fish_git + set -l saved_args $argv + set -l global_args + set -l cmd (commandline -opc) + # We assume that git is the first command until we have a better awareness of subcommands, see #2705. + set -e cmd[1] + if argparse -s (__fish_git_global_optspecs) -- $cmd 2>/dev/null + # All arguments that were parsed by argparse are global git options. + set -l num_global_args (math (count $cmd) - (count $argv)) + if test $num_global_args -ne 0 + set global_args $cmd[1..$num_global_args] + end + end + # Using 'command git' to avoid interactions for aliases from git to (e.g.) hub + # Using eval to expand ~ and variables specified on the commandline. + eval command git $global_args \$saved_args 2>/dev/null +end + +# Print an optspec for argparse to handle git's options that are independent of any subcommand. +function __fish_git_global_optspecs + string join \n v-version h/help C= c=+ 'e-exec-path=?' H-html-path M-man-path I-info-path p/paginate \ + P/no-pager o-no-replace-objects b-bare G-git-dir= W-work-tree= N-namespace= S-super-prefix= \ + l-literal-pathspecs g-glob-pathspecs O-noglob-pathspecs i-icase-pathspecs +end + +function __fish_git_commits + # Complete commits with their subject line as the description + # This allows filtering by subject with the new pager! + # Because even subject lines can be quite long, + # trim them (abbrev'd hash+tab+subject) to 73 characters + # + # Hashes we just truncate ourselves to 10 characters, without disambiguating. + # That technically means that sometimes we don't give usable SHAs, + # but according to https://stackoverflow.com/a/37403152/3150338, + # that happens for 3 commits out of 600k. + # For fish, at the time of writing, out of 12200 commits, 7 commits need 8 characters. + # And since this takes about 1/3rd of the time that disambiguating takes... + __fish_git log --pretty=tformat:"%H"\t"%<(64,trunc)%s" --all --max-count=1000 2>/dev/null \ + | string replace -r '^([0-9a-f]{10})[0-9a-f]*\t(.*)' '$1\t$2' +end + +function __fish_git_recent_commits + # Like __fish_git_commits, but not on all branches and limited to + # the last 50 commits. Used for fixup, where only the current branch + # and the latest commits make sense. + __fish_git log --pretty=tformat:"%h"\t"%<(64,trunc)%s" --max-count=50 $argv 2>/dev/null +end + +function __fish_git_branches + # This is much faster than using `git branch`, + # and avoids having to deal with localized "detached HEAD" messages. + __fish_git for-each-ref --format='%(refname)' refs/heads/ refs/remotes/ 2>/dev/null \ + | string replace -r '^refs/heads/(.*)$' '$1\tLocal Branch' \ + | string replace -r '^refs/remotes/(.*)$' '$1\tRemote Branch' +end + +function __fish_git_submodules + __fish_git submodule 2>/dev/null \ + | string replace -r '^.[^ ]+ ([^ ]+).*$' '$1' +end + +function __fish_git_local_branches + __fish_git for-each-ref --format='%(refname:strip=2)' refs/heads/ 2>/dev/null \ + | string replace -rf '.*' '$0\tLocal Branch' +end + +function __fish_git_unique_remote_branches + # `git checkout` accepts remote branches without the remote part + # if they are unambiguous. + # E.g. if only alice has a "frobulate" branch + # `git checkout frobulate` is equivalent to `git checkout -b frobulate --track alice/frobulate`. + __fish_git for-each-ref --format="%(refname:strip=3)" \ + --sort="refname:strip=3" \ + "refs/remotes/*/$match*" "refs/remotes/*/*/**" 2>/dev/null | uniq -u +end + +function __fish_git_tags + __fish_git tag --sort=-creatordate 2>/dev/null +end + +function __fish_git_heads + set -l gitdir (__fish_git rev-parse --git-dir 2>/dev/null) + or return # No git dir, no need to even test. + for head in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD + if test -f $gitdir/$head + echo $head + end + end +end + +function __fish_git_refs + __fish_git_branches + __fish_git_tags + __fish_git_heads +end + +function __fish_git_remotes + __fish_git remote 2>/dev/null +end + +function __fish_git_files + # A function to show various kinds of files git knows about, + # by parsing `git status --porcelain`. + # + # This accepts arguments to denote the kind of files: + # - added: Staged added files (unstaged adds are untracked) + # - copied + # - deleted + # - deleted-staged + # - ignored + # - modified: Files that have been modified (but aren't staged) + # - modified-staged: Staged modified files + # - renamed + # - untracked + # and as a convenience "all-staged" + # to get _all_ kinds of staged files. + + # Save the repo root to remove it from the path later. + set -l root (__fish_git rev-parse --show-toplevel --is-bare-repository 2>/dev/null) + or return + + # Skip bare repositories. + test "$root[2]" = true + and return + or set -e root[2] + + # Cache the translated descriptions so we don't have to get it + # once per file. + contains -- all-staged $argv; and set -l all_staged + contains -- unmerged $argv; and set -l unmerged + and set -l unmerged_desc "Unmerged File" + contains -- added $argv; or set -ql all_staged; and set -l added + and set -l added_desc "Added file" + contains -- modified $argv; and set -l modified + and set -l modified_desc "Modified file" + contains -- untracked $argv; and set -l untracked + and set -l untracked_desc "Untracked file" + contains -- modified-staged $argv; or set -ql all_staged; and set -l modified_staged + and set -l staged_modified_desc "Staged modified file" + contains -- modified-staged-deleted $argv; or set -ql modified_staged; and set -l modified_staged_deleted + and set -l modified_staged_deleted_desc "Staged modified and deleted file" + contains -- deleted $argv; and set -l deleted + and set -l deleted_desc "Deleted file" + contains -- deleted-staged $argv; or set -ql all_staged; and set -l deleted_staged + and set -l staged_deleted_desc "Staged deleted file" + contains -- ignored $argv; and set -l ignored + and set -l ignored_desc "Ignored file" + contains -- renamed $argv; and set -l renamed + and set -l renamed_desc "Renamed file" + contains -- copied $argv; and set -l copied + and set -l copied_desc "Copied file" + + # A literal "?" for use in `case`. + set -l q '\\?' + if status test-feature qmark-noglob + set q '?' + end + set -l use_next + # git status --porcelain gives us all the info we need, in a format we don't. + # The v2 format has better documentation and doesn't use " " to denote anything, + # but it's only been added in git 2.11.0, which was released November 2016. + + # Also, we ignore submodules because they aren't useful as arguments (generally), + # and they slow things down quite significantly. + # E.g. `git reset $submodule` won't do anything (not even print an error). + # --ignore-submodules=all was added in git 1.7.2, released July 2010. + # + set -l status_opt --ignore-submodules=all + + # If we aren't looking for ignored files, let git status skip them. + # (don't use --ignored=no because that was only added in git 2.16, from Jan 2018. + set -q ignored; and set -a status_opt --ignored + + # If we're looking for untracked files, we give untracked files even inside untracked directories. + # This makes it nicer if e.g. you're in an untracked directory and want to just add one file. + set -q untracked; and set -a status_opt -uall + or set -a status_opt -uno + + # We need to set status.relativePaths to true because the porcelain v2 format still honors that, + # and core.quotePath to false so characters > 0x80 (i.e. non-ASCII) aren't considered special. + # We explicitly enable globs so we can use that to match the current token. + set -l git_opt -c status.relativePaths -c core.quotePath= + + # We pick the v2 format if we can, because it shows relative filenames (if used without "-z"). + # We fall back on the v1 format by reading git's _version_, because trying v2 first is too slow. + set -l ver (__fish_git --version | string replace -rf 'git version (\d+)\.(\d+)\.?.*' '$1\n$2') + # Version >= 2.11.* has the v2 format. + if test "$ver[1]" -gt 2 2>/dev/null; or test "$ver[1]" -eq 2 -a "$ver[2]" -ge 11 2>/dev/null + __fish_git $git_opt status --porcelain=2 $status_opt \ + | while read -la -d ' ' line + set -l file + set -l desc + # The basic status format is "XY", where X is "our" state (meaning the staging area), + # and "Y" is "their" state. + # A "." means it's unmodified. + switch "$line[1..2]" + case 'u *' + # Unmerged + # "Unmerged entries have the following format; the first character is a "u" to distinguish from ordinary changed entries." + # "u

" + # This is first to distinguish it from normal modifications et al. + set -ql unmerged + and set file "$line[11..-1]" + and set desc $unmerged_desc + case '2 .R*' '2 R.*' + # Renamed/Copied + # From the docs: "Renamed or copied entries have the following format:" + # "2 " + # Since is \t, we can't really parse it unambiguously. + # The "-z" format would be great here! + set -ql renamed + and set file (string replace -r '\t[^\t]*' '' -- "$line[10..-1]") + and set desc $renamed_desc + case '2 RM*' '2 RT*' + # Staged as renamed, with unstaged modifications (issue #6031) + set -ql renamed + or set -ql modified + and set file (string replace -r '\t[^\t]*' '' -- "$line[10..-1]") + set -ql renamed + and set desc $renamed_desc + set -ql modified + and set --append desc $modified_desc + case '2 RD*' + # Staged as renamed, but deleted in the worktree + set -ql renamed + or set -ql deleted + and set file (string replace -r '\t[^\t]*' '' -- "$line[10..-1]") + set -ql renamed + and set desc $renamed_desc + set -ql deleted + and set --append desc $deleted_desc + case '2 .C*' '2 C.*' + set -ql copied + and set file (string replace -r '\t[^\t].*' '' -- "$line[10..-1]") + and set desc $copied_desc + case '1 A.*' + # Additions are only shown here if they are staged. + # Otherwise it's an untracked file. + set -ql added + and set file "$line[9..-1]" + and set desc $added_desc + case '1 AD*' + # Added files that were since deleted + if set -ql added + set file "$line[9..-1]" + set desc $added_desc + else if set -ql deleted + set file "$line[9..-1]" + set desc $deleted_desc + end + case "1 AM*" "1 AT*" + # Added files with additional modifications + # ("T" is type-changed. As of git 2.33 this appears to be undocumented. + # it happens when e.g. a file is replaced with a symlink. + # For our purposes it's the same as modified) + if set -ql added + set file "$line[9..-1]" + set desc $added_desc + else if set -ql modified + set file "$line[9..-1]" + set desc $modified_desc + end + case '1 .A*' + # Files added with git add --intent-to-add. + set -ql untracked + and set file "$line[9..-1]" + and set desc $untracked_desc + case '1 .M*' '1 .T*' + # Modified + # From the docs: "Ordinary changed entries have the following format:" + # "1 " + # Since can contain spaces, print from element 9 onwards + set -ql modified + and set file "$line[9..-1]" + and set desc $modified_desc + case '1 MD*' '1 TD*' + set -ql modified_staged_deleted + and set file "$line[9..-1]" + and set desc $modified_staged_deleted_desc + case '1 M.*' '1 T.*' + # If the character is first ("M."), then that means it's "our" change, + # which means it is staged. + # This is useless for many commands - e.g. `checkout` won't do anything with this. + # So it needs to be requested explicitly. + set -ql modified_staged + and set file "$line[9..-1]" + and set desc $staged_modified_desc + case '1 MM*' '1 MT*' '1 TM*' '1 TT*' + # Staged-modified with unstaged modifications + # These need to be offered for both kinds of modified. + if set -ql modified + set file "$line[9..-1]" + set desc $modified_desc + else if set -ql modified_staged + set file "$line[9..-1]" + set desc $staged_modified_desc + end + case '1 .D*' + set -ql deleted + and set file "$line[9..-1]" + and set desc $deleted_desc + case '1 D.*' + # TODO: The docs are unclear on this. + # There is both X unmodified and Y either M or D ("not updated") + # and Y is D and X is unmodified or [MARC] ("deleted in work tree"). + # For our purposes, we assume this is a staged deletion. + set -ql deleted_staged + and set file "$line[9..-1]" + and set desc $staged_deleted_desc + case "$q"' *' + # Untracked + # "? " - print from element 2 on. + set -ql untracked + and set file "$line[2..-1]" + and set desc $untracked_desc + case '! *' + # Ignored + # "! " - print from element 2 on. + set -ql ignored + and set file "$line[2..-1]" + and set desc $ignored_desc + end + # Only try printing if the file was selected. + if set -q file[1] + for d in $desc + # Without "-z", git sometimes _quotes_ filenames. + # It adds quotes around it _and_ escapes the character. + # e.g. `"a\\b"`. + # We just remove the quotes and hope it works out. + # If this contains newlines or tabs, + # there is nothing we can do, but that's a general issue with scripted completions. + set file (string trim -c \" -- $file) + # First the relative filename. + printf '%s\t%s\n' "$file" $d + # Now from repo root. + # Only do this if the filename isn't a simple child, + # or the current token starts with ":" + if string match -q '../*' -- $file + or string match -q ':*' -- (commandline -ct) + set -l fromroot (builtin realpath -- $file 2>/dev/null) + and set fromroot (string replace -- "$root/" ":/" "$fromroot") + and printf '%s\t%s\n' "$fromroot" $d + end + end + end + end + else + # v1 format logic + # We need to compute relative paths on our own, which is slow. + # Pre-remove the root at least, so we have fewer components to deal with. + set -l _pwd_list (string replace "$root/" "" -- $PWD/ | string split /) + test -z "$_pwd_list[-1]"; and set -e _pwd_list[-1] + # Cache the previous relative path because these are sorted, so we can reuse it + # often for files in the same directory. + set -l previous + # Note that we can't use space as a delimiter between status and filename, because + # the status can contain spaces - " M" is different from "M ". + __fish_git $git_opt status --porcelain -z $status_opt \ + | while read -lz -d' ' line + set -l desc + # The entire line is the "from" from a rename. + if set -q use_next[1] + if contains -- $use_next $argv + set -l var "$use_next"_desc + set desc $$var + set -e use_next[1] + else + set -e use_next[1] + continue + end + end + + # The format is two characters for status, then a space and then + # up to a NUL for the filename. + # + set -l stat (string sub -l 2 -- $line) + # The basic status format is "XY", where X is "our" state (meaning the staging area), + # and "Y" is "their" state (meaning the work tree). + # A " " means it's unmodified. + # + # Be careful about the ordering here! + switch "$stat" + case DD AU UD UA DU AA UU + # Unmerged + set -ql unmerged + and set desc $unmerged_desc + case 'R ' RM RD + # Renamed/Copied + # These have the "from" name as the next batch. + # TODO: Do we care about the new name? + set use_next renamed + continue + case 'C ' CM CD + set use_next copied + continue + case AM + if set -ql added + set file "$line[9..-1]" + set desc $added_desc + else if set -ql modified + set file "$line[9..-1]" + set desc $modified_desc + end + case AD + if set -ql added + set file "$line[9..-1]" + set desc $added_desc + else if set -ql deleted + set file "$line[9..-1]" + set desc $deleted_desc + end + case 'A ' + # Additions are only shown here if they are staged. + # Otherwise it's an untracked file. + set -ql added + and set desc $added_desc + case '*M' + # Modified + set -ql modified + and set desc $modified_desc + case 'M*' + # If the character is first ("M "), then that means it's "our" change, + # which means it is staged. + # This is useless for many commands - e.g. `checkout` won't do anything with this. + # So it needs to be requested explicitly. + set -ql modified_staged + and set desc $staged_modified_desc + case '*D' + set -ql deleted + and set desc $deleted_desc + case 'D*' + # TODO: The docs are unclear on this. + # There is both X unmodified and Y either M or D ("not updated") + # and Y is D and X is unmodified or [MARC] ("deleted in work tree"). + # For our purposes, we assume this is a staged deletion. + set -ql deleted_staged + and set desc $staged_deleted_desc + case "$q$q" + # Untracked + set -ql untracked + and set desc $untracked_desc + case '!!' + # Ignored + set -ql ignored + and set desc $ignored_desc + end + if set -q desc[1] + # Again: "XY filename", so the filename starts on character 4. + set -l relfile (string sub -s 4 -- $line) + + set -l file + # Computing relative path by hand. + set -l abs (string split / -- $relfile) + # If it's in the same directory, we just need to change the filename. + if test "$abs[1..-2]" = "$previous[1..-2]" + # If we didn't have a previous file, and the current file is in the current directory, + # this would error out. + # + # See #5728. + set -q previous[1] + and set previous[-1] $abs[-1] + or set previous $abs + else + set -l pwd_list $_pwd_list + # Remove common prefix + while test "$pwd_list[1]" = "$abs[1]" + set -e pwd_list[1] + set -e abs[1] + end + # Go a dir up for every entry left in pwd_list, then into $abs + set previous (string replace -r '.*' '..' -- $pwd_list) $abs + end + set -a file (string join / -- $previous) + + # The filename with ":/" prepended. + if string match -q '../*' -- $file + or string match -q ':*' -- (commandline -ct) + set file (string replace -- "$root/" ":/" "$root/$relfile") + end + + if test "$root/$relfile" = (pwd -P)/$relfile + set file $relfile + end + + printf '%s\n' $file\t$desc + end + end + end +end + +# Lists files included in the index of a commit, branch, or tag (not necessarily HEAD) +function __fish_git_rev_files + set -l rev $argv[1] + set -l path $argv[2] + + # Strip any partial files from the path before handing it to `git show` + set -l path (string replace -r -- '(.*/|).*' '$1' $path) + + # List files in $rev's index, skipping the "tree ..." header, but appending + # the parent path, which git does not include in the output (and fish requires) + printf "$path%s\n" (git show $rev:$path | sed '1,2d') +end + +# Provides __fish_git_rev_files completions for the current token +function __fish_git_complete_rev_files + set -l split (string split -m 1 ":" (commandline -ot)) + set -l rev $split[1] + set -l path $split[2] + + printf "$rev:%s\n" (__fish_git_rev_files $rev $path) +end + +# Determines whether we can/should complete with __fish_git_rev_files +function __fish_git_needs_rev_files + # git (as of 2.20) accepts the rev:path syntax for a number of subcommands, + # but then doesn't emit the expected (or any?) output, e.g. `git log master:foo` + # + # This definitely works with `git show` to retrieve a copy of a file as it exists + # in the index of revision $rev, it should be updated to include others as they + # are identified. + __fish_git_using_command show; and string match -r "^[^-].*:" -- (commandline -ot) +end + +function __fish_git_ranges + set -l both (commandline -ot | string replace -r '\.{2,3}' \n\$0\n) + set -l from $both[1] + set -l dots $both[2] + # If we didn't need to split (or there's nothing _to_ split), complete only the first part + # Note that status here is from `string replace` because `set` doesn't alter it + if test -z "$from" -o $status -gt 0 + if commandline -ct | string match -q '*..*' + # The cursor is right of a .. range operator, make sure to include them first. + __fish_git_refs | string replace -r '' "$dots" + else + __fish_git_refs | string replace \t "$dots"\t + end + return 0 + end + + set -l from_refs + if commandline -ct | string match -q '*..*' + # If the cursor is right of a .. range operator, only complete the right part. + set from_refs $from + else + set from_refs (__fish_git_refs | string match -e "$from" | string replace -r \t'.*$' '') + end + + set -l to $both[3] + # Remove description from the from-ref, not the to-ref. + for from_ref in $from_refs + for to_ref in (__fish_git_refs | string match "*$to*") # if $to is empty, this correctly matches everything + printf "%s%s%s\n" $from_ref $dots $to_ref + end + end +end + +function __fish_git_needs_command + # Figure out if the current invocation already has a command. + set -l cmd (commandline -opc) + set -e cmd[1] + argparse -s (__fish_git_global_optspecs) -- $cmd 2>/dev/null + or return 0 + # These flags function as commands, effectively. + set -q _flag_version; and return 1 + set -q _flag_html_path; and return 1 + set -q _flag_man_path; and return 1 + set -q _flag_info_path; and return 1 + if set -q argv[1] + # Also print the command, so this can be used to figure out what it is. + echo $argv[1] + return 1 + end + return 0 +end + +function __fish_git_config_keys + # Print already defined config values first + # Config keys may span multiple lines, so parse using null char + # With -z, key and value are separated by space, not "=" + __fish_git config -lz | while read -lz key value + # Print only first line of value(with an ellipsis) if multiline + printf '%s\t%s\n' $key (string replace \n …\n -- $value)[1] + end + # Print all recognized config keys; duplicates are not shown twice by fish + printf '%s\n' (__fish_git help --config)[1..-2] # Last line is a footer; ignore it +end + +# HACK: Aliases +# Git allows aliases, so we need to see what command the current command-token corresponds to +# (so we can complete e.g. `lg` like `log`). +# Checking `git config` for a lot of aliases can be quite slow if it is called +# for every possible command. +# Ideally, we'd `complete --wraps` this, but that is not currently possible, as is +# using `complete -C` like +# complete -c git -n '__fish_git_using_command lg' -a '(complete -C"git log ")' +# +# So instead, we store the aliases in global variables, named after the alias, containing the command. +# This is because alias:command is an n:1 mapping (an alias can only have one corresponding command, +# but a command can be aliased multiple times) + +# Approximately duplicates the logic from https://github.com/git/git/blob/d486ca60a51c9cb1fe068803c3f540724e95e83a/contrib/completion/git-completion.bash#L1130 +# The Git script also finds aliases that reference other aliases via a loop but this is fine for a PoC +function __fish_git_aliased_command + for word in (string split ' ' -- $argv) + switch $word + case !gitk gitk + echo gitk + return + # Adding " to the list + case '!*' '-*' '*=*' git '()' '{' : '\'*' '"*' + continue + case '*' + echo $word + return + end + end +end + +git config -z --get-regexp 'alias\..*' | while read -lz alias cmdline + set -l command (__fish_git_aliased_command $cmdline) + string match -q --regex '\w+' -- $command; or continue + # Git aliases can contain chars that variable names can't - escape them. + set -l alias (string replace 'alias.' '' -- $alias | string escape --style=var) + set -g __fish_git_alias_$alias $command +end + +function __fish_git_using_command + set -l cmd (__fish_git_needs_command) + test -z "$cmd" + and return 1 + contains -- $cmd $argv + and return 0 + + # Check aliases. + set -l varname __fish_git_alias_(string escape --style=var -- $cmd) + set -q $varname + and contains -- $$varname $argv + and return 0 + return 1 +end + +function __fish_git_stash_using_command + set -l cmd (commandline -opc) + __fish_git_using_command stash + or return 2 + # The word after the stash command _must_ be the subcommand + set cmd $cmd[(contains -i -- "stash" $cmd)..-1] + set -e cmd[1] + set -q cmd[1] + or return 1 + contains -- $cmd[1] $argv + and return 0 + return 1 +end + +function __fish_git_stash_not_using_subcommand + set -l cmd (commandline -opc) + __fish_git_using_command stash + or return 2 + set cmd $cmd[(contains -i -- "stash" $cmd)..-1] + set -q cmd[2] + and return 1 + return 0 +end + +function __fish_git_complete_worktrees + __fish_git worktree list --porcelain | string replace --regex --filter '^worktree\s*' '' +end + +function __fish_git_complete_stashes + __fish_git stash list --format=%gd:%gs 2>/dev/null | string replace ":" \t +end + +function __fish_git_aliases + __fish_git config -z --get-regexp '^alias\.' 2>/dev/null | while read -lz key value + begin + set -l name (string replace -r '^.*\.' '' -- $key) + # Only use the first line of the value as the description. + set -l val (printf '%s\n' $value)[1] + printf "%s\t%s\n" $name "Alias for $val" + end + end +end + +function __fish_git_custom_commands + # complete all commands starting with git- + # however, a few builtin commands are placed into $PATH by git because + # they're used by the ssh transport. We could filter them out by checking + # if any of these completion results match the name of the builtin git commands, + # but it's simpler just to blacklist these names. They're unlikely to change, + # and the failure mode is we accidentally complete a plumbing command. + for name in (string replace -r "^.*/git-([^/]*)" '$1' $PATH/git-*) + switch $name + case cvsserver receive-pack shell upload-archive upload-pack + # skip these + case \* + echo $name + end + end +end + +# Suggest branches for the specified remote - returns 1 if no known remote is specified +function __fish_git_branch_for_remote + set -l remotes (__fish_git_remotes) + set -l remote + set -l cmd (commandline -opc) + for r in $remotes + if contains -- $r $cmd + set remote $r + break + end + end + set -q remote[1] + or return 1 + __fish_git_branches | string replace -f -- "$remote/" '' +end + +# Return 0 if the current token is a possible commit-hash with at least 3 characters +function __fish_git_possible_commithash + set -q argv[1] + and set -l token $argv[1] + or set -l token (commandline -ct) + if string match -qr '^[0-9a-fA-F]{3,}$' -- $token + return 0 + end + return 1 +end + +function __fish_git_reflog + __fish_git reflog --no-decorate 2>/dev/null | string replace -r '[0-9a-f]* (.+@\{[0-9]+\}): (.*)$' '$1\t$2' +end + +function __fish_git_help_all_concepts + git help -g | string match -e -r '^ \w+' | while read -l concept desc + printf "%s\tConcept: %s\n" $concept (string trim $desc) + end +end + +function __fish_git_diff_opt -a option + switch $option + case diff-algorithm + printf "%b" " +default\tBasic greedy diff algorithm +myers\tBasic greedy diff algorithm +minimal\tMake smallest diff possible +patience\tPatience diff algorithm +histogram\tPatience algorithm with low-occurrence common elements" + case diff-filter + printf "%b" " +A\tAdded files +C\tCopied files +D\tDeleted files +M\tModified files +R\tRenamed files +T\tType changed files +U\tUnmerged files +X\tUnknown files +B\tBroken pairing files" + case dirstat + printf "%b" " +changes\tCount lines that have been removed from the source / added to the destination +lines\tRegular line-based diff analysis +files\tCount the number of files changed +cumulative\tCount changes in a child directory for the parent directory as well" + case ignore-submodules + printf "%b" " +none\tUntracked/modified files +untracked\tNot considered dirty when they only contain untracked content +dirty\tIgnore all changes to the work tree of submodules +all\tHide all changes to submodules (default)" + case submodule + printf "%b" " +short\tShow the name of the commits at the beginning and end of the range +log\tList the commits in the range +diff\tShow an inline diff of the changes" + case ws-error-highlight + printf "%b" " +context\tcontext lines of the diff +old\told lines of the diff +new\tnew lines of the diff +none\treset previous values +default\treset the list to 'new' +all\tShorthand for 'old,new,context'" + end +end + +function __fish_git_show_opt -a option + switch $option + case format pretty + printf "%b" " +oneline\t +short\t<sha1> / <author> / <title line> +medium\t<sha1> / <author> / <author date> / <title> / <commit msg> +full\t<sha1> / <author> / <committer> / <title> / <commit msg> +fuller\t<sha1> / <author> / <author date> / <committer> / <committer date> / <title> / <commit msg> +email\t<sha1> <date> / <author> / <author date> / <title> / <commit msg> +raw\tShow the entire commit exactly as stored in the commit object +format:\tSpecify which information to show" + end +end + +function __fish_git_is_rebasing + test -e (__fish_git rev-parse --absolute-git-dir)/rebase-merge +end + +# general options +complete -f -c git -l help -d 'Display the manual of a git command' +complete -f -c git -n __fish_git_needs_command -l version -d 'Display version' +complete -x -c git -n __fish_git_needs_command -s C -a '(__fish_complete_directories)' -d 'Run as if git was started in this directory' +complete -x -c git -n __fish_git_needs_command -s c -a '(__fish_git config -l 2>/dev/null | string replace = \t)' -d 'Set a configuration option' +complete -x -c git -n __fish_git_needs_command -l exec-path -a '(__fish_complete_directories)' -d 'Get or set the path to the git programs' +complete -f -c git -n __fish_git_needs_command -l html-path -d 'Print the path to the html documentation' +complete -f -c git -n __fish_git_needs_command -l man-path -d 'Print the path to the man documentation' +complete -f -c git -n __fish_git_needs_command -l info-path -d 'Print the path to the info documentation' +complete -f -c git -n __fish_git_needs_command -s p -l paginate -d 'Pipe output into a pager' +complete -f -c git -n __fish_git_needs_command -l no-pager -d 'Do not pipe output into a pager' +complete -r -c git -n __fish_git_needs_command -l git-dir -d 'Set the path to the repository' +complete -r -c git -n __fish_git_needs_command -l work-tree -d 'Set the path to the working tree' +complete -f -c git -n __fish_git_needs_command -l namespace -d 'Set the namespace' +complete -f -c git -n __fish_git_needs_command -l bare -d 'Treat the repository as bare' +complete -f -c git -n __fish_git_needs_command -l no-replace-objects -d 'Do not use replacement refs to replace git objects' +complete -f -c git -n __fish_git_needs_command -l literal-pathspecs -d 'Treat pathspecs literally' +complete -f -c git -n __fish_git_needs_command -l glob-pathspecs -d 'Treat pathspecs as globs' +complete -f -c git -n __fish_git_needs_command -l noglob-pathspecs -d "Don't treat pathspecs as globs" +complete -f -c git -n __fish_git_needs_command -l icase-pathspecs -d 'Match pathspecs case-insensitively' + +# Options shared between multiple commands +complete -f -c git -n '__fish_git_using_command log show diff-tree rev-list' -l pretty -a '(__fish_git_show_opt pretty)' + +complete -c git -n '__fish_git_using_command diff show range-diff' -l abbrev -d 'Show only a partial prefix instead of the full 40-byte hexadecimal object name' +complete -c git -n '__fish_git_using_command diff show range-diff' -l binary -d 'Output a binary diff that can be applied with "git-apply"' +complete -c git -n '__fish_git_using_command diff show range-diff' -l check -d 'Warn if changes introduce conflict markers or whitespace errors' +complete -c git -n '__fish_git_using_command diff show range-diff' -l color -d 'Show colored diff' +complete -c git -n '__fish_git_using_command diff show range-diff' -l color-moved -d 'Moved lines of code are colored differently' +complete -c git -n '__fish_git_using_command diff show range-diff' -l color-words -d 'Equivalent to --word-diff=color plus --word-diff-regex=<regex>' +complete -c git -n '__fish_git_using_command diff show range-diff' -l compact-summary -d 'Output a condensed summary of extended header information' +complete -c git -n '__fish_git_using_command diff show range-diff log' -l dst-prefix -d 'Show the given destination prefix instead of "b/"' +complete -c git -n '__fish_git_using_command diff show range-diff' -l ext-diff -d 'Allow an external diff helper to be executed' +complete -c git -n '__fish_git_using_command diff show range-diff' -l find-copies-harder -d 'Inspect unmodified files as candidates for the source of copy' +complete -c git -n '__fish_git_using_command diff show range-diff' -l find-object -d 'Look for differences that change the number of occurrences of the object' +complete -c git -n '__fish_git_using_command diff show range-diff' -l full-index -d 'Show the full pre- and post-image blob object names on the "index" line' +complete -c git -n '__fish_git_using_command diff show range-diff' -l histogram -d 'Generate a diff using the "histogram diff" algorithm' +complete -c git -n '__fish_git_using_command diff show range-diff' -l ignore-blank-lines -d 'Ignore changes whose lines are all blank' +complete -c git -n '__fish_git_using_command diff show range-diff' -l ignore-cr-at-eol -d 'Ignore carrige-return at the end of line when doing a comparison' +complete -c git -n '__fish_git_using_command diff show range-diff' -l ignore-space-at-eol -d 'Ignore changes in whitespace at EOL' +complete -c git -n '__fish_git_using_command diff show range-diff' -l indent-heuristic -d 'Enable the heuristic that shift diff hunk boundaries' +complete -c git -n '__fish_git_using_command diff show range-diff log' -l inter-hunk-context -d 'Show the context between diff hunks, up to the specified number of lines' +complete -c git -n '__fish_git_using_command diff show range-diff log' -l ita-invisible-in-index -d 'Make the entry appear as a new file in "git diff" and non-existent in "git diff -l cached"' +complete -c git -n '__fish_git_using_command diff show range-diff log' -l line-prefix -d 'Prepend an additional prefix to every line of output' +complete -c git -n '__fish_git_using_command diff show range-diff' -l minimal -d 'Spend extra time to make sure the smallest possible diff is produced' +complete -c git -n '__fish_git_using_command diff show range-diff' -l name-only -d 'Show only names of changed files' +complete -c git -n '__fish_git_using_command diff show range-diff' -l name-status -d 'Show only names and status of changed files' +complete -c git -n '__fish_git_using_command diff show range-diff' -l no-color -d 'Turn off colored diff' +complete -c git -n '__fish_git_using_command diff show range-diff' -l no-ext-diff -d 'Disallow external diff drivers' +complete -c git -n '__fish_git_using_command diff show range-diff' -l no-indent-heuristic -d 'Disable the indent heuristic' +complete -c git -n '__fish_git_using_command diff show range-diff log' -l no-prefix -d 'Do not show any source or destination prefix' +complete -c git -n '__fish_git_using_command diff show range-diff' -l no-renames -d 'Turn off rename detection' +complete -c git -n '__fish_git_using_command diff show range-diff' -l no-textconv -d 'Disallow external text conversion filters to be run when comparing binary files' +complete -c git -n '__fish_git_using_command diff show range-diff' -l numstat -d 'Shows number of added/deleted lines in decimal notation' +complete -c git -n '__fish_git_using_command diff show range-diff' -l patch-with-raw -d 'Synonym for -p --raw' +complete -c git -n '__fish_git_using_command diff show range-diff' -l patch-with-stat -d 'Synonym for -p --stat' +complete -c git -n '__fish_git_using_command diff show range-diff' -l patience -d 'Generate a diff using the "patience diff" algorithm' +complete -c git -n '__fish_git_using_command diff show range-diff log' -l pickaxe-all -d 'When -S or -G finds a change, show all the changes in that changeset' +complete -c git -n '__fish_git_using_command diff show range-diff log' -l pickaxe-regex -d 'Treat the <string> given to -S as an extended POSIX regular expression to match' +complete -c git -n '__fish_git_using_command diff show range-diff log' -l relative -d 'Exclude changes outside the directory and show relative pathnames' +complete -c git -n '__fish_git_using_command diff show range-diff' -l shortstat -d 'Output only the last line of the --stat format containing total number of modified files' +complete -c git -n '__fish_git_using_command diff show range-diff log' -l src-prefix -d 'Show the given source prefix instead of "a/"' +complete -c git -n '__fish_git_using_command diff show range-diff' -l stat -d 'Generate a diffstat' +complete -c git -n '__fish_git_using_command diff show range-diff apply' -l stat -d 'Generate a diffstat' +complete -c git -n '__fish_git_using_command diff show range-diff' -l summary -d 'Output a condensed summary of extended header information' +complete -c git -n '__fish_git_using_command diff show range-diff' -l textconv -d 'Allow external text conversion filters to be run when comparing binary files' +complete -c git -n '__fish_git_using_command diff show range-diff' -l word-diff -d 'Show a word diff' +complete -c git -n '__fish_git_using_command diff show range-diff' -l word-diff-regex -d 'Use <regex> to decide what a word is' +complete -c git -n '__fish_git_using_command diff show range-diff log' -s a -l text -d 'Treat all files as text' +complete -c git -n '__fish_git_using_command diff show range-diff log' -s B -l break-rewrites -d 'Break complete rewrite changes into pairs of delete and create' +complete -c git -n '__fish_git_using_command diff show range-diff' -s b -l ignore-space-change -d 'Ignore changes in amount of whitespace' +complete -c git -n '__fish_git_using_command diff show range-diff log' -s C -l find-copies -d 'Detect copies as well as renames' +complete -c git -n '__fish_git_using_command diff show range-diff log' -s D -l irreversible-delete -d 'Omit the preimage for deletes' +complete -c git -n '__fish_git_using_command diff show range-diff log' -s G -d "Look for differences where <regex> matches the patch's added/removed lines" +complete -c git -n '__fish_git_using_command diff show range-diff log' -s M -l find-renames -d 'Detect and report renames' +complete -c git -n '__fish_git_using_command diff show range-diff log' -s R -d 'Swap inputs to create a reverse diff' +complete -c git -n '__fish_git_using_command diff show range-diff log' -s S -d 'Look for differences that change the number of occurrences of the string' +complete -c git -n '__fish_git_using_command diff show range-diff' -s W -l function-context -d 'Show whole surrounding functions of changes' +complete -c git -n '__fish_git_using_command diff show range-diff' -s w -l ignore-all-space -d 'Ignore whitespace when comparing lines' +complete -c git -n '__fish_git_using_command diff show range-diff' -s z -d 'Use NULs as output field/commit terminators' +complete -r -c git -n '__fish_git_using_command diff show range-diff log' -s O -d 'Control the order in which files appear in the output' +complete -f -c git -n '__fish_git_using_command diff show range-diff' -l anchored -d 'Generate a diff using the "anchored diff" algorithm' +complete -x -c git -n '__fish_git_using_command diff show range-diff log' -s l -d 'Prevents rename/copy detection when rename/copy targets exceed the given number' +complete -x -c git -n '__fish_git_using_command diff show range-diff' -l diff-filter -a '(__fish_git_diff_opt diff-filter)' -d 'Choose diff filters' +complete -x -c git -n '__fish_git_using_command diff log show range-diff' -l diff-algorithm -a '(__fish_git_diff_opt diff-algorithm)' -d 'Choose a diff algorithm' +complete -x -c git -n '__fish_git_using_command diff log show range-diff' -l dirstat -a '(__fish_git_diff_opt dirstat)' -d 'Output the distribution of relative amount of changes for each sub-directory' +complete -x -c git -n '__fish_git_using_command diff log show range-diff' -l ignore-submodules -a '(__fish_git_diff_opt ignore-submodules)' -d 'Ignore changes to submodules in the diff generation' +complete -x -c git -n '__fish_git_using_command diff log show range-diff' -l submodule -a '(__fish_git_diff_opt submodule)' -d 'Specify how differences in submodules are shown' +complete -x -c git -n '__fish_git_using_command diff log show range-diff' -l ws-error-highlight -a '(__fish_git_diff_opt ws-error-highlight)' -d 'Highlight whitespace errors in lines of the diff' + +#### fetch +complete -f -c git -n __fish_git_needs_command -a fetch -d 'Download objects and refs from another repository' +# Suggest "repository", then "refspec" - this also applies to e.g. push/pull +complete -f -c git -n '__fish_git_using_command fetch; and not __fish_git_branch_for_remote' -a '(__fish_git_remotes)' -d Remote +complete -f -c git -n '__fish_git_using_command fetch; and __fish_git_branch_for_remote' -a '(__fish_git_branch_for_remote)' +complete -f -c git -n '__fish_git_using_command fetch' -s q -l quiet -d 'Be quiet' +complete -f -c git -n '__fish_git_using_command fetch' -s v -l verbose -d 'Be verbose' +complete -f -c git -n '__fish_git_using_command fetch' -s a -l append -d 'Append ref names and object names' +# TODO --upload-pack +complete -f -c git -n '__fish_git_using_command fetch' -s f -l force -d 'Force update of local branches' +complete -f -c git -n '__fish_git_using_command fetch' -s p -l prune -d 'Remove remote-tracking references that no longer exist on the remote' +# TODO other options + +#### filter-branch +complete -f -c git -n __fish_git_needs_command -a filter-branch -d 'Rewrite branches' +complete -f -c git -n '__fish_git_using_command filter-branch' -l env-filter -d 'This filter may be used if you only need to modify the environment' +complete -f -c git -n '__fish_git_using_command filter-branch' -l tree-filter -d 'This is the filter for rewriting the tree and its contents' +complete -f -c git -n '__fish_git_using_command filter-branch' -l index-filter -d 'This is the filter for rewriting the index' +complete -f -c git -n '__fish_git_using_command filter-branch' -l parent-filter -d 'This is the filter for rewriting the commit' +complete -f -c git -n '__fish_git_using_command filter-branch' -l msg-filter -d 'This is the filter for rewriting the commit messages' +complete -f -c git -n '__fish_git_using_command filter-branch' -l commit-filter -d 'This is the filter for performing the commit' +complete -f -c git -n '__fish_git_using_command filter-branch' -l tag-name-filter -d 'This is the filter for rewriting tag names' +complete -f -c git -n '__fish_git_using_command filter-branch' -l subdirectory-filter -d 'Only look at the history which touches the given subdirectory' +complete -f -c git -n '__fish_git_using_command filter-branch' -l prune-empty -d 'Ignore empty commits generated by filters' +complete -f -c git -n '__fish_git_using_command filter-branch' -l original -d 'Use this option to set the namespace where the original commits will be stored' +complete -r -c git -n '__fish_git_using_command filter-branch' -s d -d 'Use this option to set the path to the temporary directory used for rewriting' +complete -c git -n '__fish_git_using_command filter-branch' -s f -l force -d 'Filter even with refs in refs/original or existing temp directory' + +### remote +set -l remotecommands add rm remove show prune update rename set-head set-url set-branches get-url +complete -f -c git -n __fish_git_needs_command -a remote -d 'Manage set of tracked repositories' +complete -f -c git -n '__fish_git_using_command remote' -a '(__fish_git_remotes)' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -s v -l verbose -d 'Be verbose' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -a add -d 'Adds a new remote' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -a rm -d 'Removes a remote' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -a remove -d 'Removes a remote' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -a show -d 'Shows a remote' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -a prune -d 'Deletes all stale tracking branches' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -a update -d 'Fetches updates' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -a rename -d 'Renames a remote' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -a set-head -d 'Sets the default branch for a remote' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -a set-url -d 'Changes URLs for a remote' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -a get-url -d 'Retrieves URLs for a remote' +complete -f -c git -n "__fish_git_using_command remote; and not __fish_seen_subcommand_from $remotecommands" -a set-branches -d 'Changes the list of branches tracked by a remote' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from add " -s f -d 'Once the remote information is set up git fetch <name> is run' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from add " -l tags -d 'Import every tag from a remote with git fetch <name>' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from add " -l no-tags -d "Don't import tags from a remote with git fetch <name>" +complete -f -c git -n '__fish_git_using_command remote; and __fish_seen_subcommand_from remove' -xa '(__fish_git_remotes)' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from set-branches" -l add -d 'Add to the list of currently tracked branches instead of replacing it' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from set-url" -l push -d 'Manipulate push URLs instead of fetch URLs' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from set-url" -l add -d 'Add new URL instead of changing the existing URLs' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from set-url" -l delete -d 'Remove URLs that match specified URL' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from get-url" -l push -d 'Query push URLs rather than fetch URLs' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from get-url" -l all -d 'All URLs for the remote will be listed' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from show" -s n -d 'Remote heads are not queried, cached information is used instead' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from prune" -l dry-run -d 'Report what will be pruned but do not actually prune it' +complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcommand_from update" -l prune -d 'Prune all remotes that are updated' + +### show +complete -f -c git -n __fish_git_needs_command -a show -d 'Shows the last commit of a branch' +complete -f -c git -n '__fish_git_using_command show; and not contains -- -- (commandline -opc)' -a '(__fish_git_branches)' +complete -f -c git -n '__fish_git_using_command show; and not contains -- -- (commandline -opc)' -ka '(__fish_git_tags)' -d Tag +complete -f -c git -n '__fish_git_using_command show; and not contains -- -- (commandline -opc)' -ka '(__fish_git_commits)' +complete -f -c git -n '__fish_git_needs_rev_files; and not contains -- -- (commandline -opc)' -xa '(__fish_git_complete_rev_files)' +complete -F -c git -n '__fish_git_using_command show; and contains -- -- (commandline -opc)' +complete -f -c git -n '__fish_git_using_command show' -l format -d 'Pretty-print the contents of the commit logs in a given format' -a '(__fish_git_show_opt format)' +complete -f -c git -n '__fish_git_using_command show' -l abbrev-commit -d 'Show only a partial hexadecimal commit object name' +complete -f -c git -n '__fish_git_using_command show' -l no-abbrev-commit -d 'Show the full 40-byte hexadecimal commit object name' +complete -f -c git -n '__fish_git_using_command show' -l oneline -d 'Shorthand for "--pretty=oneline --abbrev-commit"' +complete -f -c git -n '__fish_git_using_command show' -l encoding -d 'Re-code the commit log message in the encoding' +complete -f -c git -n '__fish_git_using_command show' -l expand-tabs -d 'Perform a tab expansion in the log message' +complete -f -c git -n '__fish_git_using_command show' -l no-expand-tabs -d 'Do not perform a tab expansion in the log message' +complete -f -c git -n '__fish_git_using_command show' -l notes -k -a '(__fish_git_refs)' -d 'Show the notes that annotate the commit' +complete -f -c git -n '__fish_git_using_command show' -l no-notes -d 'Do not show notes' +complete -f -c git -n '__fish_git_using_command show' -l show-signature -d 'Check the validity of a signed commit object' + + +### show-branch +complete -f -c git -n __fish_git_needs_command -a show-branch -d 'Shows the commits on branches' +complete -f -c git -n '__fish_git_using_command show-branch' -k -a '(__fish_git_refs)' -d Rev +# TODO options + +### add +complete -c git -n __fish_git_needs_command -a add -d 'Add file contents to the index' +complete -c git -n '__fish_git_using_command add' -s n -l dry-run -d "Don't actually add the file(s)" +complete -c git -n '__fish_git_using_command add' -s v -l verbose -d 'Be verbose' +complete -c git -n '__fish_git_using_command add' -s f -l force -d 'Allow adding otherwise ignored files' +complete -c git -n '__fish_git_using_command add' -s i -l interactive -d 'Interactive mode' +complete -c git -n '__fish_git_using_command add' -s p -l patch -d 'Interactively choose hunks to stage' +complete -c git -n '__fish_git_using_command add' -s e -l edit -d 'Manually create a patch' +complete -c git -n '__fish_git_using_command add' -s u -l update -d 'Only match tracked files' +complete -c git -n '__fish_git_using_command add' -s A -l all -d 'Match files both in working tree and index' +complete -c git -n '__fish_git_using_command add' -s N -l intent-to-add -d 'Record only the fact that the path will be added later' +complete -c git -n '__fish_git_using_command add' -l refresh -d "Don't add the file(s), but only refresh their stat" +complete -c git -n '__fish_git_using_command add' -l chmod -xa "-x\t'Track file as non-executable' +x\t'Track file as executable'" +complete -c git -n '__fish_git_using_command add' -l ignore-errors -d 'Ignore errors' +complete -c git -n '__fish_git_using_command add' -l ignore-missing -d 'Check if any of the given files would be ignored' +# Renames also show up as untracked + deleted, and to get git to show it as a rename _both_ need to be added. +# However, we can't do that as it is two tokens, so we don't need renamed here. +complete -f -c git -n '__fish_git_using_command add' -a '(__fish_git_files modified untracked deleted unmerged modified-staged-deleted)' +# TODO options + +### am +complete -c git -n __fish_git_needs_command -a am -d 'Apply a series of patches from a mailbox' +complete -f -c git -n '__fish_git_using_command am' -s s -l signoff -d 'Add a Signed-off-By trailer to commit message' +complete -f -c git -n '__fish_git_using_command am' -l keep-non-patch -d 'Only strip bracket pairs containing \'PATCH\'' +complete -f -c git -n '__fish_git_using_command am' -l no-keep-cr -d 'Override am.keepcr to false' +complete -f -c git -n '__fish_git_using_command am' -s c -l scissors -d 'Remove everything in body before scissors' +complete -f -c git -n '__fish_git_using_command am' -l no-scissors -d 'Ignore scissor lines' +complete -x -c git -n '__fish_git_using_command am' -l quoted-cr -a 'nowarn warn strip' -d 'What to do when an email ends with CRLF' +complete -f -c git -n '__fish_git_using_command am' -l no-messageid -d 'Do not add message id to commit message' +complete -f -c git -n '__fish_git_using_command am' -s q -l quiet -d 'Supress logs' +complete -f -c git -n '__fish_git_using_command am' -l no-utf8 -d 'Disable all charset re-encoding of metadata' +complete -f -c git -n '__fish_git_using_command am' -s 3 -l 3way -d 'Fall back to three way merge on patch failure' +complete -f -c git -n '__fish_git_using_command am' -l no-3way -d 'Do not fall back to three way merge on patch failure' +complete -f -c git -n '__fish_git_using_command am' -l rerere-autoupdate -d 'Allow rerere to update index if possible' +complete -f -c git -n '__fish_git_using_command am' -l ignore-space-change -d 'Pass --ignore-space-change to git apply' +complete -F -c git -n '__fish_git_using_command am' -l directory -d 'Pass --directory to git apply' +complete -F -c git -n '__fish_git_using_command am' -l exclude -d 'Pass --exclude to git apply' +complete -F -c git -n '__fish_git_using_command am' -l include -d 'Pass --include to git apply' +complete -f -c git -n '__fish_git_using_command am' -l reject -d 'Pass --reject to git apply' +complete -x -f git -n '__fish_git_using_command am' -l patch-format -a 'mbox mboxrd stgit stgit-series hg' -d 'Specify the patch format' +complete -f -c git -n '__fish_git_using_command am' -s i -l interactive -d 'Run interactively' +complete -f -c git -n '__fish_git_using_command am' -l commiter-date-is-author-date -d 'Treat commiter date as author date' +complete -f -c git -n '__fish_git_using_command am' -l ignore-date -d 'Treat author date as commiter date' +complete -f -c git -n '__fish_git_using_command am' -l skip -d 'Skip current patch' +complete -x -c git -n '__fish_git_using_command am' -s S -l gpg-sign -a '(type -q gpg && __fish_complete_gpg_key_id gpg)' -d 'Sign commits with gpg' +complete -f -c git -n '__fish_git_using_command am' -l no-gpg-sign -d 'Do not sign commits' +complete -f -c git -n '__fish_git_using_command am' -s r -l resolved -l continue -d 'Mark patch failures as resolved' +complete -x -c git -n '__fish_git_using_command am' -l resolvemsg -d 'Message to print after patch failure' +complete -f -c git -n '__fish_git_using_command am' -l abort -d 'Abort patch operation and restore branch' +complete -f -c git -n '__fish_git_using_command am' -l quit -d 'Abort without restoring branch' +complete -c git -n '__fish_git_using_command am' -l show-current-patch -a 'diff raw' -d 'Show message at which patch failures occured' + +### checkout +complete -F -c git -n '__fish_git_using_command checkout; and contains -- -- (commandline -opc)' +complete -f -c git -n __fish_git_needs_command -a checkout -d 'Checkout and switch to a branch' +complete -k -f -c git -n '__fish_git_using_command checkout; and not contains -- -- (commandline -opc)' -a '(__fish_git_tags)' -d Tag +complete -k -f -c git -n '__fish_git_using_command checkout; and not contains -- -- (commandline -opc)' -a '(__fish_git_heads)' -d Head +complete -k -f -c git -n '__fish_git_using_command checkout; and not contains -- -- (commandline -opc)' -a '(__fish_git_branches)' +complete -k -f -c git -n '__fish_git_using_command checkout; and not contains -- -- (commandline -opc)' -a '(__fish_git_unique_remote_branches)' -d 'Unique Remote Branch' +complete -k -f -c git -n '__fish_git_using_command checkout; and not contains -- -- (commandline -opc)' -a '(__fish_git_local_branches)' +complete -k -f -c git -n '__fish_git_using_command checkout; and not contains -- -- (commandline -opc)' -a '(__fish_git_recent_commits --all)' +complete -k -f -c git -n '__fish_git_using_command checkout' -a '(__fish_git_files modified deleted modified-staged-deleted)' +complete -f -c git -n '__fish_git_using_command checkout' -s b -d 'Create a new branch' +complete -f -c git -n '__fish_git_using_command checkout' -s t -l track -d 'Track a new branch' +complete -f -c git -n '__fish_git_using_command checkout' -l theirs -d 'Keep staged changes' +complete -f -c git -n '__fish_git_using_command checkout' -l ours -d 'Keep unmerged changes' +complete -f -c git -n '__fish_git_using_command checkout' -l recurse-submodules -d 'Update the work trees of submodules' +complete -f -c git -n '__fish_git_using_command checkout' -l no-recurse-submodules -d 'Do not update the work trees of submodules' +# TODO options + +### apply +complete -c git -n __fish_git_needs_command -a apply -d 'Apply a patch on a git index file and a working tree' +complete -f -c git -n '__fish_git_using_command apply' -l numstat -d 'Show number of additions and deletions' +complete -f -c git -n '__fish_git_using_command apply' -l summary -d 'Output a condensed summary' +complete -f -c git -n '__fish_git_using_command apply' -l check -d 'Just check if the patches can be applied' +complete -f -c git -n '__fish_git_using_command apply' -l index -d 'Apply patch to index and working tree' +complete -f -c git -n '__fish_git_using_command apply' -l cached -d 'Apply patch to index' +complete -f -c git -n '__fish_git_using_command apply' -l intent-to-add -d 'Add entry for file in index with no content' +complete -f -c git -n '__fish_git_using_command apply' -s 3 -l 3way -d 'Attempt a 3 way merge on conflicts' +complete -F -c git -n '__fish_git_using_command apply' -l build-fake-ancestor -d 'Build a temporary index containing these blobs' +complete -f -c git -n '__fish_git_using_command apply' -s R -l reverse -d 'Apply the patch in reverse' +complete -f -c git -n '__fish_git_using_command apply' -l reject -d 'Leave rejected hunks in *.rej files' +complete -f -c git -n '__fish_git_using_command apply; and __fish_contains_opt numstat' -s z -d 'Do not munge pathnames' +complete -x -c git -n '__fish_git_using_command apply am' -s p -d 'Remove n leading path components' +complete -x -c git -n '__fish_git_using_command apply am' -s C -d 'Ensure n that lines of surrounding context match' +complete -f -c git -n '__fish_git_using_command apply' -l unidiff-zero -d 'Do not break on diffs generated using --unified=0' +complete -f -c git -n '__fish_git_needs_command apply' -l apply -d 'Always apply patches' +complete -f -c git -n '__fish_git_using_command apply' -l no-add -d 'Ignore additions made by patches' +complete -f -c git -n '__fish_git_using_command apply' -l allow-binary-replacement -l binary -d 'Also patch binaries' +complete -F -c git -n '__fish_git_using_command apply' -l exclude -d 'Dont apply changes to files matching given pattern' +complete -F -c git -n '__fish_git_using_command apply' -l include -d 'Apply changes to files matching given pattern' +complete -f -c git -n '__fish_git_using_command apply am' -l ignore-space-change -l ignore-whitespace -d 'Ignore whitespace change in context lines' +complete -x -c git -n '__fish_git_using_command apply am' -l whitespace -a 'nowarn warn fix error error-all' -d 'Action to take when there are whitespace errors' +complete -f -c git -n '__fish_git_using_command apply' -l inaccurate-eof -d 'Work around some diff versions not detecting newlines at end of file' +complete -f -c git -n '__fish_git_using_command apply' -s v -l verbose -d 'Report progress to stderr' +complete -f -c git -n '__fish_git_using_command apply' -l recount -d 'Do not trust the line counts in the hunk headers' +complete -F -c git -n '__fish_git_using_command apply' -l directory -d 'Prepend given path to all filenames' +complete -f -c git -n '__fish_git_using_command apply' -l unsafe-paths -d 'Allow patches that work outside working area' + + +### archive +complete -f -c git -n __fish_git_needs_command -a archive -d 'Create an archive of files from a named tree' +# TODO options + +### bisect +complete -f -c git -n __fish_git_needs_command -a bisect -d 'Find the change that introduced a bug by binary search' +complete -f -c git -n '__fish_git_using_command bisect; and __fish_prev_arg_in bisect' -xa " +start\t'Start a new bisect session' +bad\t'Mark a commit as bad' +new\t'Mark a commit as new' +good\t'Mark a commit as good' +old\t'Mark a commit as old' +terms\t'Show terms used for new/old states' +skip\t'Skip some commits' +reset\t'Exit a bisect session and reset HEAD' +visualize\t'See remaining commits in gitk' +replay\t'Replay a bisect log file' +log\t'Record a bisect log file' +run\t'Bisect automaically with the given command as discriminator' +help\t'Print a synopsis of all commands' +" +complete -c git -n '__fish_git_using_command bisect; and __fish_seen_argument --' -F +complete -f -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from start' -l term-new -l term-bad -x -d 'Use another term instead of new/bad' +complete -f -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from start' -l term-old -l term-good -x -d 'Use another term instead of old/good' +complete -f -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from start' -l no-checkout -d 'Do not checkout tree, only update BISECT_HEAD' +complete -f -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from start' -l first-parent -d 'On merge commits, follow only the first parent commit' +complete -f -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from start; and not contains -- -- (commandline -opc)' -a '(__fish_git_refs)' +complete -f -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from bad new good old' -a '(__fish_git_refs)' +complete -f -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from terms' -l --term-good -d 'Print the term for the old state' +complete -f -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from terms' -l --term-bad -d 'Print the term for the new state' +complete -f -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from skip' -a '(__fish_git_ranges)' +complete -f -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from reset' -a '(__fish_git_refs)' +complete -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from replay' -F +complete -f -c git -n '__fish_git_using_command bisect; and __fish_seen_subcommand_from run' -xa '(__fish_complete_subcommand --fcs-skip=3)' + +### branch +complete -f -c git -n __fish_git_needs_command -a branch -d 'List, create, or delete branches' +complete -f -c git -n '__fish_git_using_command branch' -a '(__fish_git_branches)' +complete -f -c git -n '__fish_git_using_command branch' -s d -l delete -d 'Delete branch' -xa '(__fish_git_local_branches)' +complete -f -c git -n '__fish_git_using_command branch' -s D -d 'Force deletion of branch' -xa '(__fish_git_local_branches)' +complete -f -c git -n '__fish_git_using_command branch' -s f -l force -d 'Reset branch even if it already exists' +complete -f -c git -n '__fish_git_using_command branch' -s m -l move -d 'Rename branch' +complete -f -c git -n '__fish_git_using_command branch' -s M -d 'Force rename branch' +complete -f -c git -n '__fish_git_using_command branch' -s c -l copy -d 'Copy branch' +complete -f -c git -n '__fish_git_using_command branch' -s C -d 'Force copy branch' +complete -f -c git -n '__fish_git_using_command branch' -s a -l all -d 'Lists both local and remote branches' +complete -f -c git -n '__fish_git_using_command branch' -s t -l track -l track -d 'Track remote branch' +complete -f -c git -n '__fish_git_using_command branch' -l no-track -d 'Do not track remote branch' +complete -f -c git -n '__fish_git_using_command branch' -l set-upstream-to -d 'Set remote branch to track' +complete -f -c git -n '__fish_git_using_command branch' -l merged -d 'List branches that have been merged' +complete -f -c git -n '__fish_git_using_command branch' -l no-merged -d 'List branches that have not been merged' + +### cherry +complete -f -c git -n __fish_git_needs_command -a cherry -d 'Find commits yet to be applied to upstream [upstream [head]]' +complete -f -c git -n '__fish_git_using_command cherry' -s v -d 'Show the commit subjects next to the SHA1s' +complete -f -c git -n '__fish_git_using_command cherry' -k -a '(__fish_git_refs)' -d Upstream + +### cherry-pick +complete -f -c git -n __fish_git_needs_command -a cherry-pick -d 'Apply the change introduced by an existing commit' +complete -f -c git -n '__fish_git_using_command cherry-pick' -k -a '(__fish_git_ranges)' +# TODO: Filter further +complete -f -c git -n '__fish_git_using_command cherry-pick; and __fish_git_possible_commithash' -ka '(__fish_git_commits)' +complete -f -c git -n '__fish_git_using_command cherry-pick' -s e -l edit -d 'Edit the commit message prior to committing' +complete -f -c git -n '__fish_git_using_command cherry-pick' -s x -d 'Append info in generated commit on the origin of the cherry-picked change' +complete -f -c git -n '__fish_git_using_command cherry-pick' -s n -l no-commit -d 'Apply changes without making any commit' +complete -f -c git -n '__fish_git_using_command cherry-pick' -s s -l signoff -d 'Add Signed-off-by line to the commit message' +complete -f -c git -n '__fish_git_using_command cherry-pick' -l ff -d 'Fast-forward if possible' +complete -f -c git -n '__fish_git_using_command cherry-pick' -l continue -d 'Continue the operation in progress' +complete -f -c git -n '__fish_git_using_command cherry-pick' -l abort -d 'Cancel the operation' +complete -f -c git -n '__fish_git_using_command cherry-pick' -l skip -d 'Skip the current commit and continue with the rest of the sequence' + +### clone +complete -f -c git -n __fish_git_needs_command -a clone -d 'Clone a repository into a new directory' +complete -f -c git -n '__fish_git_using_command clone' -l no-hardlinks -d 'Copy files instead of using hardlinks' +complete -f -c git -n '__fish_git_using_command clone' -s q -l quiet -d 'Operate quietly and do not report progress' +complete -f -c git -n '__fish_git_using_command clone' -s v -l verbose -d 'Provide more information on what is going on' +complete -f -c git -n '__fish_git_using_command clone' -s n -l no-checkout -d 'No checkout of HEAD is performed after the clone is complete' +complete -f -c git -n '__fish_git_using_command clone' -l bare -d 'Make a bare Git repository' +complete -f -c git -n '__fish_git_using_command clone' -l mirror -d 'Set up a mirror of the source repository' +complete -f -c git -n '__fish_git_using_command clone' -s o -l origin -d 'Use a specific name of the remote instead of the default' +complete -f -c git -n '__fish_git_using_command clone' -s b -l branch -d 'Use a specific branch instead of the one used by the cloned repository' +complete -f -c git -n '__fish_git_using_command clone' -l depth -d 'Truncate the history to a specified number of revisions' +complete -f -c git -n '__fish_git_using_command clone' -l recursive -d 'Initialize all submodules within the cloned repository' + +### commit +complete -c git -n __fish_git_needs_command -a commit -d 'Record changes to the repository' +complete -c git -n '__fish_git_using_command commit' -l amend -d 'Amend the log message of the last commit' +complete -f -c git -n '__fish_git_using_command commit' -a '(__fish_git_files modified deleted modified-staged-deleted untracked)' +complete -c git -n '__fish_git_using_command commit' -s a -l all -d 'Automatically stage modified and deleted files' +complete -c git -n '__fish_git_using_command commit' -s p -l patch -d 'Use interactive patch selection interface' +complete -f -c git -n '__fish_git_using_command commit' -l fixup -d 'Fixup commit to be used with rebase --autosquash' +complete -f -c git -n '__fish_git_using_command commit' -l squash -d 'Squash commit to be used with rebase --autosquash' +complete -c git -n '__fish_git_using_command commit' -l reset-author -d 'When amending, reset author of commit to the committer' +complete -x -c git -n '__fish_git_using_command commit' -l author -d 'Override the commit author' +complete -x -c git -n '__fish_git_using_command commit' -l cleanup -a "strip\t'Leading/trailing whitespace/empty lines, #commentary' + whitespace\t'Like strip but keep #commentary' + verbatim\t'Do not change the message' + scissors\t'Like whitespace but also remove after scissor lines' + default\t'Like strip if the message is to be edited, whitespace otherwise'" -d 'How to clean up the commit message' +complete -x -c git -n '__fish_git_using_command commit' -l date -d 'Override the author date' +complete -x -c git -n '__fish_git_using_command commit' -s m -l message -d 'Use the given message as the commit message' +complete -f -c git -n '__fish_git_using_command commit' -l no-edit -d 'Use the selected commit message without launching an editor' +complete -f -c git -n '__fish_git_using_command commit' -l no-gpg-sign -d 'Do not sign commit' +complete -f -c git -n '__fish_git_using_command commit' -s n -l no-verify -d 'Do not run pre-commit and commit-msg hooks' +complete -f -c git -n '__fish_git_using_command commit; and __fish_contains_opt fixup squash' -k -a '(__fish_git_recent_commits)' +complete -f -c git -n '__fish_git_using_command commit' -l allow-empty -d 'Create a commit with no changes' +complete -f -c git -n '__fish_git_using_command commit' -l allow-empty-message -d 'Create a commit with no commit message' +# TODO options + +### count-objects +complete -f -c git -n __fish_git_needs_command -a count-objects -d 'Count unpacked number of objects and their disk consumption' +complete -f -c git -n '__fish_git_using_command count-objects' -s v -l verbose -d 'Be verbose' +complete -f -c git -n '__fish_git_using_command count-objects' -s H -l human-readable -d 'Print in human readable format' + +### daemon +complete -c git -n __fish_git_needs_command -a daemon -d 'A really simple server for git repositories' +complete -f -c git -n '__fish_git_using_command daemon' -l strict-paths -d 'Match paths exactly' +complete -F -c git -n '__fish_git_using_command daemon' -l base-path -d 'Git Root' +complete -f -c git -n '__fish_git_using_command daemon' -l base-path-relaxed -d 'When looking up with base path fails, try without it' +complete -F -c git -n '__fish_git_using_command daemon' -l interpolated-path -d 'Construct a path from the given template' +complete -f -c git -n '__fish_git_using_command daemon' -l export-all -d 'Allow pulling from all directories' +complete -f -c git -n '__fish_git_using_command daemon' -l inetd -d 'Run as inetd service' +complete -x -c git -n '__fish_git_using_command daemon' -l listen -d 'Listen on this IP' +complete -x -c git -n '__fish_git_using_command daemon' -l port -d 'Listen on this port' +complete -x -c git -n '__fish_git_using_command daemon' -l init-timeout -d 'Connection timeout' +complete -x -c git -n '__fish_git_using_command daemon' -l timeout -d 'Timeout for each request' +complete -x -c git -n '__fish_git_using_command daemon' -l max-connections -d 'Maximum parallel clients' +complete -f -c git -n '__fish_git_using_command daemon' -l syslog -d '--log-destination=syslog' +complete -x -c git -n '__fish_git_using_command daemon' -l log-destination -a 'stderr syslog none' -d 'Log destination' +complete -x -c git -n '__fish_git_using_command daemon' -l user-path -d 'Allow ~user notation to be used' +complete -f -c git -n '__fish_git_using_command daemon' -l verbose -d 'Log all details' +complete -f -c git -n '__fish_git_using_command daemon' -l reuseaddr -d 'Reuse address when binding to listening server' +complete -f -c git -n '__fish_git_using_command daemon' -l detach -d 'Detach from shell' +complete -x -c git -n '__fish_git_using_command daemon' -l reuseaddr -d 'Save the process id in file' +complete -x -c git -n '__fish_git_using_command daemon' -l user -d 'Change daemon\'s uid' +complete -x -c git -n '__fish_git_using_command daemon' -l group -d 'Change daemon\'s gid' +complete -x -c git -n '__fish_git_using_command daemon' -l enable -a 'upload-pack upload-archive receive-pack' -d 'Enable service' +complete -x -c git -n '__fish_git_using_command daemon' -l disable -a 'upload-pack upload-archive receive-pack' -d 'Disable service' +complete -x -c git -n '__fish_git_using_command daemon' -l allow-override -a 'upload-pack upload-archive receive-pack' -d 'Allow overriding site-wide default per repository configuration' +complete -x -c git -n '__fish_git_using_command daemon' -l forbid-override -a 'upload-pack upload-archive receive-pack' -d 'Forbid overriding site-wide default per repository configuration' +complete -f -c git -n '__fish_git_using_command daemon' -l informative-errors -d 'Report more verbose errors to clients' +complete -f -c git -n '__fish_git_using_command daemon' -l no-informative-errors -d 'Report less verbose errors to clients' +complete -x -c git -n '__fish_git_using_command daemon' -l access-hook -d 'Hook to run whenever a client connects' + +### describe +complete -c git -n __fish_git_needs_command -a describe -d 'Give an object a human readable name based on an available ref' +complete -k -f -c git -n '__fish_git_using_command describe' -a '(__fish_git_tags)' -d Tag +complete -k -f -c git -n '__fish_git_using_command describe' -a '(__fish_git_branches)' +complete -k -f -c git -n '__fish_git_using_command describe' -a '(__fish_git_heads)' -d Head +complete -f -c git -n '__fish_git_using_command describe' -l dirty -d 'Describe the state of the working tree, append dirty if there are local changes' +complete -f -c git -n '__fish_git_using_command describe' -l broken -d 'Describe the state of the working tree, append -broken instead of erroring' +complete -f -c git -n '__fish_git_using_command describe' -l all -d 'Use all tags, not just annotated' +complete -f -c git -n '__fish_git_using_command describe' -l tags -d 'Use all commits/tags, not just annotated tags' +complete -f -c git -n '__fish_git_using_command describe' -l contains -d 'Find the tag that comes after the commit' +complete -f -c git -n '__fish_git_using_command describe' -l abbrev -d 'Use <n> digits, or as many digits as needed to form a unique object name' +complete -f -c git -n '__fish_git_using_command describe' -l candidates -d 'Consider up to <n> candidates' +complete -f -c git -n '__fish_git_using_command describe' -l exact-match -d 'Only output exact matches' +complete -f -c git -n '__fish_git_using_command describe' -l debug -d 'Display debug info' +complete -f -c git -n '__fish_git_using_command describe' -l long -d 'Always output the long format' +complete -f -c git -n '__fish_git_using_command describe' -l match -d 'Only consider tags matching the given glob pattern' +complete -f -c git -n '__fish_git_using_command describe' -l exclude -d 'Do not consider tags matching the given glob pattern' +complete -f -c git -n '__fish_git_using_command describe' -l always -d 'Show uniquely abbreviated commit object as fallback' +complete -f -c git -n '__fish_git_using_command describe' -l first-parent -d 'Follow only the first parent of a merge commit' + +### diff +complete -c git -n __fish_git_needs_command -a diff -d 'Show changes between commits, commit and working tree, etc' +complete -c git -n '__fish_git_using_command diff; and not contains -- -- (commandline -opc)' -k -a '(__fish_git_ranges)' +complete -c git -n '__fish_git_using_command diff' -l cached -d 'Show diff of changes in the index' +complete -c git -n '__fish_git_using_command diff' -l staged -d 'Show diff of changes in the index' +complete -c git -n '__fish_git_using_command diff' -l no-index -d 'Compare two paths on the filesystem' +complete -c git -n '__fish_git_using_command diff' -l exit-code -d 'Exit with 1 if there were differences or 0 if no differences' +complete -c git -n '__fish_git_using_command diff' -l quiet -d 'Disable all output of the program, implies --exit-code' +complete -c git -n '__fish_git_using_command diff' -s 1 -l base -d 'Compare the working tree with the "base" version' +complete -c git -n '__fish_git_using_command diff' -s 2 -l ours -d 'Compare the working tree with the "our branch"' +complete -c git -n '__fish_git_using_command diff' -s 3 -l theirs -d 'Compare the working tree with the "their branch"' +complete -c git -n '__fish_git_using_command diff' -s 0 -d 'Omit diff output for unmerged entries and just show "Unmerged"' +complete -c git -n '__fish_git_using_command diff; and not __fish_contains_opt cached staged' -a '( + set -l kinds modified + contains -- -- (commandline -opc) && set -a kinds deleted modified-staged-deleted + __fish_git_files $kinds +)' +complete -c git -n '__fish_git_using_command diff; and __fish_contains_opt cached staged' -fa '(__fish_git_files all-staged)' + +### Function to list available tools for git difftool and mergetool + +function __fish_git_diffmerge_tools -a cmd + git $cmd --tool-help | while read -l line + string match -q 'The following tools are valid, but not currently available:' -- $line + and break + string replace -f -r '^\t\t(\w+).*$' '$1' -- $line + end +end + +### difftool +complete -c git -n __fish_git_needs_command -a difftool -d 'Open diffs in a visual tool' +complete -c git -n '__fish_git_using_command difftool; and not contains -- -- (commandline -opc)' -k -a '(__fish_git_ranges)' +complete -c git -n '__fish_git_using_command difftool' -l cached -d 'Visually show diff of changes in the index' +complete -f -c git -n '__fish_git_using_command difftool' -a '( + set -l kinds modified + contains -- -- (commandline -opc) && set -a kinds deleted modified-staged-deleted + __fish_git_files $kinds +)' +complete -f -c git -n '__fish_git_using_command difftool' -s g -l gui -d 'Use `diff.guitool` instead of `diff.tool`' +complete -f -c git -n '__fish_git_using_command difftool' -s d -l dir-diff -d 'Perform a full-directory diff' +complete -c git -n '__fish_git_using_command difftool' -l prompt -d 'Prompt before each invocation of the diff tool' +complete -f -c git -n '__fish_git_using_command difftool' -s y -l no-prompt -d 'Do not prompt before launching a diff tool' +complete -f -c git -n '__fish_git_using_command difftool' -l symlinks -d 'Use symlinks in dir-diff mode' +complete -f -c git -n '__fish_git_using_command difftool' -s t -l tool -d 'Use the specified diff tool' -a "(__fish_git_diffmerge_tools difftool)" +complete -f -c git -n '__fish_git_using_command difftool' -l tool-help -d 'Print a list of diff tools that may be used with `--tool`' +complete -f -c git -n '__fish_git_using_command difftool' -l trust-exit-code -d 'Exit when an invoked diff tool returns a non-zero exit code' +complete -f -c git -n '__fish_git_using_command difftool' -s x -l extcmd -d 'Specify a custom command for viewing diffs' +# TODO options + +### gc +complete -f -c git -n __fish_git_needs_command -a gc -d 'Cleanup unnecessary files and optimize the local repository' +complete -f -c git -n '__fish_git_using_command gc' -l aggressive -d 'Aggressively optimize the repository' +complete -f -c git -n '__fish_git_using_command gc' -l auto -d 'Checks any housekeeping is required and then run' +complete -f -c git -n '__fish_git_using_command gc' -l prune -d 'Prune loose objects older than date' +complete -f -c git -n '__fish_git_using_command gc' -l no-prune -d 'Do not prune any loose objects' +complete -f -c git -n '__fish_git_using_command gc' -l quiet -d 'Be quiet' +complete -f -c git -n '__fish_git_using_command gc' -l force -d 'Force `git gc` to run' +complete -f -c git -n '__fish_git_using_command gc' -l keep-largest-pack -d 'Ignore `gc.bigPackThreshold`' + +### grep +complete -c git -n __fish_git_needs_command -a grep -d 'Print lines matching a pattern' +# TODO options + +### init +complete -f -c git -n __fish_git_needs_command -a init -d 'Create an empty git repository or reinitialize an existing one' +# TODO options + +### log +complete -c git -n __fish_git_needs_command -a shortlog -d 'Show commit shortlog' +complete -c git -n __fish_git_needs_command -a log -d 'Show commit logs' +complete -c git -n '__fish_git_using_command log; and not contains -- -- (commandline -opc)' -k -a '(__fish_git_ranges)' + +complete -c git -n '__fish_git_using_command log' -l follow -d 'Continue listing file history beyond renames' +complete -c git -n '__fish_git_using_command log' -l no-decorate -d 'Don\'t print ref names' +complete -f -c git -n '__fish_git_using_command log' -l decorate -a 'short\tHide\ prefixes full\tShow\ full\ ref\ names auto\tHide\ prefixes\ if\ printed\ to\ terminal no\tDon\\\'t\ display\ ref' -d 'Print out ref names' +complete -c git -n '__fish_git_using_command log' -l source -d 'Print ref name by which each commit was reached' +complete -c git -n '__fish_git_using_command log' -l use-mailmap +complete -c git -n '__fish_git_using_command log' -l full-diff +complete -c git -n '__fish_git_using_command log' -l log-size +complete -x -c git -n '__fish_git_using_command log' -s L +complete -x -c git -n '__fish_git_using_command log' -s n -l max-count -d 'Limit the number of commits before starting to show the commit output' +complete -x -c git -n '__fish_git_using_command log' -l skip -d 'Skip given number of commits' +complete -x -c git -n '__fish_git_using_command log' -l since -d 'Show commits more recent than specified date' +complete -x -c git -n '__fish_git_using_command log' -l after -d 'Show commits more recent than specified date' +complete -x -c git -n '__fish_git_using_command log' -l until -d 'Show commits older than specified date' +complete -x -c git -n '__fish_git_using_command log' -l before -d 'Show commits older than specified date' +complete -x -c git -n '__fish_git_using_command log' -l author -d 'Limit commits from given author' +complete -x -c git -n '__fish_git_using_command log' -l committer -d 'Limit commits from given committer' +complete -x -c git -n '__fish_git_using_command log' -l grep-reflog -d 'Limit commits to ones with reflog entries matching given pattern' +complete -x -c git -n '__fish_git_using_command log' -l grep -d 'Limit commits with message that match given pattern' +complete -c git -n '__fish_git_using_command log' -l all-match -d 'Limit commits to ones that match all given --grep' +complete -c git -n '__fish_git_using_command log' -l invert-grep -d 'Limit commits to ones with message that don\'t match --grep' +complete -c git -n '__fish_git_using_command log' -l regexp-ignore-case -s i -d 'Case insensitive match' +complete -c git -n '__fish_git_using_command log' -l basic-regexp -d 'Patterns are basic regular expressions (default)' +complete -c git -n '__fish_git_using_command log' -l extended-regexp -s E -d 'Patterns are extended regular expressions' +complete -c git -n '__fish_git_using_command log' -l fixed-strings -s F -d 'Patterns are fixed strings' +complete -c git -n '__fish_git_using_command log' -l perl-regexp -d 'Patterns are Perl-compatible regular expressions' +complete -c git -n '__fish_git_using_command log' -l remove-empty -d 'Stop when given path disappears from tree' +complete -c git -n '__fish_git_using_command log' -l merges -d 'Print only merge commits' +complete -c git -n '__fish_git_using_command log' -l no-merges -d 'Don\'t print commits with more than one parent' +complete -x -c git -n '__fish_git_using_command log' -l min-parents -d 'Show only commit with at least the given number of parents' +complete -x -c git -n '__fish_git_using_command log' -l max-parents -d 'Show only commit with at most the given number of parents' +complete -c git -n '__fish_git_using_command log' -l no-min-parents -d 'Show only commit without a minimum number of parents' +complete -c git -n '__fish_git_using_command log' -l no-max-parents -d 'Show only commit without a maximum number of parents' +complete -c git -n '__fish_git_using_command log' -l first-parent -d 'Follow only the first parent commit upon seeing a merge commit' +complete -c git -n '__fish_git_using_command log' -l not -d 'Reverse meaning of ^ prefix' +complete -c git -n '__fish_git_using_command log' -l all -d 'Show log for all branches, tags, and remotes' +complete -f -c git -n '__fish_git_using_command log' -l branches -d 'Show log for all matching branches' +complete -f -c git -n '__fish_git_using_command log' -l tags -d 'Show log for all matching tags' +complete -f -c git -n '__fish_git_using_command log' -l remotes -d 'Show log for all matching remotes' +complete -x -c git -n '__fish_git_using_command log' -l glob -d 'Show log for all matching branches, tags, and remotes' +complete -x -c git -n '__fish_git_using_command log' -l exclude -d 'Do not include refs matching given glob pattern' +complete -c git -n '__fish_git_using_command log' -l reflog -d 'Show log for all reflogs entries' +complete -c git -n '__fish_git_using_command log' -l ingnore-missing -d 'Ignore invalid object names' +complete -c git -n '__fish_git_using_command log' -l bisect +complete -c git -n '__fish_git_using_command log' -l stdin -d 'Read commits from stdin' +complete -c git -n '__fish_git_using_command log' -l cherry-mark -d 'Mark equivalent commits with = and inequivalent with +' +complete -c git -n '__fish_git_using_command log' -l cherry-pick -d 'Omit equivalent commits' +complete -c git -n '__fish_git_using_command log' -l left-only +complete -c git -n '__fish_git_using_command log' -l rigth-only +complete -c git -n '__fish_git_using_command log' -l cherry +complete -c git -n '__fish_git_using_command log' -l walk-reflogs -s g +complete -c git -n '__fish_git_using_command log' -l merge +complete -c git -n '__fish_git_using_command log' -l boundary +complete -c git -n '__fish_git_using_command log' -l simplify-by-decoration +complete -c git -n '__fish_git_using_command log' -l full-history +complete -c git -n '__fish_git_using_command log' -l dense +complete -c git -n '__fish_git_using_command log' -l sparse +complete -c git -n '__fish_git_using_command log' -l simplify-merges +complete -c git -n '__fish_git_using_command log' -l ancestry-path +complete -c git -n '__fish_git_using_command log' -l date-order +complete -c git -n '__fish_git_using_command log' -l author-date-order +complete -c git -n '__fish_git_using_command log' -l topo-order +complete -c git -n '__fish_git_using_command log' -l reverse +complete -f -c git -n '__fish_git_using_command log' -l no-walk -a "sorted unsorted" +complete -c git -n '__fish_git_using_command log' -l do-walk +complete -c git -n '__fish_git_using_command log' -l format +complete -c git -n '__fish_git_using_command log' -l abbrev-commit +complete -c git -n '__fish_git_using_command log' -l no-abbrev-commit +complete -c git -n '__fish_git_using_command log' -l oneline +complete -x -c git -n '__fish_git_using_command log' -l encoding -a '(__fish_print_encodings)' +complete -f -c git -n '__fish_git_using_command log' -l expand-tabs +complete -c git -n '__fish_git_using_command log' -l no-expand-tabs +complete -f -c git -n '__fish_git_using_command log' -l notes +complete -c git -n '__fish_git_using_command log' -l no-notes +complete -f -c git -n '__fish_git_using_command log' -l show-notes +complete -c git -n '__fish_git_using_command log' -l standard-notes +complete -c git -n '__fish_git_using_command log' -l no-standard-notes +complete -c git -n '__fish_git_using_command log' -l show-signature +complete -c git -n '__fish_git_using_command log' -l relative-date +complete -x -c git -n '__fish_git_using_command log' -l date -a ' + relative + local + iso + iso-local + iso8601 + iso8601-local + iso-strict + iso-strict-local + iso8601-strict + iso8601-strict-local + rfc-local + rfc2822-local + short + short-local + raw + human + unix + format: + default + default-local +' +complete -c git -n '__fish_git_using_command log' -l parents +complete -c git -n '__fish_git_using_command log' -l children +complete -c git -n '__fish_git_using_command log' -l left-right +complete -c git -n '__fish_git_using_command log' -l graph +complete -f -c git -n '__fish_git_using_command log' -l show-linear-break +complete -c git -n '__fish_git_using_command log' -s c +complete -c git -n '__fish_git_using_command log' -l cc +complete -c git -n '__fish_git_using_command log' -s m +complete -c git -n '__fish_git_using_command log' -s r +complete -c git -n '__fish_git_using_command log' -s t +complete -c git -n '__fish_git_using_command log' -l patch -s p +complete -c git -n '__fish_git_using_command log' -s u +complete -c git -n '__fish_git_using_command log' -l no-patch -s s +complete -x -c git -n '__fish_git_using_command log' -l unified -s U +complete -c git -n '__fish_git_using_command log' -l raw +complete -c git -n '__fish_git_using_command log' -l patch-with-raw +complete -c git -n '__fish_git_using_command log' -l indent-heuristic +complete -c git -n '__fish_git_using_command log' -l no-indent-heuristic +complete -c git -n '__fish_git_using_command log' -l compaction-heuristic +complete -c git -n '__fish_git_using_command log' -l no-compaction-heuristic +complete -c git -n '__fish_git_using_command log' -l minimal +complete -c git -n '__fish_git_using_command log' -l patience +complete -c git -n '__fish_git_using_command log' -l histogram +complete -f -x -c git -n '__fish_git_using_command log' -l stat +complete -c git -n '__fish_git_using_command log' -l numstat +complete -c git -n '__fish_git_using_command log' -l shortstat +complete -c git -n '__fish_git_using_command log' -l summary +complete -c git -n '__fish_git_using_command log' -l patch-with-stat +complete -c git -n '__fish_git_using_command log' -s z +complete -c git -n '__fish_git_using_command log' -l name-only +complete -c git -n '__fish_git_using_command log' -l name-status +complete -f -c git -n '__fish_git_using_command log' -l color -a 'always never auto' +complete -c git -n '__fish_git_using_command log' -l no-color +complete -f -c git -n '__fish_git_using_command log' -l word-diff -a ' + color + plain + porcelain + none +' +complete -f -c git -n '__fish_git_using_command log' -l color-words +complete -c git -n '__fish_git_using_command log' -l no-renames +complete -c git -n '__fish_git_using_command log' -l check +complete -c git -n '__fish_git_using_command log' -l full-index +complete -c git -n '__fish_git_using_command log' -l binary +complete -f -c git -n '__fish_git_using_command log' -l abbrev +complete -f -c git -n '__fish_git_using_command log' -s l + +function __fish__git_append_letters_nosep + set -l token (commandline -tc) + printf "%s\n" $token$argv +end + +complete -x -c git -n '__fish_git_using_command log' -l diff-filter -a '(__fish__git_append_letters_nosep a\tExclude\ added c\tExclude\ copied d\tExclude\ deleted m\tExclude\ modified r\tExclude\ renamed t\tExclude\ type\ changed u\tExclude\ unmerged x\tExclude\ unknown b\tExclude\ broken A\tAdded C\tCopied D\tDeleted M\tModified R\tRenamed T\tType\ Changed U\tUnmerged X\tUnknown B\tBroken)' + +### ls-files +complete -c git -n __fish_git_needs_command -a ls-files -d 'Show information about files in the index and the working tree' +complete -c git -n '__fish_git_using_command ls-files' +complete -c git -n '__fish_git_using_command ls-files' -s c -l cached -d 'Show cached files in the output' +complete -c git -n '__fish_git_using_command ls-files' -s d -l deleted -d 'Show deleted files in the output' +complete -c git -n '__fish_git_using_command ls-files' -s m -l modified -d 'Show modified files in the output' +complete -c git -n '__fish_git_using_command ls-files' -s o -l others -d 'Show other (i.e. untracked) files in the output' +complete -c git -n '__fish_git_using_command ls-files' -s i -l ignored -d 'Show only ignored files in the output' +complete -c git -n '__fish_git_using_command ls-files' -s s -l staged -d "Show staged contents' mode bits, object name and stage number in the output" +complete -c git -n '__fish_git_using_command ls-files' -l directory -d 'If a whole directory is classified as "other", show just its name' +complete -c git -n '__fish_git_using_command ls-files' -l no-empty-directory -d 'Do not list empty directories' +complete -c git -n '__fish_git_using_command ls-files' -s u -l unmerged -d 'Show unmerged files in the output' +complete -c git -n '__fish_git_using_command ls-files' -s k -l killed -d 'Show files on the filesystem that need to be removed for checkout-index to succeed' +complete -c git -n '__fish_git_using_command ls-files' -s z -d 'Use \0 delimiter' +complete -c git -n '__fish_git_using_command ls-files' -s x -l exclude -d 'Skip untracked files matching pattern' +complete -c git -n '__fish_git_using_command ls-files' -s X -l exclude-from -d 'Read exclude patterns from <file>; 1 per line' +complete -c git -n '__fish_git_using_command ls-files' -l exclude-per-directory -d 'Read extra exclude patterns that apply only to the dir and its subdirs in <file>' +complete -c git -n '__fish_git_using_command ls-files' -l exclude-standard -d 'Add the standard Git exclusions' +complete -c git -n '__fish_git_using_command ls-files' -l error-unmatch -d 'If any <file> does not appear in the index, treat this as an error' +complete -c git -n '__fish_git_using_command ls-files' -l with-tree +complete -c git -n '__fish_git_using_command ls-files' -s t -d 'Identifies the file status' +complete -c git -n '__fish_git_using_command ls-files' -s v -d 'Show file status, use lowercase letters for files assumed unchanged' +complete -c git -n '__fish_git_using_command ls-files' -s f -d 'Show file status, use lowercase letters for files marked as fsmonitor valid' +complete -c git -n '__fish_git_using_command ls-files' -l full-name -d 'Force paths to be output relative to the project top directory' +complete -c git -n '__fish_git_using_command ls-files' -l recurse-submodules -d 'Recursively calls ls-files on each submodule in the repository' +complete -c git -n '__fish_git_using_command ls-files' -l abbrev -d 'Show only a partial prefix' +complete -c git -n '__fish_git_using_command ls-files' -l debug -d 'After each line that describes a file, add more data about its cache entry' +complete -c git -n '__fish_git_using_command ls-files' -l eol -d 'Show <eolinfo> and <eolattr> of files' + +### mailinfo +complete -f -c git -n __fish_git_needs_command -a mailinfo -d 'Extracts patch and authorship from a single e-mail message' +complete -f -c git -n '__fish_git_using_command mailinfo am' -s k -d 'Do not remove email cruft from subject' +complete -f -c git -n '__fish_git_using_command mailinfo' -s b -d 'Only strip bracket pairs containing \'PATCH\'' +complete -f -c git -n '__fish_git_using_command mailinfo am' -s u -d 'Do not reencode author name and email' +complete -x -c git -n '__fish_git_using_command mailinfo' -l encoding -d 'Re-encode to given charset' +complete -f -c git -n '__fish_git_using_command mailinfo' -s n -d 'Disable all charset re-encoding of metadata' +complete -f -c git -n '__fish_git_using_command mailinfo am' -s m -l message-id -d 'Copy message id to the end of commit message' +complete -f -c git -n '__fish_git_using_command mailinfo' -l scissors -d 'Remove everything above scissor line' +complete -f -c git -n '__fish_git_using_command mailinfo' -l no-scissors -d 'Ignore scissor lines' +complete -x -c git -n '__fish_git_using_command mailinfo' -l quoted-cr -a 'nowarn warn strip' -d 'Action when processed email message end with CRLF instead of LF' + +### mailsplit +complete -c git -n __fish_git_needs_command -a mailsplit -d 'Simple UNIX mbox splitter program' +complete -F -c git -n '__fish_git_using_command mailsplit' -s o -d 'Directory to place individual messages' +complete -f -c git -n '__fish_git_using_command mailsplit' -s b -d 'Treat files not starting with From line as single mail message' +complete -x -c git -n '__fish_git_using_command mailsplit' -s d -d 'File name prefix digit precision' +complete -x -c git -n '__fish_git_using_command mailsplit' -s f -d 'Skip first n numbers' +complete -f -c git -n '__fish_git_using_command mailsplit am' -l keep-cr -d 'Do not remove \\r from lines starting with \\n\\r' +complete -f -c git -n '__fish_git_using_command mailsplit' -l mboxrd -d 'Input is of mboxrd form' + +### maintenance +complete -f -c git -n __fish_git_needs_command -a maintenance -d 'Run tasks to optimize Git repository data' +complete -f -c git -n '__fish_git_using_command maintenance' -a register -d 'Initialize Git config vars for maintenance' +complete -f -c git -n '__fish_git_using_command maintenance' -a run -d 'Run one or more maintenance tasks' +complete -f -c git -n '__fish_git_using_command maintenance' -a start -d 'Start maintenance' +complete -f -c git -n '__fish_git_using_command maintenance' -a stop -d 'Halt background maintenance' +complete -f -c git -n '__fish_git_using_command maintenance' -a unregister -d 'Remove repository from background maintenance' +complete -f -c git -n '__fish_git_using_command maintenance' -l quiet -d 'Supress logs' +complete -x -c git -n '__fish_git_using_command maintenance' -l task -a 'commit-graph prefetch gc loose-objects incremental-repack pack-refs' -d 'Tasks to run' +complete -f -c git -n '__fish_git_using_command maintenance' -l auto -d 'Run maintenance only when necessary' +complete -f -c git -n '__fish_git_using_command maintenance' -l schedule -d 'Run maintenance on certain intervals' + +### merge +complete -f -c git -n __fish_git_needs_command -a merge -d 'Join two or more development histories together' +complete -f -c git -n '__fish_git_using_command merge' -a '(__fish_git_branches)' +complete -f -c git -n '__fish_git_using_command merge' -l commit -d "Autocommit the merge" +complete -f -c git -n '__fish_git_using_command merge' -l no-commit -d "Don't autocommit the merge" +complete -f -c git -n '__fish_git_using_command merge' -s e -l edit -d 'Edit auto-generated merge message' +complete -f -c git -n '__fish_git_using_command merge' -l no-edit -d "Don't edit auto-generated merge message" +complete -f -c git -n '__fish_git_using_command merge' -l ff -d "Don't generate a merge commit if merge is fast-forward" +complete -f -c git -n '__fish_git_using_command merge' -l no-ff -d "Generate a merge commit even if merge is fast-forward" +complete -f -c git -n '__fish_git_using_command merge' -l ff-only -d 'Refuse to merge unless fast-forward possible' +complete -f -c git -n '__fish_git_using_command merge' -s S -l gpg-sign -d 'GPG-sign the merge commit' +complete -f -c git -n '__fish_git_using_command merge' -l log -d 'Populate the log message with one-line descriptions' +complete -f -c git -n '__fish_git_using_command merge' -l no-log -d "Don't populate the log message with one-line descriptions" +complete -f -c git -n '__fish_git_using_command merge' -l signoff -d 'Add Signed-off-by line at the end of the merge commit message' +complete -f -c git -n '__fish_git_using_command merge' -l no-signoff -d 'Do not add a Signed-off-by line at the end of the merge commit message' +complete -f -c git -n '__fish_git_using_command merge' -l stat -d "Show diffstat of the merge" +complete -f -c git -n '__fish_git_using_command merge' -s n -l no-stat -d "Don't show diffstat of the merge" +complete -f -c git -n '__fish_git_using_command merge' -l squash -d "Squash changes from other branch as a single commit" +complete -f -c git -n '__fish_git_using_command merge' -l no-squash -d "Don't squash changes" +complete -x -c git -n '__fish_git_using_command merge' -s s -l strategy -d 'Use the given merge strategy' +complete -r -c git -n '__fish_git_using_command merge' -s X -l strategy-option -d 'Pass given option to the merge strategy' +complete -f -c git -n '__fish_git_using_command merge' -l verify-signatures -d 'Abort merge if other branch tip commit is not signed with a valid key' +complete -f -c git -n '__fish_git_using_command merge' -l no-verify-signatures -d 'Do not abort merge if other branch tip commit is not signed with a valid key' +complete -f -c git -n '__fish_git_using_command merge' -s q -l quiet -d 'Be quiet' +complete -f -c git -n '__fish_git_using_command merge' -s v -l verbose -d 'Be verbose' +complete -f -c git -n '__fish_git_using_command merge' -l progress -d 'Force progress status' +complete -f -c git -n '__fish_git_using_command merge' -l no-progress -d 'Force no progress status' +complete -f -c git -n '__fish_git_using_command merge' -l allow-unrelated-histories -d 'Allow merging even when branches do not share a common history' +complete -x -c git -n '__fish_git_using_command merge' -s m -d 'Set the commit message' +complete -f -c git -n '__fish_git_using_command merge' -s rerere-autoupdate -d 'If possible, use previous conflict resolutions' +complete -f -c git -n '__fish_git_using_command merge' -s no-rerere-autoupdate -d 'Do not use previous conflict resolutions' +complete -f -c git -n '__fish_git_using_command merge' -l abort -d 'Abort the current conflict resolution process' +complete -f -c git -n '__fish_git_using_command merge' -l continue -d 'Conclude current conflict resolution process' + +### merge-base +complete -f -c git -n __fish_git_needs_command -a merge-base -d 'Find as good common ancestors as possible for a merge' +complete -f -c git -n '__fish_git_using_command merge-base' -a '(__fish_git_branches)' +complete -f -c git -n '__fish_git_using_command merge-base' -s a -l all -d 'Output all merge bases for the commits, instead of just one' +complete -f -c git -n '__fish_git_using_command merge-base' -l octopus -d 'Compute the best common ancestors of all supplied commits' +complete -f -c git -n '__fish_git_using_command merge-base' -l independent -d 'Print a minimal subset of the supplied commits with the same ancestors.' +complete -f -c git -n '__fish_git_using_command merge-base' -l is-ancestor -d 'Check if the first commit is an ancestor of the second commit' +complete -f -c git -n '__fish_git_using_command merge-base' -l fork-point -d 'Find the point at which a branch forked from another branch ref' + +### mergetool + +complete -f -c git -n __fish_git_needs_command -a mergetool -d 'Run merge conflict resolution tools to resolve merge conflicts' +complete -f -c git -n '__fish_git_using_command mergetool' -s t -l tool -d "Use specific merge resolution program" -a "(__fish_git_diffmerge_tools mergetool)" +complete -f -c git -n '__fish_git_using_command mergetool' -l tool-help -d 'Print a list of merge tools that may be used with `--tool`' +complete -f -c git -n '__fish_git_using_command mergetool' -a "(__fish_git_files unmerged)" +complete -f -c git -n '__fish_git_using_command mergetool' -s y -l no-prompt -d 'Do not prompt before launching a diff tool' +complete -f -c git -n '__fish_git_using_command mergetool' -l prompt -d 'Prompt before each invocation of the merge resolution program' +complete -c git -n '__fish_git_using_command mergetool' -s O -d 'Process files in the order specified in the file passed as argument' + +### mv +complete -c git -n __fish_git_needs_command -a mv -d 'Move or rename a file, a directory, or a symlink' +complete -f -c git -n '__fish_git_using_command mv' -s f -l force -d 'Force rename/moving even if target exists' +complete -f -c git -n '__fish_git_using_command mv' -s k -d 'Skip rename/move which can lead to error' +complete -f -c git -n '__fish_git_using_command mv' -s n -l dry-run -d 'Only show what would happen' +complete -f -c git -n '__fish_git_using_command mv' -s v -l verbose -d 'Report names of files as they are changed' + +### notes +set -l notescommands add copy append edit show merge remove # list prune get-ref +complete -c git -n __fish_git_needs_command -a notes -d 'Add or inspect object notes' +complete -f -c git -n "__fish_git_using_command notes; and not __fish_seen_subcommand_from $notescommands" -a list -d 'List notes for given object' +complete -f -c git -n "__fish_git_using_command notes; and not __fish_seen_subcommand_from $notescommands" -a add -d 'Add notes for a given object' +complete -f -c git -n "__fish_git_using_command notes; and not __fish_seen_subcommand_from $notescommands" -a copy -d 'Copy notes from object1 to object2' +complete -f -c git -n "__fish_git_using_command notes; and not __fish_seen_subcommand_from $notescommands" -a append -d 'Append to the notes of existing object' +complete -f -c git -n "__fish_git_using_command notes; and not __fish_seen_subcommand_from $notescommands" -a edit -d 'Edit notes for a given object' +complete -f -c git -n "__fish_git_using_command notes; and not __fish_seen_subcommand_from $notescommands" -a show -d 'Show notes for given object' +complete -f -c git -n "__fish_git_using_command notes; and not __fish_seen_subcommand_from $notescommands" -a merge -d 'Merge the given notes ref to current notes ref' +complete -f -c git -n "__fish_git_using_command notes; and not __fish_seen_subcommand_from $notescommands" -a remove -d 'Remove notes for given object' +complete -f -c git -n "__fish_git_using_command notes; and not __fish_seen_subcommand_from $notescommands" -a prune -d 'Remove notes for non-existing/unreachable objects' +complete -f -c git -n "__fish_git_using_command notes; and not __fish_seen_subcommand_from $notescommands" -a get-ref -d 'Print current notes ref' +complete -f -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from $notescommands" -ka '(__fish_git_commits)' +complete -f -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from add copy" -s f -l force -d 'Overwrite existing notes' +complete -f -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from add append edit" -l allow-empty -d 'Allow empty note' +complete -r -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from add append" -s F -l file -d 'Read note message from file' +complete -x -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from add append" -s m -l message -d 'Use this note message' +complete -f -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from add append" -s C -l reuse-message -a '(__fish_git_commits)' -d 'Copy note from object' +complete -f -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from add append" -s c -l reedit-message -a '(__fish_git_commits)' -d 'Copy and edit note from object' +complete -f -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from copy remove" -l stdin -d 'Read object names from stdin' +complete -f -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from merge remove prune" -s v -l verbose -d 'Be more verbose' +complete -f -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from merge remove prune" -s q -l quiet -d 'Operate quietly' +complete -x -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from merge" -s s -l strategy -d 'Merge strategy to use to resolve conflicts' -a " + manual\t'Instruct the user to resolve merge conflicts' + ours\t'Resolve conflicts in favour of local version' + theirs\t'Resolve conflicts in favour of remote version' + union\t'Resolve conflicts by concatenating local and remote versions' + cat_sort_uniq\t'Concatenate, sort and remove duplicate lines' + " +complete -f -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from merge" -l commit -d 'Finalize git notes merge' +complete -f -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from merge" -l abort -d 'Abort git notes merge' +complete -f -c git -n "__fish_git_using_command notes; and __fish_seen_subcommand_from remove" -l ignore-missing -d 'Do not throw error on deleting non-existing object note' + +### prune +complete -f -c git -n __fish_git_needs_command -a prune -d 'Prune all unreachable objects from the object database' +# TODO options + +### pull +complete -f -c git -n __fish_git_needs_command -a pull -d 'Fetch from and merge with another repository or a local branch' +complete -f -c git -n '__fish_git_using_command pull' -s q -l quiet -d 'Be quiet' +complete -f -c git -n '__fish_git_using_command pull' -s v -l verbose -d 'Be verbose' +# Options related to fetching +complete -f -c git -n '__fish_git_using_command pull' -l all -d 'Fetch all remotes' +complete -f -c git -n '__fish_git_using_command pull' -s a -l append -d 'Append ref names and object names' +complete -f -c git -n '__fish_git_using_command pull' -s f -l force -d 'Force update of local branches' +complete -f -c git -n '__fish_git_using_command pull' -s k -l keep -d 'Keep downloaded pack' +complete -f -c git -n '__fish_git_using_command pull' -l no-tags -d 'Disable automatic tag following' +complete -f -c git -n '__fish_git_using_command pull' -s p -l prune -d 'Remove remote-tracking references that no longer exist on the remote' +# TODO --upload-pack +complete -f -c git -n '__fish_git_using_command pull' -l progress -d 'Force progress status' +complete -f -c git -n '__fish_git_using_command pull; and not __fish_git_branch_for_remote' -a '(__fish_git_remotes)' -d 'Remote alias' +complete -f -c git -n '__fish_git_using_command pull; and __fish_git_branch_for_remote' -a '(__fish_git_branch_for_remote)' +# Options related to merging +complete -f -c git -n '__fish_git_using_command pull' -l commit -d "Autocommit the merge" +complete -f -c git -n '__fish_git_using_command pull' -l no-commit -d "Don't autocommit the merge" +complete -f -c git -n '__fish_git_using_command pull' -s e -l edit -d 'Edit auto-generated merge message' +complete -f -c git -n '__fish_git_using_command pull' -l no-edit -d "Don't edit auto-generated merge message" +complete -f -c git -n '__fish_git_using_command pull' -l ff -d "Don't generate a merge commit if merge is fast-forward" +complete -f -c git -n '__fish_git_using_command pull' -l no-ff -d "Generate a merge commit even if merge is fast-forward" +complete -f -c git -n '__fish_git_using_command pull' -l ff-only -d 'Refuse to merge unless fast-forward possible' +complete -f -c git -n '__fish_git_using_command pull' -s S -l gpg-sign -d 'GPG-sign the merge commit' +complete -f -c git -n '__fish_git_using_command pull' -l log -d 'Populate the log message with one-line descriptions' +complete -f -c git -n '__fish_git_using_command pull' -l no-log -d "Don't populate the log message with one-line descriptions" +complete -f -c git -n '__fish_git_using_command pull' -l signoff -d 'Add Signed-off-by line at the end of the merge commit message' +complete -f -c git -n '__fish_git_using_command pull' -l no-signoff -d 'Do not add a Signed-off-by line at the end of the merge commit message' +complete -f -c git -n '__fish_git_using_command pull' -l stat -d "Show diffstat of the merge" +complete -f -c git -n '__fish_git_using_command pull' -s n -l no-stat -d "Don't show diffstat of the merge" +complete -f -c git -n '__fish_git_using_command pull' -l squash -d "Squash changes from upstream branch as a single commit" +complete -f -c git -n '__fish_git_using_command pull' -l no-squash -d "Don't squash changes" +complete -x -c git -n '__fish_git_using_command pull' -s s -l strategy -d 'Use the given merge strategy' +complete -r -c git -n '__fish_git_using_command pull' -s X -l strategy-option -d 'Pass given option to the merge strategy' +complete -f -c git -n '__fish_git_using_command pull' -l verify-signatures -d 'Abort merge if upstream branch tip commit is not signed with a valid key' +complete -f -c git -n '__fish_git_using_command pull' -l no-verify-signatures -d 'Do not abort merge if upstream branch tip commit is not signed with a valid key' +complete -f -c git -n '__fish_git_using_command pull' -l allow-unrelated-histories -d 'Allow merging even when branches do not share a common history' +complete -f -c git -n '__fish_git_using_command pull' -s r -l rebase -d 'Rebase the current branch on top of the upstream branch' +complete -f -c git -n '__fish_git_using_command pull' -l no-rebase -d 'Do not rebase the current branch on top of the upstream branch' +complete -f -c git -n '__fish_git_using_command pull' -l autostash -d 'Before starting rebase, stash local changes, and apply stash when done' +complete -f -c git -n '__fish_git_using_command pull' -l no-autostash -d 'Do not stash local changes before starting rebase' +# TODO other options + +### range-diff +complete -f -c git -n __fish_git_needs_command -a range-diff -d 'Compare two commit ranges (e.g. two versions of a branch)' +complete -f -c git -n '__fish_git_using_command range-diff' -ka '(__fish_git_ranges)' +complete -f -c git -n '__fish_git_using_command range-diff' -l creation-factor -d 'Percentage by which creation is weighted' +complete -f -c git -n '__fish_git_using_command range-diff' -l no-dual-color -d 'Use simple diff colors' + + +### push +complete -f -c git -n __fish_git_needs_command -a push -d 'Update remote refs along with associated objects' +complete -f -c git -n '__fish_git_using_command push; and not __fish_git_branch_for_remote' -a '(__fish_git_remotes)' -d 'Remote alias' +complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_remote' -ka '(__fish_git_tags)' -d Tag +complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_remote' -ka '(__fish_git_branches)' +complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_remote' -ka '(__fish_git_heads)' +# The "refspec" here is an optional "+" to signify a force-push +complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_remote; and string match -q "+*" -- (commandline -ct)' -a '+(__fish_git_branches | string replace -r \t".*" "")' -d 'Force-push branch' +# git push REMOTE :BRANCH deletes BRANCH on remote REMOTE +complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_remote; and string match -q ":*" -- (commandline -ct)' -a ':(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Delete remote branch' +# then src:dest (where both src and dest are git objects, so we want to complete branches) +complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_remote; and string match -q "+*:*" -- (commandline -ct)' -a '(commandline -ct | string replace -r ":.*" ""):(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Force-push local branch to remote branch' +complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_remote; and string match -q "*:*" -- (commandline -ct)' -a '(commandline -ct | string replace -r ":.*" ""):(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Push local branch to remote branch' +complete -f -c git -n '__fish_git_using_command push' -l all -d 'Push all refs under refs/heads/' +complete -f -c git -n '__fish_git_using_command push' -l prune -d "Remove remote branches that don't have a local counterpart" +complete -f -c git -n '__fish_git_using_command push' -l mirror -d 'Push all refs under refs/' +complete -f -c git -n '__fish_git_using_command push' -l delete -d 'Delete all listed refs from the remote repository' +complete -f -c git -n '__fish_git_using_command push' -l tags -d 'Push all refs under refs/tags' +complete -f -c git -n '__fish_git_using_command push' -l follow-tags -d 'Push all usual refs plus the ones under refs/tags' +complete -f -c git -n '__fish_git_using_command push' -s n -l dry-run -d 'Do everything except actually send the updates' +complete -f -c git -n '__fish_git_using_command push' -l porcelain -d 'Produce machine-readable output' +complete -f -c git -n '__fish_git_using_command push' -s f -l force -d 'Force update of remote refs' +complete -f -c git -n '__fish_git_using_command push' -s f -l force-with-lease -d 'Force update of remote refs, stopping if other\'s changes would be overwritten' +complete -f -c git -n '__fish_git_using_command push' -s u -l set-upstream -d 'Add upstream (tracking) reference' +complete -f -c git -n '__fish_git_using_command push' -s q -l quiet -d 'Be quiet' +complete -f -c git -n '__fish_git_using_command push' -s v -l verbose -d 'Be verbose' +complete -f -c git -n '__fish_git_using_command push' -l progress -d 'Force progress status' +# TODO --recurse-submodules=check|on-demand + +### rebase +complete -f -c git -n __fish_git_needs_command -a rebase -d 'Forward-port local commits to the updated upstream head' +complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_remotes)' -d 'Remote alias' +complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_branches)' +complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_heads)' -d Head +complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_recent_commits)' +complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_tags)' -d Tag +complete -f -c git -n '__fish_git_using_command rebase; and __fish_git_is_rebasing' -l continue -d 'Restart the rebasing process' +complete -f -c git -n '__fish_git_using_command rebase; and __fish_git_is_rebasing' -l abort -d 'Abort the rebase operation' +complete -f -c git -n '__fish_git_using_command rebase; and __fish_git_is_rebasing' -l edit-todo -d 'Edit the todo list' +complete -f -c git -n '__fish_git_using_command rebase' -l keep-empty -d "Keep the commits that don't change anything" +complete -f -c git -n '__fish_git_using_command rebase; and __fish_git_is_rebasing' -l skip -d 'Restart the rebasing process by skipping the current patch' +complete -f -c git -n '__fish_git_using_command rebase' -s m -l merge -d 'Use merging strategies to rebase' +complete -f -c git -n '__fish_git_using_command rebase' -s q -l quiet -d 'Be quiet' +complete -f -c git -n '__fish_git_using_command rebase' -s v -l verbose -d 'Be verbose' +complete -f -c git -n '__fish_git_using_command rebase' -l stat -d "Show diffstat of the rebase" +complete -f -c git -n '__fish_git_using_command rebase' -s n -l no-stat -d "Don't show diffstat of the rebase" +complete -f -c git -n '__fish_git_using_command rebase' -l verify -d "Allow the pre-rebase hook to run" +complete -f -c git -n '__fish_git_using_command rebase' -l no-verify -d "Don't allow the pre-rebase hook to run" +complete -f -c git -n '__fish_git_using_command rebase' -s f -l force-rebase -d 'Force the rebase' +complete -f -c git -n '__fish_git_using_command rebase' -l committer-date-is-author-date -d "Use the author date as the committer date" +complete -f -c git -n '__fish_git_using_command rebase' -l ignore-date -d "Use the committer date as the author date" +complete -f -c git -n '__fish_git_using_command rebase' -s i -l interactive -d 'Interactive mode' +complete -f -c git -n '__fish_git_using_command rebase' -s p -l preserve-merges -d 'Try to recreate merges' +complete -f -c git -n '__fish_git_using_command rebase' -s r -l rebase-merges -a 'rebase-cousins no-rebase-cousins' -d 'Preserve branch structure' +complete -f -c git -n '__fish_git_using_command rebase' -l root -d 'Rebase all reachable commits' +complete -f -c git -n '__fish_git_using_command rebase' -l autosquash -d 'Automatic squashing' +complete -f -c git -n '__fish_git_using_command rebase' -l no-autosquash -d 'No automatic squashing' +complete -f -c git -n '__fish_git_using_command rebase' -l autostash -d 'Before starting rebase, stash local changes, and apply stash when done' +complete -f -c git -n '__fish_git_using_command rebase' -l no-autostash -d 'Do not stash local changes before starting rebase' +complete -f -c git -n '__fish_git_using_command rebase' -l no-ff -d 'No fast-forward' +# This actually takes script for $SHELL, but completing that is... complicated. +complete -r -c git -n '__fish_git_using_command rebase' -l exec -d 'Execute shellscript' + +### reflog +set -l reflogcommands show expire delete exists +complete -f -c git -n __fish_git_needs_command -a reflog -d 'Manage reflog information' +complete -f -c git -n '__fish_git_using_command reflog' -a '(__fish_git_branches)' +complete -f -c git -n '__fish_git_using_command reflog' -a '(__fish_git_heads)' -d Head + +complete -f -c git -n "__fish_git_using_command reflog; and not __fish_seen_subcommand_from $reflogcommands" -a "$reflogcommands" + +### reset +complete -c git -n __fish_git_needs_command -a reset -d 'Reset current HEAD to the specified state' +complete -f -c git -n '__fish_git_using_command reset' -l hard -d 'Reset the index and the working tree' +complete -f -c git -n '__fish_git_using_command reset' -l soft -d 'Reset head without touching the index or the working tree' +complete -f -c git -n '__fish_git_using_command reset' -l mixed -d 'The default: reset the index but not the working tree' +complete -c git -n '__fish_git_using_command reset; and not contains -- -- (commandline -opc)' -a '(__fish_git_branches)' +# reset can either undo changes to versioned modified files, +# or remove files from the staging area. +# Deleted files seem to need a "--" separator. +complete -f -c git -n '__fish_git_using_command reset; and not contains -- -- (commandline -opc)' -a '(__fish_git_files all-staged modified)' +complete -f -c git -n '__fish_git_using_command reset; and contains -- -- (commandline -opc)' -a '(__fish_git_files all-staged deleted modified)' +complete -f -c git -n '__fish_git_using_command reset; and not contains -- -- (commandline -opc)' -a '(__fish_git_reflog)' -d Reflog +# TODO options + +### restore and switch +# restore options +complete -f -c git -n __fish_git_needs_command -a restore -d 'Restore working tree files' +complete -f -c git -n '__fish_git_using_command restore' -r -s s -l source -d 'Specify the source tree used to restore the working tree' -k -a '(__fish_git_refs)' +complete -f -c git -n '__fish_git_using_command restore' -s p -l patch -d 'Interactive mode' +complete -f -c git -n '__fish_git_using_command restore' -s W -l worktree -d 'Restore working tree (default)' +complete -f -c git -n '__fish_git_using_command restore' -s S -l staged -d 'Restore the index' +complete -f -c git -n '__fish_git_using_command restore' -l ours -d 'When restoring files, use stage #2 (ours)' +complete -f -c git -n '__fish_git_using_command restore' -l theirs -d 'When restoring files, use stage #3 (theirs)' +complete -f -c git -n '__fish_git_using_command restore' -s m -l merge -d 'Recreate the conflicted merge in the unmerged paths when restoring files' +complete -f -c git -n '__fish_git_using_command restore' -l ignore-unmerged -d 'When restoring files, do not abort the operation if there are unmerged entries' +complete -f -c git -n '__fish_git_using_command restore' -l ignore-skip-worktree-bits -d 'Ignore the sparse-checkout file and unconditionally restore any files in <pathspec>' +complete -f -c git -n '__fish_git_using_command restore' -l overlay -d 'Never remove files when restoring' +complete -f -c git -n '__fish_git_using_command restore' -l no-overlay -d 'Remove files when restoring (default)' +complete -f -c git -n '__fish_git_using_command restore; and not contains -- --staged (commandline -opc)' -a '(__fish_git_files modified deleted modified-staged-deleted unmerged)' +complete -f -c git -n '__fish_git_using_command restore; and contains -- --staged (commandline -opc)' -a '(__fish_git_files added modified-staged deleted-staged renamed copied)' +complete -F -c git -n '__fish_git_using_command restore; and __fish_contains_opt -s s source' +# switch options +complete -f -c git -n __fish_git_needs_command -a switch -d 'Switch to a branch' +complete -k -f -c git -n '__fish_git_using_command switch' -a '(__fish_git_unique_remote_branches)' -d 'Unique Remote Branch' +complete -k -f -c git -n '__fish_git_using_command switch' -a '(__fish_git_local_branches)' +complete -f -c git -n '__fish_git_using_command switch' -r -s c -l create -d 'Create a new branch' +complete -f -c git -n '__fish_git_using_command switch' -r -s C -l force-create -d 'Force create a new branch' +complete -f -c git -n '__fish_git_using_command switch' -s d -l detach -d 'Switch to a commit for inspection and discardable experiment' -k -ra '(__fish_git_refs)' +complete -f -c git -n '__fish_git_using_command switch' -l guess -d 'Guess branch name from remote branch (default)' +complete -f -c git -n '__fish_git_using_command switch' -l no-guess -d 'Do not guess branch name from remote branch' +complete -f -c git -n '__fish_git_using_command switch' -s f -l force -l discard-changes -d 'Proceed even if the index or the working tree differs from HEAD' +complete -f -c git -n '__fish_git_using_command switch' -s m -l merge -d 'Merge the current branch and contents of the working tree into a new branch' +complete -f -c git -n '__fish_git_using_command switch' -s t -l track -d 'Track remote branch when creating a new branch' +complete -f -c git -n '__fish_git_using_command switch' -l no-track -d 'Do not track remote branch when creating a new branch' +complete -f -c git -n '__fish_git_using_command switch' -r -l orphan -d 'Create a new orphan branch' +complete -f -c git -n '__fish_git_using_command switch' -l ignore-other-worktrees -d 'Force check out of the reference' +complete -f -c git -n '__fish_git_using_command switch' -l recurse-submodules -d 'Update the work trees of submodules' +complete -f -c git -n '__fish_git_using_command switch' -l no-recurse-submodules -d 'Do not update the work trees of submodules' +# common options +complete -f -c git -n '__fish_git_using_command restore switch' -s q -l quiet -d 'Suppress messages' +complete -f -c git -n '__fish_git_using_command restore switch' -l progress -d 'Report progress status to stderr (default)' +complete -f -c git -n '__fish_git_using_command restore switch' -l no-progress -d 'Do not report progress status to stderr' +complete -f -c git -n '__fish_git_using_command restore switch' -l 'conflict=merge' -d 'Same as --merge, but specify \'merge\' as the conflicting hunk style (default)' +complete -f -c git -n '__fish_git_using_command restore switch' -l 'conflict=diff3' -d 'Same as --merge, but specify \'diff3\' as the conflicting hunk style' + +### rev-parse +complete -f -c git -n __fish_git_needs_command -a rev-parse -d 'Pick out and massage parameters' +complete -f -c git -n '__fish_git_using_command rev-parse' -a '(__fish_git_branches)' +complete -f -c git -n '__fish_git_using_command rev-parse' -a '(__fish_git_heads)' -d Head +complete -k -c git -n '__fish_git_using_command rev-parse' -a '(__fish_git_tags)' -d Tag +complete -c git -n '__fish_git_using_command rev-parse' -l abbrev-ref -d 'Output non-ambiguous short object names' + +### revert +complete -f -c git -n __fish_git_needs_command -a revert -d 'Revert an existing commit' +complete -f -c git -n '__fish_git_using_command revert' -ka '(__fish_git_commits)' +complete -f -c git -n '__fish_git_using_command revert' -l continue -d 'Continue the operation in progress' +complete -f -c git -n '__fish_git_using_command revert' -l abort -d 'Cancel the operation' +complete -f -c git -n '__fish_git_using_command revert' -l skip -d 'Skip the current commit and continue with the rest of the sequence' +# TODO options + +### rm +complete -c git -n __fish_git_needs_command -a rm -d 'Remove files from the working tree and the index' +complete -c git -n '__fish_git_using_command rm' -l cached -d 'Unstage files from the index' +complete -c git -n '__fish_git_using_command rm; and __fish_contains_opt cached' -f -a '(__fish_git_files all-staged)' +complete -c git -n '__fish_git_using_command rm' -l ignore-unmatch -d 'Exit with a zero status even if no files matched' +complete -c git -n '__fish_git_using_command rm' -s r -d 'Allow recursive removal' +complete -c git -n '__fish_git_using_command rm' -s q -l quiet -d 'Be quiet' +complete -c git -n '__fish_git_using_command rm' -s f -l force -d 'Override the up-to-date check' +complete -c git -n '__fish_git_using_command rm' -s n -l dry-run -d 'Dry run' +# TODO options + +### status +complete -f -c git -n __fish_git_needs_command -a status -d 'Show the working tree status' +complete -f -c git -n '__fish_git_using_command status' -s s -l short -d 'Give the output in the short-format' +complete -f -c git -n '__fish_git_using_command status' -s b -l branch -d 'Show the branch and tracking info even in short-format' +complete -f -c git -n '__fish_git_using_command status' -l porcelain -d 'Give the output in a stable, easy-to-parse format' +complete -f -c git -n '__fish_git_using_command status' -s z -d 'Terminate entries with null character' +complete -f -c git -n '__fish_git_using_command status' -s u -l untracked-files -x -a 'no normal all' -d 'The untracked files handling mode' +complete -f -c git -n '__fish_git_using_command status' -l ignore-submodules -x -a 'none untracked dirty all' -d 'Ignore changes to submodules' +# TODO options + +### stripspace +complete -f -c git -n __fish_git_needs_command -a stripspace -d 'Remove unnecessary whitespace' +complete -f -c git -n '__fish_git_using_command stripspace' -s s -l strip-comments -d 'Strip all lines starting with comment character' +complete -f -c git -n '__fish_git_using_command stripspace' -s c -l comment-lines -d 'Prepend comment character to each line' + +### tag +complete -f -c git -n __fish_git_needs_command -a tag -d 'Create, list, delete or verify a tag object signed with GPG' +complete -f -c git -n '__fish_git_using_command tag; and __fish_not_contain_opt -s d; and __fish_not_contain_opt -s v; and test (count (commandline -opc | string match -r -v \'^-\')) -eq 3' -a '(__fish_git_branches)' +complete -f -c git -n '__fish_git_using_command tag' -s a -l annotate -d 'Make an unsigned, annotated tag object' +complete -f -c git -n '__fish_git_using_command tag' -s s -l sign -d 'Make a GPG-signed tag' +complete -f -c git -n '__fish_git_using_command tag' -s d -l delete -d 'Remove a tag' +complete -f -c git -n '__fish_git_using_command tag' -s v -l verify -d 'Verify signature of a tag' +complete -f -c git -n '__fish_git_using_command tag' -s f -l force -d 'Force overwriting existing tag' +complete -f -c git -n '__fish_git_using_command tag' -s l -l list -d 'List tags' +complete -f -c git -n '__fish_git_using_command tag' -l contains -xka '(__fish_git_commits)' -d 'List tags that contain a commit' +complete -f -c git -n '__fish_git_using_command tag; and __fish_contains_opt -s d delete -s v verify' -a '(__fish_git_tags)' -d Tag +# TODO options + +### worktree +set -l git_worktree_commands add list lock move prune remove unlock +complete -c git -n __fish_git_needs_command -a worktree -d 'Manage multiple working trees' +complete -f -c git -n "__fish_git_using_command worktree; and not __fish_seen_subcommand_from $git_worktree_commands" -a add -d 'Create a working tree' +complete -f -c git -n "__fish_git_using_command worktree; and not __fish_seen_subcommand_from $git_worktree_commands" -a list -d 'List details of each worktree' +complete -f -c git -n "__fish_git_using_command worktree; and not __fish_seen_subcommand_from $git_worktree_commands" -a lock -d 'Lock a working tree' +complete -f -c git -n "__fish_git_using_command worktree; and not __fish_seen_subcommand_from $git_worktree_commands" -a move -d 'Move a working tree to a new location' +complete -f -c git -n "__fish_git_using_command worktree; and not __fish_seen_subcommand_from $git_worktree_commands" -a prune -d 'Prune working tree information in $GIT_DIR/worktrees' +complete -f -c git -n "__fish_git_using_command worktree; and not __fish_seen_subcommand_from $git_worktree_commands" -a remove -d 'Remove a working tree' +complete -f -c git -n "__fish_git_using_command worktree; and not __fish_seen_subcommand_from $git_worktree_commands" -a unlock -d 'Unlock a working tree' + +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add move remove' -s f -l force -d 'Override safeguards' + +complete -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' +complete -k -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -a '(__fish_git_branches)' +complete -k -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -a '(__fish_git_heads)' -d Head +complete -k -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -a '(__fish_git_tags)' -d Tag +complete -k -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -a '(__fish_git_unique_remote_branches)' -d 'Unique Remote Branch' +complete -k -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -a '(__fish_git_local_branches)' +complete -x -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -s b -d 'Create a new branch' +complete -x -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -s B -d 'Create a new branch even if it already exists' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -l detach -d 'Detach HEAD in the new working tree' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -l checkout -d 'Checkout <commit-ish> after creating working tree' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -l no-checkout -d 'Suppress checkout' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -l guess-remote +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -l no-guess-remote +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -l track -d 'Mark <commit-ish> as "upstream" from the new branch' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -l no-track -d 'Don\'t mark <commit-ish> as "upstream" from the new branch' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -l lock -d 'Lock working tree after creation' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from add' -s q -l quiet -d 'Suppress feedback messages' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from list' -l porcelain -d 'Output in an easy-to-parse format for scripts' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from lock' -a '(__fish_git_complete_worktrees)' -d Worktree +complete -x -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from lock' -l reason -d 'An explanation why the working tree is locked' +complete -x -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from move; and not __fish_any_arg_in (__fish_git_complete_worktrees)' -a '(__fish_git_complete_worktrees)' -d Worktree +complete -x -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from move; and __fish_any_arg_in (__fish_git_complete_worktrees)' -a '(__fish_complete_directories)' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from prune' -s n -l dry-run -d 'Do not remove anything' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from prune' -s v -l verbose -d 'Report all removals' +complete -x -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from prune' -l expire -d 'Only expire unused working trees older than <time>' +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from remove' -a '(__fish_git_complete_worktrees)' -d Worktree +complete -f -c git -n '__fish_git_using_command worktree; and __fish_seen_subcommand_from unlock' -a '(__fish_git_complete_worktrees)' -d Worktree + +### stash +complete -c git -n __fish_git_needs_command -a stash -d 'Stash away changes' +complete -f -c git -n '__fish_git_using_command stash; and __fish_git_stash_not_using_subcommand' -a list -d 'List stashes' +complete -f -c git -n '__fish_git_using_command stash; and __fish_git_stash_not_using_subcommand' -a show -d 'Show the changes recorded in the stash' +complete -f -c git -n '__fish_git_using_command stash; and __fish_git_stash_not_using_subcommand' -a pop -d 'Apply and remove a single stashed state' +complete -f -c git -n '__fish_git_using_command stash; and __fish_git_stash_not_using_subcommand' -a apply -d 'Apply a single stashed state' +complete -f -c git -n '__fish_git_using_command stash; and __fish_git_stash_not_using_subcommand' -a clear -d 'Remove all stashed states' +complete -f -c git -n '__fish_git_using_command stash; and __fish_git_stash_not_using_subcommand' -a drop -d 'Remove a single stashed state from the stash list' +complete -f -c git -n '__fish_git_using_command stash; and __fish_git_stash_not_using_subcommand' -a create -d 'Create a stash' +complete -f -c git -n '__fish_git_using_command stash; and __fish_git_stash_not_using_subcommand' -a save -d 'Save a new stash' +complete -f -c git -n '__fish_git_using_command stash; and __fish_git_stash_not_using_subcommand' -a branch -d 'Create a new branch from a stash' +complete -f -c git -n '__fish_git_using_command stash; and __fish_git_stash_not_using_subcommand' -a push -d 'Create a new stash with given files' + +complete -f -c git -n '__fish_git_stash_using_command apply' -a '(__fish_git_complete_stashes)' +complete -f -c git -n '__fish_git_stash_using_command branch' -a '(__fish_git_complete_stashes)' +complete -f -c git -n '__fish_git_stash_using_command drop' -a '(__fish_git_complete_stashes)' +complete -f -c git -n '__fish_git_stash_using_command pop' -a '(__fish_git_complete_stashes)' +complete -f -c git -n '__fish_git_stash_using_command show' -a '(__fish_git_complete_stashes)' + +complete -f -c git -n '__fish_git_stash_using_command push' -a '(__fish_git_files modified deleted modified-staged-deleted)' +complete -f -c git -n '__fish_git_stash_using_command push' -s p -l patch -d 'Interactively select hunks' +complete -f -c git -n '__fish_git_stash_using_command push' -s m -l message -d 'Add a description' + +### config +complete -f -c git -n __fish_git_needs_command -a config -d 'Set and read git configuration variables' +# TODO options + +### format-patch +complete -f -c git -n __fish_git_needs_command -a format-patch -d 'Generate patch series to send upstream' +complete -f -c git -n '__fish_git_using_command format-patch' -a '(__fish_git_branches)' +complete -c git -n '__fish_git_using_command format-patch' -s o -l output-directory -xa '(__fish_complete_directories)' +complete -f -c git -n '__fish_git_using_command format-patch' -s p -l no-stat -d "Generate plain patches without diffstat" +complete -f -c git -n '__fish_git_using_command format-patch' -s s -l no-patch -d "Suppress diff output" +complete -f -c git -n '__fish_git_using_command format-patch' -l minimal -d "Spend more time to create smaller diffs" +complete -f -c git -n '__fish_git_using_command format-patch' -l patience -d "Generate diff with the 'patience' algorithm" +complete -f -c git -n '__fish_git_using_command format-patch' -l histogram -d "Generate diff with the 'histogram' algorithm" +complete -f -c git -n '__fish_git_using_command format-patch' -l stdout -d "Print all commits to stdout in mbox format" +complete -f -c git -n '__fish_git_using_command format-patch' -l numstat -d "Show number of added/deleted lines in decimal notation" +complete -f -c git -n '__fish_git_using_command format-patch' -l shortstat -d "Output only last line of the stat" +complete -f -c git -n '__fish_git_using_command format-patch' -l summary -d "Output a condensed summary of extended header information" +complete -f -c git -n '__fish_git_using_command format-patch' -l no-renames -d "Disable rename detection" +complete -f -c git -n '__fish_git_using_command format-patch' -l full-index -d "Show full blob object names" +complete -f -c git -n '__fish_git_using_command format-patch' -l binary -d "Output a binary diff for use with git apply" +complete -f -c git -n '__fish_git_using_command format-patch log' -l find-copies-harder -d "Also inspect unmodified files as source for a copy" +complete -f -c git -n '__fish_git_using_command format-patch' -l text -s a -d "Treat all files as text" +complete -f -c git -n '__fish_git_using_command format-patch log' -l ignore-space-at-eol -d "Ignore changes in whitespace at EOL" +complete -f -c git -n '__fish_git_using_command format-patch log' -l ignore-space-change -s b -d "Ignore changes in amount of whitespace" +complete -f -c git -n '__fish_git_using_command format-patch log' -l ignore-all-space -s w -d "Ignore whitespace when comparing lines" +complete -f -c git -n '__fish_git_using_command format-patch log' -l ignore-blank-lines -d "Ignore changes whose lines are all blank" +complete -f -c git -n '__fish_git_using_command format-patch log' -l function-context -s W -d "Show whole surrounding functions of changes" +complete -f -c git -n '__fish_git_using_command format-patch log' -l ext-diff -d "Allow an external diff helper to be executed" +complete -f -c git -n '__fish_git_using_command format-patch log' -l no-ext-diff -d "Disallow external diff helpers" +complete -f -c git -n '__fish_git_using_command format-patch log' -l no-textconv -d "Disallow external text conversion filters for binary files (Default)" +complete -f -c git -n '__fish_git_using_command format-patch log' -l textconv -d "Allow external filters for binary files (Resulting diff is unappliable)" +complete -f -c git -n '__fish_git_using_command format-patch log' -l no-prefix -d "Do not show source or destination prefix" +complete -f -c git -n '__fish_git_using_command format-patch' -l numbered -s n -d "Name output in [Patch n/m] format, even with a single patch" +complete -f -c git -n '__fish_git_using_command format-patch' -l no-numbered -s N -d "Name output in [Patch] format, even with multiple patches" + + +## git submodule +set -l submodulecommands add status init deinit update set-branch set-url summary foreach sync absorbgitdirs +complete -f -c git -n __fish_git_needs_command -a submodule -d 'Initialize, update or inspect submodules' +complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a add -d 'Add a submodule' +complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a status -d 'Show submodule status' +complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a init -d 'Initialize all submodules' +complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a deinit -d 'Unregister the given submodules' +complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a update -d 'Update all submodules' +complete -x -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a set-branch -d 'Sets the default remote tracking branch for the submodule' +complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a set-url -d 'Sets the URL of the specified submodule' +complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a summary -d 'Show commit summary' +complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a foreach -d 'Run command on each submodule' +complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a sync -d 'Sync submodules\' URL with .gitmodules' +complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a absorbgitdirs -d 'Move submodule\'s git directory to current .git/module directory' +complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -s q -l quiet -d "Only print error messages" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from update' -l init -d "Initialize all submodules" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from update' -l checkout -d "Checkout the superproject's commit on a detached HEAD in the submodule" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from update' -l merge -d "Merge the superproject's commit into the current branch of the submodule" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from update' -l rebase -d "Rebase current branch onto the superproject's commit" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from update' -s N -l no-fetch -d "Don't fetch new objects from the remote" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from update' -l remote -d "Instead of using superproject's SHA-1, use the state of the submodule's remote-tracking branch" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from update' -l force -d "Discard local changes when switching to a different commit & always run checkout" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from add' -l force -d "Also add ignored submodule path" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from deinit' -l force -d "Remove even with local changes" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from deinit' -l all -d "Remove all submodules" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from deinit; and not contains -- -- (commandline -opc)' -a '(__fish_git_submodules)' -d Submodule +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from set-branch' -s b -l branch -d "Specify the branch to use" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from set-branch' -s d -l default -d "Use default branch of the submodule" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from status summary' -l cached -d "Use the commit stored in the index" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from status; and not contains -- -- (commandline -opc)' -a '(__fish_git_submodules)' -d Submodule +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from summary' -l files -d "Compare the commit in the index with submodule HEAD" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from foreach update status' -l recursive -d "Traverse submodules recursively" +complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from foreach' -a "(__fish_complete_subcommand --fcs-skip=3)" + +## git whatchanged +complete -f -c git -n __fish_git_needs_command -a whatchanged -d 'Show logs with difference each commit introduces' + +## Aliases (custom user-defined commands) +complete -c git -n __fish_git_needs_command -a '(__fish_git_aliases)' + +### git clean +complete -f -c git -n __fish_git_needs_command -a clean -d 'Remove untracked files from the working tree' +complete -f -c git -n '__fish_git_using_command clean' -s f -l force -d 'Force run' +complete -f -c git -n '__fish_git_using_command clean' -s i -l interactive -d 'Show what would be done and clean files interactively' +complete -f -c git -n '__fish_git_using_command clean' -s n -l dry-run -d 'Don\'t actually remove anything, just show what would be done' +complete -f -c git -n '__fish_git_using_command clean' -s q -l quiet -d 'Be quiet, only report errors' +complete -f -c git -n '__fish_git_using_command clean' -s d -d 'Remove untracked directories in addition to untracked files' +complete -f -c git -n '__fish_git_using_command clean' -s x -d 'Remove ignored files, as well' +complete -f -c git -n '__fish_git_using_command clean' -s X -d 'Remove only ignored files' +# TODO -e option + +### git blame +complete -f -c git -n __fish_git_needs_command -a blame -d 'Show what revision and author last modified each line of a file' +complete -f -c git -n '__fish_git_using_command blame' -s b -d 'Show blank SHA-1 for boundary commits' +complete -f -c git -n '__fish_git_using_command blame' -l root -d 'Do not treat root commits as boundaries' +complete -f -c git -n '__fish_git_using_command blame' -l show-stats -d 'Include additional statistics' +complete -f -c git -n '__fish_git_using_command blame' -s L -d 'Annotate only the given line range' +complete -f -c git -n '__fish_git_using_command blame' -s l -d 'Show long rev' +complete -f -c git -n '__fish_git_using_command blame' -s t -d 'Show raw timestamp' +complete -r -c git -n '__fish_git_using_command blame' -s S -d 'Use revisions from named file instead of calling rev-list' +complete -f -c git -n '__fish_git_using_command blame' -l reverse -d 'Walk history forward instead of backward' +complete -f -c git -n '__fish_git_using_command blame' -s p -l porcelain -d 'Show in a format designed for machine consumption' +complete -f -c git -n '__fish_git_using_command blame' -l line-porcelain -d 'Show the porcelain format' +complete -f -c git -n '__fish_git_using_command blame' -l incremental -d 'Show the result incrementally' +complete -r -c git -n '__fish_git_using_command blame' -l contents -d 'Instead of working tree, use the contents of the named file' +complete -x -c git -n '__fish_git_using_command blame' -l date -d 'Specifies the format used to output dates' +complete -f -c git -n '__fish_git_using_command blame' -s M -d 'Detect moved or copied lines within a file' +complete -f -c git -n '__fish_git_using_command blame' -s C -d 'Detect lines moved or copied from other files modified in the same commit' +complete -f -c git -n '__fish_git_using_command blame' -s h -d 'Show help message' +complete -f -c git -n '__fish_git_using_command blame' -s c -d 'Use the same output mode as git-annotate' +complete -f -c git -n '__fish_git_using_command blame' -s f -l show-name -d 'Show the filename in the original commit' +complete -f -c git -n '__fish_git_using_command blame' -s n -l show-number -d 'Show the line number in the original commit' +complete -f -c git -n '__fish_git_using_command blame' -s s -d 'Suppress the author name and timestamp from the output' +complete -f -c git -n '__fish_git_using_command blame' -s e -l show-email -d 'Show the author email instead of author name' +complete -f -c git -n '__fish_git_using_command blame' -s w -d 'Ignore whitespace changes' + +### help +complete -f -c git -n __fish_git_needs_command -a help -d 'Display help information about Git' +complete -f -c git -n '__fish_git_using_command help' -a '(__fish_git_help_all_concepts)' +complete -f -c git -n '__fish_git_using_command help' -a add -d 'Add file contents to the index' +complete -f -c git -n '__fish_git_using_command help' -a am -d 'Apply a series of patches from a mailbox' +complete -f -c git -n '__fish_git_using_command help' -a apply -d 'Apply a patch on a git index file and a working tree' +complete -f -c git -n '__fish_git_using_command help' -a archive -d 'Create an archive of files from a named tree' +complete -f -c git -n '__fish_git_using_command help' -a bisect -d 'Find the change that introduced a bug by binary search' +complete -f -c git -n '__fish_git_using_command help' -a blame -d 'Show what revision and author last modified each line of a file' +complete -f -c git -n '__fish_git_using_command help' -a branch -d 'List, create, or delete branches' +complete -f -c git -n '__fish_git_using_command help' -a checkout -d 'Checkout and switch to a branch' +complete -f -c git -n '__fish_git_using_command help' -a cherry-pick -d 'Apply the change introduced by an existing commit' +complete -f -c git -n '__fish_git_using_command help' -a clean -d 'Remove untracked files from the working tree' +complete -f -c git -n '__fish_git_using_command help' -a clone -d 'Clone a repository into a new directory' +complete -f -c git -n '__fish_git_using_command help' -a commit -d 'Record changes to the repository' +complete -f -c git -n '__fish_git_using_command help' -a config -d 'Set and read git configuration variables' +complete -f -c git -n '__fish_git_using_command help' -a count-objects -d 'Count unpacked number of objects and their disk consumption' +complete -f -c git -n '__fish_git_using_command help' -a describe -d 'Give an object a human-readable name' +complete -f -c git -n '__fish_git_using_command help' -a diff -d 'Show changes between commits, commit and working tree, etc' +complete -f -c git -n '__fish_git_using_command help' -a daemon -d 'A really simple server for Git repositories' +complete -f -c git -n '__fish_git_using_command help' -a difftool -d 'Open diffs in a visual tool' +complete -f -c git -n '__fish_git_using_command help' -a fetch -d 'Download objects and refs from another repository' +complete -f -c git -n '__fish_git_using_command help' -a filter-branch -d 'Rewrite branches' +complete -f -c git -n '__fish_git_using_command help' -a format-patch -d 'Generate patch series to send upstream' +complete -f -c git -n '__fish_git_using_command help' -a gc -d 'Cleanup unnecessary files and optimize the local repository' +complete -f -c git -n '__fish_git_using_command help' -a grep -d 'Print lines matching a pattern' +complete -f -c git -n '__fish_git_using_command help' -a init -d 'Create an empty git repository or reinitialize an existing one' +complete -f -c git -n '__fish_git_using_command help' -a log -d 'Show commit logs' +complete -f -c git -n '__fish_git_using_command help' -a ls-files -d 'Show information about files in the index and the working tree' +complete -f -c git -n '__fish_git_using_command help' -a mailinfo -d 'Extracts patch and authorship from a single e-mail message' +complete -f -c git -n '__fish_git_using_command help' -a mailsplit -d 'Simple UNIX mbox splitter program' +complete -f -c git -n '__fish_git_using_command help' -a maintenance -d 'Run tasks to optimize Git repository data' +complete -f -c git -n '__fish_git_using_command help' -a merge -d 'Join two or more development histories together' +complete -f -c git -n '__fish_git_using_command help' -a merge-base -d 'Find as good common ancestors as possible for a merge' +complete -f -c git -n '__fish_git_using_command help' -a mergetool -d 'Run merge conflict resolution tools to resolve merge conflicts' +complete -f -c git -n '__fish_git_using_command help' -a mv -d 'Move or rename a file, a directory, or a symlink' +complete -f -c git -n '__fish_git_using_command help' -a notes -d 'Add or inspect object notes' +complete -f -c git -n '__fish_git_using_command help' -a prune -d 'Prune all unreachable objects from the object database' +complete -f -c git -n '__fish_git_using_command help' -a pull -d 'Fetch from and merge with another repository or a local branch' +complete -f -c git -n '__fish_git_using_command help' -a push -d 'Update remote refs along with associated objects' +complete -f -c git -n '__fish_git_using_command help' -a range-diff -d 'Compare two commit ranges (e.g. two versions of a branch)' +complete -f -c git -n '__fish_git_using_command help' -a rebase -d 'Forward-port local commits to the updated upstream head' +complete -f -c git -n '__fish_git_using_command help' -a reflog -d 'Manage reflog information' +complete -f -c git -n '__fish_git_using_command help' -a remote -d 'Manage set of tracked repositories' +complete -f -c git -n '__fish_git_using_command help' -a reset -d 'Reset current HEAD to the specified state' +complete -f -c git -n '__fish_git_using_command help' -a restore -d 'Restore working tree files' +complete -f -c git -n '__fish_git_using_command help' -a revert -d 'Revert an existing commit' +complete -f -c git -n '__fish_git_using_command help' -a rev-parse -d 'Pick out and massage parameters' +complete -f -c git -n '__fish_git_using_command help' -a rm -d 'Remove files from the working tree and from the index' +complete -f -c git -n '__fish_git_using_command help' -a show -d 'Shows the last commit of a branch' +complete -f -c git -n '__fish_git_using_command help' -a show-branch -d 'Shows the commits on branches' +complete -f -c git -n '__fish_git_using_command help' -a stash -d 'Stash away changes' +complete -f -c git -n '__fish_git_using_command help' -a status -d 'Show the working tree status' +complete -f -c git -n '__fish_git_using_command help' -a submodule -d 'Initialize, update or inspect submodules' +complete -f -c git -n '__fish_git_using_command help' -a stripspace -d 'Remove unnecessary whitespace' +complete -f -c git -n '__fish_git_using_command help' -a switch -d 'Switch to a branch' +complete -f -c git -n '__fish_git_using_command help' -a tag -d 'Create, list, delete or verify a tag object signed with GPG' +complete -f -c git -n '__fish_git_using_command help' -a whatchanged -d 'Show logs with difference each commit introduces' +complete -f -c git -n '__fish_git_using_command help' -a worktree -d 'Manage multiple working trees' + +# Complete both options and possible parameters to `git config` +complete -f -c git -n '__fish_git_using_command config' -l global -d 'Get/set global configuration' +complete -f -c git -n '__fish_git_using_command config' -l system -d 'Get/set system configuration' +complete -f -c git -n '__fish_git_using_command config' -l local -d 'Get/set local repo configuration' +complete -F -c git -n '__fish_git_using_command config' -s f -l file -d 'Read config from file' -r +complete -F -c git -n '__fish_git_using_command config' -l blob -d 'Read config from blob' -r + +# If no argument is specified, it's as if --get was used +# Use -k with `__fish_git_config_keys` so that user defined values are shown first +complete -c git -n '__fish_git_using_command config; and __fish_is_nth_token 2' -kfa '(__fish_git_config_keys)' +complete -f -c git -n '__fish_git_using_command config' -l get -d 'Get config with name' -kra '(__fish_git_config_keys)' +complete -f -c git -n '__fish_git_using_command config' -l get-all -d 'Get all values matching key' -ka '(__fish_git_config_keys)' +complete -f -c git -n '__fish_git_using_command config' -l get-urlmatch -d 'Get value specific for the section url' -r +complete -f -c git -n '__fish_git_using_command config' -l replace-all -d 'Replace all matching variables' -kra '(__fish_git_config_keys)' +complete -f -c git -n '__fish_git_using_command config' -l add -d 'Add a new variable' -r +complete -f -c git -n '__fish_git_using_command config' -l unset -d 'Remove a variable' -ka '(__fish_git_config_keys)' +complete -f -c git -n '__fish_git_using_command config' -l unset-all -d 'Remove matching variables' -ka '(__fish_git_config_keys)' +complete -f -c git -n '__fish_git_using_command config' -l rename-section -d 'Rename section' -r +complete -f -c git -n '__fish_git_using_command config' -s l -l list -d 'List all variables' +complete -f -c git -n '__fish_git_using_command config' -s e -l edit -d 'Open configuration in an editor' + +complete -f -c git -n '__fish_git_using_command config' -s t -l type -d 'Value is of given type' +complete -f -c git -n '__fish_git_using_command config' -l bool -d 'Value is \'true\' or \'false\'' +complete -f -c git -n '__fish_git_using_command config' -l int -d 'Value is a decimal number' +complete -f -c git -n '__fish_git_using_command config' -l bool-or-int -d 'Value is --bool or --int' +complete -f -c git -n '__fish_git_using_command config' -l path -d 'Value is a path' +complete -f -c git -n '__fish_git_using_command config' -l expiry-date -d 'Value is an expiry date' + +complete -f -c git -n '__fish_git_using_command config' -s z -l null -d 'Terminate values with NUL byte' +complete -f -c git -n '__fish_git_using_command config' -l name-only -d 'Show variable names only' +complete -f -c git -n '__fish_git_using_command config' -l includes -d 'Respect include directives' +complete -f -c git -n '__fish_git_using_command config' -l show-origin -d 'Show origin of configuration' +complete -f -c git -n '__fish_git_using_command config; and __fish_seen_argument get' -l default -d 'Use default value when missing entry' + +## Custom commands (git-* commands installed in the PATH) +complete -c git -n __fish_git_needs_command -a '(__fish_git_custom_commands)' -d 'Custom command' + +function __fish_git_complete_custom_command -a subcommand + set -l cmd (commandline -opc) + set -e cmd[1] # Drop "git". + set -l subcommand_args + if argparse -s (__fish_git_global_optspecs) -- $cmd + set subcommand_args $argv[2..] # Drop the subcommand. + end + complete -C "git-$subcommand $subcommand_args "(commandline -ct) +end + +# source git-* commands' autocompletion file if exists +set -l __fish_git_custom_commands_completion +for file in $PATH/git-* + not command -q $file + and continue + + set -l subcommand (string replace -r -- '.*/git-([^/]*)$' '$1' $file) + + # Already seen this command earlier in $PATH. + contains -- $subcommand $__fish_git_custom_commands_completion + and continue + + complete -C "git-$subcommand " >/dev/null + if test (complete -c git-$subcommand | count) -gt 0 + complete -c git -f -n "__fish_git_using_command $subcommand" -a "(__fish_git_complete_custom_command $subcommand)" + end + set -a __fish_git_custom_commands_completion $subcommand +end diff --git a/.config/fish/completions/go.fish b/.config/fish/completions/go.fish new file mode 100644 index 0000000..d79f8b7 --- /dev/null +++ b/.config/fish/completions/go.fish @@ -0,0 +1,174 @@ +# go is a tool for managing Go source code. +# See: https://golang.org + +# Completions for go build commands +set -l __go_cmds_w_buildflags build get install run test generate +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -s a -d 'force rebuild' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -s n -d 'print the commands but do not run them' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -s p -r -d 'number parallel builds (default=#cpus)' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o race -d 'enable data race detection' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o msan -d 'enable interoperation with memory sanitizer' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -s v -d 'print packages being built' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o work -d 'print and preserve work directory' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -s x -d 'print the commands' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o asmflags -d 'arguments to pass on each go tool asm invocation' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o buildmode -x -d 'build mode to use' -a 'archive c-archive c-shared default shared exe pie plugin' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o compiler -x -d 'name of compiler to use, as in runtime' -a 'gccgo gc' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o gccgoflags -r -d 'gccgo compiler/linker flags' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o gcflags -r -d 'go compiler flags' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o installsuffix -r -d 'suffix for installation directory' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o ldflags -r -d 'linker flags' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o linkshared -r -d 'link against shared libraries previously created with -buildmode=shared' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o mod -x -d 'module download mode to use' -a 'readonly vendor mod' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o modcacherw -d 'leave newly-created directories in the module cache writable' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o modfile -r -d 'read (and possibly write) an alternate go.mod' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o pkgdir -r -d 'install and load all packages from dir instead of the usual locations' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o tags -r -d 'build tags' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o trimpath -d 'remove all file system paths from the resulting executable' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o toolexec -r -d 'a program to use to invoke toolchain programs' +complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o mod -x -d 'module download mode to use' -a 'readonly vendor' + + +# Completions for go cmds that takes file arguments +complete -c go -n "__fish_seen_subcommand_from build compile fix fmt install test vet" -k -x -a "( + __fish_complete_suffix .go + )" --description File + +# Completions for go cmds that takes pkg arguments +complete -c go -n "__fish_seen_subcommand_from build doc fix fmt install test vet" -x -a "( + go list -e -f '{{.ImportPath}} {{or .Doc \"Go package\"}}' (commandline -ct)... 2>/dev/null + )" --description Package + + +# build +complete -c go -n __fish_use_subcommand -a build -d 'compile packages and dependencies' + +# clean +complete -c go -n __fish_use_subcommand -a clean -d 'remove object files' +complete -c go -n '__fish_seen_subcommand_from clean' -s i -d "remove the corresponding installed archive or binary" +complete -c go -n '__fish_seen_subcommand_from clean' -s n -d "print the command that would be executed without running" +complete -c go -n '__fish_seen_subcommand_from clean' -s r -d "recursively clean all the dependencies of package named by the import paths" +complete -c go -n '__fish_seen_subcommand_from clean' -s x -d "clean to print remove commands as it executes them" +complete -c go -n '__fish_seen_subcommand_from clean' -o cache -d 'remove the entire go build cache' +complete -c go -n '__fish_seen_subcommand_from clean' -o testcache -d 'expire all test results in the go build cache' +complete -c go -n '__fish_seen_subcommand_from clean' -o modcache -d 'remove the entire module download cache' + +# doc +complete -c go -n __fish_use_subcommand -a doc -d 'run godoc on package sources' +complete -c go -n '__fish_seen_subcommand_from doc' -o all -d "show all the documentation for the package" +complete -c go -n '__fish_seen_subcommand_from doc' -s c -d 'respect case when matching symbols' +complete -c go -n '__fish_seen_subcommand_from doc' -o cmd -d 'treat a command (package main) like a regular package' +complete -c go -n '__fish_seen_subcommand_from doc' -o short -d 'one-line representation for each symbol' +complete -c go -n '__fish_seen_subcommand_from doc' -o src -d 'show the full source code for the symbol' +complete -c go -n '__fish_seen_subcommand_from doc' -s u -d 'show documentation for unexported as well as exported symbols' + +# env +complete -c go -n __fish_use_subcommand -a env -d 'print Go environment information' +complete -c go -n '__fish_seen_subcommand_from env' -o json -d 'print the environment in JSON format' +complete -c go -n '__fish_seen_subcommand_from env' -s u -r -d 'set NAME to default values' +complete -c go -n '__fish_seen_subcommand_from env' -s w -r -d 'set default values for config variables' + +# fix +complete -c go -n __fish_use_subcommand -a fix -d 'run go tool fix on packages' + +# fmt +complete -c go -n __fish_use_subcommand -a fmt -d 'run gofmt on package sources' +complete -c go -n '__fish_seen_subcommand_from fmt' -s n -d "prints commands that would be executed" +complete -c go -n '__fish_seen_subcommand_from fmt' -s x -d "prints commands as they are executed" + +# get +complete -c go -n __fish_use_subcommand -a get -d 'download and install packages and dependencies' +complete -c go -n '__fish_seen_subcommand_from get' -s d -d "stop after downloading the packages; don't install" +complete -c go -n '__fish_seen_subcommand_from get' -o fix -d "run fix tool on packages before resolving dependencies or building" +complete -c go -n '__fish_seen_subcommand_from get' -s u -d "update remote packages" +complete -c go -n '__fish_seen_subcommand_from get' -s v -d "verbose progress and debug output" +complete -c go -n '__fish_seen_subcommand_from get' -s t -d "also download the packages required to build the tests" +complete -c go -n '__fish_seen_subcommand_from get' -o insecure -d "flag permits fetching & resolving domains using insecure schemes" + +# generate +complete -c go -n __fish_use_subcommand -a generate -d 'Generate runs commands described by directives within existing files.' +complete -c go -n '__fish_seen_subcommand_from get' -s n -d "prints commands that would be executed" +complete -c go -n '__fish_seen_subcommand_from get' -s x -d "prints commands as they are executed" +complete -c go -n '__fish_seen_subcommand_from get' -s v -d "prints the names of packages and files as they are processed" +complete -c go -n '__fish_seen_subcommand_from get' -o run -d "prints the names of packages and files as they are processed" + +# help +complete -c go -n __fish_use_subcommand -a help -d 'get help on topic' +complete -c go -n '__fish_seen_subcommand_from help' -xa bug -d "start a bug report" +complete -c go -n '__fish_seen_subcommand_from help' -xa build -d "compile packages and dependencies" +complete -c go -n '__fish_seen_subcommand_from help' -xa clean -d "remove object files and cached files" +complete -c go -n '__fish_seen_subcommand_from help' -xa doc -d "show documentation for package or symbol" +complete -c go -n '__fish_seen_subcommand_from help' -xa env -d "print Go environment information" +complete -c go -n '__fish_seen_subcommand_from help' -xa fix -d "update packages to use new APIs" +complete -c go -n '__fish_seen_subcommand_from help' -xa fmt -d "gofmt (reformat) package sources" +complete -c go -n '__fish_seen_subcommand_from help' -xa generate -d "generate Go files by processing source" +complete -c go -n '__fish_seen_subcommand_from help' -xa get -d "download and install packages and dependencies" +complete -c go -n '__fish_seen_subcommand_from help' -xa install -d "compile and install packages and dependencies" +complete -c go -n '__fish_seen_subcommand_from help' -xa list -d "list packages or modules" +complete -c go -n '__fish_seen_subcommand_from help' -xa mod -d "module maintenance" +complete -c go -n '__fish_seen_subcommand_from help' -xa run -d "compile and run Go program" +complete -c go -n '__fish_seen_subcommand_from help' -xa test -d "test packages" +complete -c go -n '__fish_seen_subcommand_from help' -xa tool -d "run specified go tool" +complete -c go -n '__fish_seen_subcommand_from help' -xa version -d "print Go version" +complete -c go -n '__fish_seen_subcommand_from help' -xa vet -d "report likely mistakes in packages" +complete -c go -n '__fish_seen_subcommand_from help' -xa buildmode -d "build modes" +complete -c go -n '__fish_seen_subcommand_from help' -xa c -d "calling between Go and C" +complete -c go -n '__fish_seen_subcommand_from help' -xa cache -d "build and test caching" +complete -c go -n '__fish_seen_subcommand_from help' -xa environment -d "environment variables" +complete -c go -n '__fish_seen_subcommand_from help' -xa filetype -d "file types" +complete -c go -n '__fish_seen_subcommand_from help' -xa go.mod -d "the go.mod file" +complete -c go -n '__fish_seen_subcommand_from help' -xa gopath -d "GOPATH environment variable" +complete -c go -n '__fish_seen_subcommand_from help' -xa gopath-get -d "legacy GOPATH go get" +complete -c go -n '__fish_seen_subcommand_from help' -xa goproxy -d "module proxy protocol" +complete -c go -n '__fish_seen_subcommand_from help' -xa importpath -d "import path syntax" +complete -c go -n '__fish_seen_subcommand_from help' -xa modules -d "modules, module versions, and more" +complete -c go -n '__fish_seen_subcommand_from help' -xa module-get -d "module-aware go get" +complete -c go -n '__fish_seen_subcommand_from help' -xa module-auth -d "module authentication using go.sum" +complete -c go -n '__fish_seen_subcommand_from help' -xa module-private -d "module configuration for non-public modules" +complete -c go -n '__fish_seen_subcommand_from help' -xa packages -d "package lists and patterns" +complete -c go -n '__fish_seen_subcommand_from help' -xa testflag -d "testing flags" +complete -c go -n '__fish_seen_subcommand_from help' -xa testfunc -d "testing functions" + +# install +complete -c go -n __fish_use_subcommand -a install -d 'compile and install packages and dependencies' + +# list +complete -c go -n __fish_use_subcommand -a list -d 'list packages' +complete -c go -n '__fish_seen_subcommand_from list' -s e -d "tolerate erroneous packages" +complete -c go -n '__fish_seen_subcommand_from list' -s f -r -d "pass in template for formatting" +complete -c go -n '__fish_seen_subcommand_from list' -o json -d "print in JSON format" +complete -c go -n '__fish_seen_subcommand_from list' -o tags -r -d 'list of build tags' +complete -c go -n '__fish_seen_subcommand_from list' -s m -d 'list modules instead of packages' + +# run +complete -c go -n __fish_use_subcommand -a run -d 'compile and run Go program' + +# test +complete -c go -n __fish_use_subcommand -a test -d 'test packages' +complete -c go -n '__fish_seen_subcommand_from test' -s c -r -d "compile the test binary to pkg.test but do not run it" +complete -c go -n '__fish_seen_subcommand_from test' -s i -d "install dependent packages, but don't run tests" + +# tool +complete -c go -n __fish_use_subcommand -a tool -d 'run specified go tool' +complete -c go -n '__fish_seen_subcommand_from tool' -a 'addr2line api asm cgo compile dist fix link nm objdump pack pprof prof vet yacc' -d "target tool" +complete -c go -n '__fish_seen_subcommand_from tool' -s n -d "print the command that would be executed but not execute it" + +# version +complete -c go -f -n __fish_use_subcommand -a version -d 'print Go version' +complete -c go -f -n '__fish_seen_subcommand_from version' + +# vet +complete -c go -n __fish_use_subcommand -a vet -d 'vet packages' +complete -c go -n '__fish_seen_subcommand_from vet' -s n -d "print the command that would be executed" +complete -c go -n '__fish_seen_subcommand_from vet' -s x -d "prints commands as they are executed" + +# mod +complete -c go -n __fish_use_subcommand -a mod -d 'module maintenance' +complete -c go -f -n '__fish_seen_subcommand_from mod' -a download -d "download modules to local cache" +complete -c go -f -n '__fish_seen_subcommand_from mod' -a edit -d "edit go.mod from tools or scripts" +complete -c go -f -n '__fish_seen_subcommand_from mod' -a graph -d "print module requirement graph" +complete -c go -f -n '__fish_seen_subcommand_from mod' -a init -d "initialize new module in current directory" +complete -c go -f -n '__fish_seen_subcommand_from mod' -a tidy -d "add missing and remove unused modules" +complete -c go -f -n '__fish_seen_subcommand_from mod' -a vendor -d "make vendored copy of dependencies" +complete -c go -f -n '__fish_seen_subcommand_from mod' -a verify -d "verify dependencies have expected content" +complete -c go -f -n '__fish_seen_subcommand_from mod' -a why -d "explain why packages or modules are needed" diff --git a/.config/fish/completions/nc.fish b/.config/fish/completions/nc.fish new file mode 100644 index 0000000..4dc5f18 --- /dev/null +++ b/.config/fish/completions/nc.fish @@ -0,0 +1,12 @@ +# There a several different implementations of netcat. +# Try to figure out which is the current used one +# and load the right set of completions. + +set -l flavor +if string match -rq -- '^OpenBSD netcat' (nc -h 2>&1)[1] + set flavor nc.openbsd +else + set flavor (basename (realpath (command -v nc))) +end + +__fish_complete_netcat nc $flavor diff --git a/.config/fish/completions/nc.openbsd.fish b/.config/fish/completions/nc.openbsd.fish new file mode 100644 index 0000000..f93163c --- /dev/null +++ b/.config/fish/completions/nc.openbsd.fish @@ -0,0 +1 @@ +__fish_complete_netcat nc.openbsd diff --git a/.config/fish/completions/nc.traditional.fish b/.config/fish/completions/nc.traditional.fish new file mode 100644 index 0000000..8d0c10f --- /dev/null +++ b/.config/fish/completions/nc.traditional.fish @@ -0,0 +1 @@ +__fish_complete_netcat nc.traditional diff --git a/.config/fish/completions/ncat.fish b/.config/fish/completions/ncat.fish new file mode 100644 index 0000000..186b6bf --- /dev/null +++ b/.config/fish/completions/ncat.fish @@ -0,0 +1,74 @@ +# Completions for ncat (https://www.nmap.org) + +complete -c ncat -f -a "(__fish_print_hostnames)" + +# PROTOCOL OPTIONS +complete -c ncat -s 4 -d "IPv4 only" +complete -c ncat -s 6 -d "IPv6 only" +complete -c ncat -s U -l unixsock -d "Use Unix domain sockets" +complete -c ncat -s u -l udp -d "Use UDP" +complete -c ncat -l sctp -d "Use SCTP" + +# CONNECT MODE OPTIONS +complete -c ncat -s g -x -d "Loose source routing" +complete -c ncat -s G -x -d "Set source routing pointer" +complete -c ncat -s p -l source-port -x -d "Specify source port" +complete -c ncat -s s -l source -x -d "Specify source address" + +# LISTEN MODE OPTIONS +complete -c ncat -s l -l listen -d "Listen for connections" +complete -c ncat -s m -l max-conns -x -d "Specify maximum number of connections" +complete -c ncat -s k -l keep-open -d "Accept multiple connections" +complete -c ncat -l broker -d "Connection brokering" +complete -c ncat -l chat -d "Ad-hoc \"chat server\"" + +# SSL OPTIONS +complete -c ncat -l ssl -d "Use SSL" +complete -c ncat -l ssl-verify -d "Verify server certificates" +complete -c ncat -l ssl-cert -r -d "Specify SSL certificate" +complete -c ncat -l ssl-key -r -d "Specify SSL private key" +complete -c ncat -l ssl-trustfile -r -d "List trusted certificates" +function __fish_complete_openssl_ciphers + openssl ciphers -s -stdname | string replace -r '^([^ ]*) - ([^ ]*).*$' '$2\t$1' + for cs in COMPLEMENTOFDEFAULT ALL COMPLEMENTOFALL HIGH MEDIUM LOW eNULL NULL aNULL kRSA aRSA RSA kDHr kDHd kDH kDHE kEDH DH DHE EDH ADH kEECDH kECDHE ECDH ECDHE EECDH AECDH aDSS DSS aDH aECDSA ECDSA TLSv1.2 TLSv1.0 SSLv3 AES128 AES256 AES AESGCM AESCCM AESCCM8 ARIA128 ARIA256 ARIA CAMELLIA128 CAMELLIA256 CAMELLIA CHACHA20 3DES DES RC4 RC2 IDEA SEED MD5 SHA1 SHA SHA256 SHA384 aGOST aGOST01 kGOST GOST94 GOST89MAC PSK kPSK kECDHEPSK kDHEPSK kRSAPSK aPSK SUITEB128 SUITEB128ONLY SUITEB192 + printf "%s\tCipher String\n" $cs + end +end +complete -c ncat -l ssl-ciphers -x -a "(__fish_complete_list : __fish_complete_openssl_ciphers)" -d "Specify SSL ciphersuites" +complete -c ncat -l ssl-alpn -x -d "Specify ALPN protocol list" + +# PROXY OPTIONS +complete -c ncat -l proxy -x -d "Specify proxy address" +complete -c ncat -l proxy-type -x -d "Specify proxy protocol" +complete -c ncat -l proxy-auth -x -d "Specify proxy credentials" + +# COMMAND EXECUTION OPTIONS +complete -c ncat -s e -l exec -r -d "Execute command" +complete -c ncat -s c -l sh-exec -r -d "Execute command via sh" +complete -c ncat -l lua-exec -r -d "Execute a .lua script" + +# ACCESS CONTROL OPTIONS +complete -c ncat -l allow -x -a "(__fish_print_hostnames)" -d "Allow connections" +complete -c ncat -l allowfile -r -d "Allow connections from file" +complete -c ncat -l deny -x -a "(__fish_print_hostnames)" -d "Deny connections" +complete -c ncat -l denyfile -r -d "Deny connections from file" + +# TIMING OPTIONS +complete -c ncat -s d -l delay -x -d "Specify line delay" +complete -c ncat -s i -l idle-timeout -x -d "Specify idle timeout" +complete -c ncat -s w -l wait -x -d "Specify connect timeout" + +# OUTPUT OPTIONS +complete -c ncat -s o -l output -r -d "Save session data" +complete -c ncat -s x -l hex-dump -r -d "Save session data in hex" +complete -c ncat -l append-output -d "Append output" +complete -c ncat -s v -l verbose -d "Be verbose" + +# MISC OPTIONS +complete -c ncat -s C -l crlf -d "Use CRLF as EOL" +complete -c ncat -s h -l help -d "Help screen" +complete -c ncat -l -recv-only -d "Only receive data" +complete -c ncat -l send-only -d "Only send data" +complete -c ncat -l no-shutdown -d "Do not shutdown into half-duplex mode" +complete -c ncat -s t -l telnet -d "Answer Telnet negotiations" +complete -c ncat -l version -d "Display version" diff --git a/.config/fish/completions/netcat.fish b/.config/fish/completions/netcat.fish new file mode 100644 index 0000000..a33e8e2 --- /dev/null +++ b/.config/fish/completions/netcat.fish @@ -0,0 +1,12 @@ +# There a several different implementations of netcat. +# Try to figure out which is the current used one +# and load the right set of completions. + +set -l flavor +if string match -rq -- '^OpenBSD netcat' (netcat -h 2>&1)[1] + set flavor nc.openbsd +else + set flavor (basename (realpath (command -v netcat))) +end + +__fish_complete_netcat netcat $flavor From 9c77d9b3fcfa0b637da81832773d4cc73898cdcb Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 12 Apr 2022 09:59:48 -0700 Subject: [PATCH 008/126] nvim from deneb --- .vim/nvim.lua | 19 +++++++++++-------- .vimrc | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 6bba63a..bf84138 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -92,15 +92,15 @@ require'compe'.setup { }; } -signature_cfg = { - hint_enable = true, - hint_prefix = "% ", - handler_opts = { - border = "none" - }, -} +--signature_cfg = { + --hint_enable = true, + --hint_prefix = "% ", + --handler_opts = { + --border = "none" + --}, +--} -require'lsp_signature'.on_attach(signature_cfg) +--require'lsp_signature'.on_attach(signature_cfg) saga_cfg = { code_action_prompt = { @@ -189,6 +189,9 @@ require('lspkind').init({ --}, }) +--require('rust-tools').setup({ +--}) + require('trouble').setup { mode = "document_diagnostics", auto_close = true, diff --git a/.vimrc b/.vimrc index 8962fd5..32bbcb8 100644 --- a/.vimrc +++ b/.vimrc @@ -228,6 +228,7 @@ Plug 'nvim-treesitter/playground' "Plug 'ggandor/lightspeed.nvim' Plug 'justinmk/vim-sneak' +Plug 'simrat39/rust-tools.nvim' Plug 'Shougo/unite.vim' " TODO: Look into Coqtail, same author From d8a623b5b84add87a2e4f99ac0747792c993f230 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 12 Apr 2022 10:08:57 -0700 Subject: [PATCH 009/126] treesitter config --- .config/fish/conf.d/virtualfish-loader.fish | 14 +-- .config/fish/fish_variables | 3 +- .config/k9s/config.yml | 3 +- .../xfce4/xfconf/xfce-perchannel-xml/displays.xml | 16 +++ .../xfce4/xfconf/xfce-perchannel-xml/thunar.xml | 6 +- .../xfconf/xfce-perchannel-xml/xfce4-desktop.xml | 22 +++++ .../xfconf/xfce-perchannel-xml/xfce4-notifyd.xml | 3 + .../xfconf/xfce-perchannel-xml/xfce4-panel.xml | 27 ++--- .../xfce-perchannel-xml/xfce4-power-manager.xml | 6 +- .../xfconf/xfce-perchannel-xml/xfce4-session.xml | 8 +- .../xfce-perchannel-xml/xfce4-settings-manager.xml | 4 +- .config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml | 110 +++++++++++---------- .../xfce4/xfconf/xfce-perchannel-xml/xsettings.xml | 8 +- .tmux.conf | 2 + .vim/nvim.lua | 65 +++++++++++- .vimrc | 9 +- 16 files changed, 214 insertions(+), 92 deletions(-) diff --git a/.config/fish/conf.d/virtualfish-loader.fish b/.config/fish/conf.d/virtualfish-loader.fish index 43dc4c0..eee0754 100644 --- a/.config/fish/conf.d/virtualfish-loader.fish +++ b/.config/fish/conf.d/virtualfish-loader.fish @@ -1,12 +1,4 @@ set -g VIRTUALFISH_VERSION 2.5.4 -set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python3 -if test -e /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish - source /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish -else if test -e /usr/local/lib/python3.9/site-packages/virtualfish/virtual.fish - source /usr/local/lib/python3.9/site-packages/virtualfish/virtual.fish -else if test -e /usr/lib/python3.9/site-packages/virtualfish/virtual.fish - source /usr/lib/python3.9/site-packages/virtualfish/virtual.fish -else if test -e /usr/lib/python3.10/site-packages/virtualfish/virtual.fish - source /usr/lib/python3.10/site-packages/virtualfish/virtual.fish -end -emit virtualfish_did_setup_plugins +set -g VIRTUALFISH_PYTHON_EXEC /bin/python +source /usr/lib/python3.10/site-packages/virtualfish/virtual.fish +emit virtualfish_did_setup_plugins \ No newline at end of file diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index 1b4481a..f1b6a56 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -1,6 +1,6 @@ # This file contains fish universal variable definitions. # VERSION: 3.0 -SETUVAR __fish_initialized:3100 +SETUVAR __fish_initialized:3400 SETUVAR fish_color_autosuggestion:555\x1ebrblack SETUVAR fish_color_cancel:\x2dr SETUVAR fish_color_command:005fd7 @@ -28,3 +28,4 @@ SETUVAR fish_pager_color_completion:\x1d SETUVAR fish_pager_color_description:B3A06D\x1eyellow SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan +SETUVAR fish_pager_color_selected_background:\x2dr diff --git a/.config/k9s/config.yml b/.config/k9s/config.yml index 7f8a196..09a109e 100644 --- a/.config/k9s/config.yml +++ b/.config/k9s/config.yml @@ -19,7 +19,7 @@ k9s: clusters: kubernetes: namespace: - active: "" + active: all favorites: - all - default @@ -43,3 +43,4 @@ k9s: memory: critical: 90 warn: 70 + screenDumpDir: /tmp/k9s-screens-barak diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml index 9ae2397..abe7b1e 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml @@ -38,6 +38,10 @@ <property name="X" type="int" value="0"/> <property name="Y" type="int" value="0"/> </property> + <property name="Scale" type="empty"> + <property name="X" type="double" value="1.000000"/> + <property name="Y" type="double" value="1.000000"/> + </property> </property> <property name="DP-3" type="string" value="DO NOT USE - RTK 27""> <property name="Active" type="bool" value="true"/> @@ -51,6 +55,10 @@ <property name="X" type="int" value="0"/> <property name="Y" type="int" value="0"/> </property> + <property name="Scale" type="empty"> + <property name="X" type="double" value="1.000000"/> + <property name="Y" type="double" value="1.000000"/> + </property> </property> </property> <property name="ActiveProfile" type="string" value="Default"/> @@ -67,6 +75,10 @@ <property name="X" type="int" value="0"/> <property name="Y" type="int" value="0"/> </property> + <property name="Scale" type="empty"> + <property name="X" type="double" value="1.000000"/> + <property name="Y" type="double" value="1.000000"/> + </property> </property> <property name="DP-3" type="string" value="DO NOT USE - RTK 27""> <property name="Active" type="bool" value="true"/> @@ -80,6 +92,10 @@ <property name="X" type="int" value="0"/> <property name="Y" type="int" value="0"/> </property> + <property name="Scale" type="empty"> + <property name="X" type="double" value="1.000000"/> + <property name="Y" type="double" value="1.000000"/> + </property> </property> </property> </channel> diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml index 166d8eb..6dc0558 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml @@ -4,8 +4,8 @@ <property name="misc-volume-management" type="empty"/> <property name="shortcuts-icon-size" type="empty"/> <property name="last-view" type="string" value="ThunarIconView"/> - <property name="last-icon-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_NORMAL"/> - <property name="last-window-width" type="int" value="2556"/> - <property name="last-window-height" type="int" value="1411"/> + <property name="last-icon-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_75_PERCENT"/> + <property name="last-window-width" type="int" value="1274"/> + <property name="last-window-height" type="int" value="2121"/> <property name="last-window-maximized" type="bool" value="false"/> </channel> diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml index d062b36..6f340b0 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml @@ -29,6 +29,28 @@ <property name="image-style" type="empty"/> <property name="image-show" type="empty"/> </property> + <property name="monitorHDMI-1" type="empty"> + <property name="workspace0" type="empty"> + <property name="color-style" type="int" value="0"/> + <property name="image-style" type="int" value="5"/> + <property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-verticals.png"/> + </property> + <property name="workspace1" type="empty"> + <property name="color-style" type="int" value="0"/> + <property name="image-style" type="int" value="5"/> + <property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-verticals.png"/> + </property> + <property name="workspace2" type="empty"> + <property name="color-style" type="int" value="0"/> + <property name="image-style" type="int" value="5"/> + <property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-verticals.png"/> + </property> + <property name="workspace3" type="empty"> + <property name="color-style" type="int" value="0"/> + <property name="image-style" type="int" value="5"/> + <property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-verticals.png"/> + </property> + </property> </property> </property> </channel> diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-notifyd.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-notifyd.xml index e205fb5..1d7482c 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-notifyd.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-notifyd.xml @@ -7,8 +7,11 @@ <property name="applications" type="empty"> <property name="known_applications" type="array"> <value type="string" value="Firefox"/> + <value type="string" value="google-chrome"/> <value type="string" value="nm-applet"/> <value type="string" value="notify-send"/> + <value type="string" value="org.gnome.Evolution-alarm-notify"/> + <value type="string" value="Spotify"/> <value type="string" value="Xfce volume control"/> <value type="string" value="xfce4-settings-helper"/> </property> diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml index c6b1ecd..3077199 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml @@ -7,6 +7,7 @@ <property name="length" type="uint" value="100"/> <property name="position-locked" type="bool" value="true"/> <property name="plugin-ids" type="array"> + <value type="int" value="7"/> <value type="int" value="12"/> <value type="int" value="2"/> <value type="int" value="3"/> @@ -46,21 +47,22 @@ <value type="string" value="remmina"/> </property> <property name="names-ordered" type="array"> + <value type="string" value="remmina"/> <value type="string" value="hexchat"/> <value type="string" value="obs"/> </property> - </property> - <property name="plugin-7" type="string" value="statusnotifier"> - <property name="icon-size" type="uint" value="22"/> - <property name="menu-is-primary" type="bool" value="true"/> - <property name="mode-whitelist" type="bool" value="false"/> - <property name="single-row" type="bool" value="false"/> - <property name="square-icons" type="bool" value="false"/> - <property name="symbolic-icons" type="bool" value="true"/> <property name="known-items" type="array"> + <value type="string" value="chrome_status_icon_1"/> + <value type="string" value="Barrier"/> + <value type="string" value="discord1"/> + <value type="string" value="vlc"/> + <value type="string" value="obs"/> <value type="string" value="remmina-icon"/> - <value type="string" value="blueman"/> - <value type="string" value="nm-applet"/> + </property> + <property name="known-legacy-items" type="array"> + <value type="string" value="reminders"/> + <value type="string" value="evolution-alarm-notify"/> + <value type="string" value="remmina"/> </property> </property> <property name="plugin-9" type="string" value="pulseaudio"> @@ -86,7 +88,10 @@ <property name="plugin-5" type="string" value="cpugraph"/> <property name="plugin-6" type="string" value="pulseaudio"> <property name="enable-keyboard-shortcuts" type="bool" value="true"/> - <property name="mpris-players" type="string" value="chrome.instance486584;firefox.instance177030;firefox.instance435270;firefox.instance47310;kdeconnect.mpris_139c920d94b14a47b3c01f1cb40b9a31"/> + <property name="mpris-players" type="string" value="chrome.instance486584;firefox.instance139344;firefox.instance177030;firefox.instance354219;firefox.instance435270;firefox.instance47310;firefox.instance67698;firefox.instance8847;firefox.instance984;kdeconnect.mpris_139c920d94b14a47b3c01f1cb40b9a31;spotify;vlc"/> + </property> + <property name="plugin-7" type="string" value="applicationsmenu"> + <property name="show-button-title" type="bool" value="false"/> </property> </property> <property name="configver" type="int" value="2"/> diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml index af82713..2950c5c 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml @@ -5,11 +5,11 @@ <property name="power-button-action" type="empty"/> <property name="lock-screen-suspend-hibernate" type="bool" value="false"/> <property name="logind-handle-lid-switch" type="empty"/> - <property name="blank-on-ac" type="int" value="30"/> + <property name="blank-on-ac" type="int" value="60"/> <property name="blank-on-battery" type="empty"/> <property name="dpms-enabled" type="bool" value="false"/> - <property name="dpms-on-ac-sleep" type="uint" value="36"/> - <property name="dpms-on-ac-off" type="uint" value="37"/> + <property name="dpms-on-ac-sleep" type="uint" value="60"/> + <property name="dpms-on-ac-off" type="uint" value="60"/> <property name="dpms-on-battery-sleep" type="empty"/> <property name="dpms-on-battery-off" type="empty"/> <property name="show-panel-label" type="empty"/> diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml index 246af5d..ac75ee5 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml @@ -3,7 +3,8 @@ <channel name="xfce4-session" version="1.0"> <property name="general" type="empty"> <property name="FailsafeSessionName" type="empty"/> - <property name="SaveOnExit" type="empty"/> + <property name="LockCommand" type="empty"/> + <property name="SaveOnExit" type="bool" value="true"/> <property name="SessionName" type="string" value="Default"/> </property> <property name="sessions" type="empty"> @@ -11,14 +12,19 @@ <property name="IsFailsafe" type="empty"/> <property name="Count" type="empty"/> <property name="Client0_Command" type="empty"/> + <property name="Client0_Priority" type="empty"/> <property name="Client0_PerScreen" type="empty"/> <property name="Client1_Command" type="empty"/> + <property name="Client1_Priority" type="empty"/> <property name="Client1_PerScreen" type="empty"/> <property name="Client2_Command" type="empty"/> + <property name="Client2_Priority" type="empty"/> <property name="Client2_PerScreen" type="empty"/> <property name="Client3_Command" type="empty"/> + <property name="Client3_Priority" type="empty"/> <property name="Client3_PerScreen" type="empty"/> <property name="Client4_Command" type="empty"/> + <property name="Client4_Priority" type="empty"/> <property name="Client4_PerScreen" type="empty"/> </property> </property> diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-settings-manager.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-settings-manager.xml index 44e83e0..e3f254f 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-settings-manager.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-settings-manager.xml @@ -2,7 +2,7 @@ <channel name="xfce4-settings-manager" version="1.0"> <property name="last" type="empty"> - <property name="window-width" type="int" value="850"/> - <property name="window-height" type="int" value="500"/> + <property name="window-width" type="int" value="948"/> + <property name="window-height" type="int" value="2032"/> </property> </channel> diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml index 2bf99b0..d13769e 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml @@ -2,66 +2,67 @@ <channel name="xfwm4" version="1.0"> <property name="general" type="empty"> - <property name="activate_action" type="empty"/> - <property name="box_move" type="empty"/> - <property name="box_resize" type="empty"/> - <property name="button_layout" type="empty"/> - <property name="button_offset" type="empty"/> - <property name="button_spacing" type="empty"/> - <property name="click_to_focus" type="empty"/> - <property name="cycle_apps_only" type="empty"/> - <property name="cycle_draw_frame" type="empty"/> - <property name="cycle_preview" type="empty"/> - <property name="double_click_distance" type="empty"/> - <property name="double_click_time" type="empty"/> - <property name="focus_delay" type="empty"/> - <property name="focus_new" type="empty"/> - <property name="frame_opacity" type="empty"/> - <property name="full_width_title" type="empty"/> - <property name="maximized_offset" type="empty"/> - <property name="mousewheel_rollup" type="empty"/> - <property name="placement_mode" type="empty"/> - <property name="raise_delay" type="empty"/> - <property name="raise_on_click" type="empty"/> - <property name="raise_on_focus" type="empty"/> - <property name="repeat_urgent_blink" type="empty"/> - <property name="scroll_workspaces" type="empty"/> - <property name="shadow_delta_height" type="empty"/> - <property name="shadow_delta_width" type="empty"/> - <property name="shadow_delta_x" type="empty"/> - <property name="shadow_delta_y" type="empty"/> - <property name="shadow_opacity" type="empty"/> - <property name="show_app_icon" type="empty"/> - <property name="show_dock_shadow" type="empty"/> - <property name="show_frame_shadow" type="empty"/> - <property name="show_popup_shadow" type="empty"/> - <property name="snap_to_border" type="empty"/> - <property name="snap_to_windows" type="empty"/> - <property name="snap_width" type="empty"/> - <property name="theme" type="empty"/> - <property name="title_alignment" type="empty"/> - <property name="title_font" type="empty"/> - <property name="title_horizontal_offset" type="empty"/> - <property name="title_shadow_active" type="empty"/> - <property name="title_shadow_inactive" type="empty"/> - <property name="title_vertical_offset_active" type="empty"/> - <property name="title_vertical_offset_inactive" type="empty"/> - <property name="urgent_blink" type="empty"/> - <property name="use_compositing" type="empty"/> - <property name="workspace_count" type="int" value="4"/> + <property name="activate_action" type="string" value="bring"/> + <property name="box_move" type="bool" value="false"/> + <property name="box_resize" type="bool" value="false"/> + <property name="button_layout" type="string" value="O|SHMC"/> + <property name="button_offset" type="int" value="0"/> + <property name="button_spacing" type="int" value="0"/> + <property name="click_to_focus" type="bool" value="true"/> + <property name="cycle_apps_only" type="bool" value="false"/> + <property name="cycle_draw_frame" type="bool" value="true"/> + <property name="cycle_preview" type="bool" value="true"/> + <property name="double_click_distance" type="int" value="5"/> + <property name="double_click_time" type="int" value="250"/> + <property name="focus_delay" type="int" value="250"/> + <property name="focus_new" type="bool" value="true"/> + <property name="frame_opacity" type="int" value="100"/> + <property name="full_width_title" type="bool" value="true"/> + <property name="maximized_offset" type="int" value="0"/> + <property name="mousewheel_rollup" type="bool" value="true"/> + <property name="placement_mode" type="string" value="center"/> + <property name="raise_delay" type="int" value="250"/> + <property name="raise_on_click" type="bool" value="true"/> + <property name="raise_on_focus" type="bool" value="false"/> + <property name="repeat_urgent_blink" type="bool" value="false"/> + <property name="scroll_workspaces" type="bool" value="true"/> + <property name="shadow_delta_height" type="int" value="0"/> + <property name="shadow_delta_width" type="int" value="0"/> + <property name="shadow_delta_x" type="int" value="0"/> + <property name="shadow_delta_y" type="int" value="-3"/> + <property name="shadow_opacity" type="int" value="50"/> + <property name="show_app_icon" type="bool" value="false"/> + <property name="show_dock_shadow" type="bool" value="true"/> + <property name="show_frame_shadow" type="bool" value="true"/> + <property name="show_popup_shadow" type="bool" value="false"/> + <property name="snap_to_border" type="bool" value="true"/> + <property name="snap_to_windows" type="bool" value="false"/> + <property name="snap_width" type="int" value="10"/> + <property name="theme" type="string" value="Default"/> + <property name="title_alignment" type="string" value="center"/> + <property name="title_font" type="string" value="Sans Bold 9"/> + <property name="title_horizontal_offset" type="int" value="0"/> + <property name="title_shadow_active" type="string" value="false"/> + <property name="title_shadow_inactive" type="string" value="false"/> + <property name="title_vertical_offset_active" type="int" value="0"/> + <property name="title_vertical_offset_inactive" type="int" value="0"/> + <property name="urgent_blink" type="bool" value="false"/> + <property name="use_compositing" type="bool" value="true"/> + <property name="workspace_count" type="int" value="5"/> <property name="workspace_names" type="array"> <value type="string" value="1"/> <value type="string" value="2"/> <value type="string" value="3"/> <value type="string" value="5"/> + <value type="string" value="6"/> + <value type="string" value="7"/> <value type="string" value="9"/> - <value type="string" value="10"/> - <value type="string" value="10"/> <value type="string" value="Workspace 8"/> + <value type="string" value="9"/> </property> - <property name="wrap_resistance" type="empty"/> - <property name="wrap_windows" type="empty"/> - <property name="wrap_workspaces" type="empty"/> + <property name="wrap_resistance" type="int" value="10"/> + <property name="wrap_windows" type="bool" value="true"/> + <property name="wrap_workspaces" type="bool" value="false"/> <property name="borderless_maximize" type="bool" value="true"/> <property name="cycle_hidden" type="bool" value="true"/> <property name="cycle_minimum" type="bool" value="true"/> @@ -87,5 +88,10 @@ <property name="wrap_cycle" type="bool" value="true"/> <property name="wrap_layout" type="bool" value="true"/> <property name="zoom_desktop" type="bool" value="true"/> + <property name="cycle_raise" type="bool" value="false"/> + <property name="cycle_minimized" type="bool" value="false"/> + <property name="frame_border_top" type="int" value="0"/> + <property name="vblank_mode" type="string" value="auto"/> + <property name="zoom_pointer" type="bool" value="true"/> </property> </channel> diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml index 520076d..762e18a 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml @@ -2,7 +2,7 @@ <channel name="xsettings" version="1.0"> <property name="Net" type="empty"> - <property name="ThemeName" type="string" value="Arc-Dark"/> + <property name="ThemeName" type="string" value="Adwaita-dark"/> <property name="IconThemeName" type="string" value="Arc"/> <property name="DoubleClickTime" type="empty"/> <property name="DoubleClickDistance" type="empty"/> @@ -15,7 +15,7 @@ <property name="FallbackIconTheme" type="empty"/> </property> <property name="Xft" type="empty"> - <property name="DPI" type="int" value="150"/> + <property name="DPI" type="int" value="130"/> <property name="Antialias" type="int" value="1"/> <property name="Hinting" type="int" value="1"/> <property name="HintStyle" type="string" value="hintslight"/> @@ -37,11 +37,13 @@ <property name="CursorThemeName" type="string" value="elementary"/> <property name="CursorThemeSize" type="empty"/> <property name="DecorationLayout" type="empty"/> + <property name="DialogsUseHeader" type="empty"/> + <property name="TitlebarMiddleClick" type="empty"/> </property> <property name="Gdk" type="empty"> <property name="WindowScalingFactor" type="empty"/> </property> <property name="Xfce" type="empty"> - <property name="LastCustomDPI" type="int" value="150"/> + <property name="LastCustomDPI" type="int" value="130"/> </property> </channel> diff --git a/.tmux.conf b/.tmux.conf index b408322..fa9b85b 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -20,6 +20,7 @@ bind-key C-p previous-window set -g set-titles off set -g mouse on set -g default-terminal tmux-256color +set-option -g default-shell /bin/fish setw -g mode-keys vi new -d @@ -36,6 +37,7 @@ bind - split-window -v bind v split-window -h bind = select-layout even-horizontal +bind-key C-t new-window "ttyd -R -d -t fontSize=18 tmux attach -t `tmux display -p '#S'`" # Status Bar #set -g status-bg black diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 6bba63a..a234886 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -26,6 +26,35 @@ nvim_lsp.gopls.setup({ on_attach=on_attach }) nvim_lsp.pyright.setup({ on_attach=on_attach }) nvim_lsp.clangd.setup({ on_attach=on_attach }) +local runtime_path = vim.split(package.path, ';') +table.insert(runtime_path, "lua/?.lua") +table.insert(runtime_path, "lua/?/init.lua") + +require'lspconfig'.sumneko_lua.setup { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + -- Setup your lua path + path = runtime_path, + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +} + function org_imports(wait_ms) local params = vim.lsp.util.make_range_params() @@ -298,7 +327,7 @@ require'nvim-treesitter.configs'.setup { enable = true, -- list of language that will be disabled - disable = { "c", "rust" }, + -- disable = { "c", "rust" }, -- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). @@ -331,6 +360,13 @@ require'nvim-treesitter.configs'.setup { } } +require"nvim-treesitter.highlight".set_custom_captures { + -- Highlight the @foo.bar capture group with the "Identifier" highlight group. + -- ["foo.bar"] = "Identifier", + ["generic_type_param"] = "TSCGenericTypeParam", +} + +require"neogen".setup {} -- -- Helper functions for my own grepping commands. @@ -408,3 +444,30 @@ function rust_where_at_line() vim.api.nvim_buf_set_lines(0, lineNum-1, lineNum, false, replacements) vim.api.nvim_win_set_cursor(0, {lineNum + 2, 4}) end + +function neogen_dwim() + local table = { + ["function_declaration"] = "func", + ["function_definition"] = "func", + ["function_item"] = "func", + ["function_signature_item"] = "func", + ["struct_item"] = "class", + ["trait_item"] = "class", + ["package_clause"] = "type", + ["const_declaration"] = "type", + ["var_declaration"] = "type", + ["class_definition"] = "class", + } + + local ts_utils = require'nvim-treesitter.ts_utils' + local current_node = ts_utils.get_node_at_cursor() + while (current_node) do + local v = table[current_node:type()] + if v then + require('neogen').generate({ type = v }) + break + else + current_node = current_node:parent() + end + end +end diff --git a/.vimrc b/.vimrc index 8962fd5..26321ca 100644 --- a/.vimrc +++ b/.vimrc @@ -238,6 +238,7 @@ Plug 'lervag/vimtex' Plug 'Shougo/echodoc.vim' "Plug 'python-rope/ropevim' Plug 'windwp/nvim-autopairs' +Plug 'danymat/neogen' " Unclear "Plug 'ncm2/float-preview.nvim' @@ -275,7 +276,9 @@ vnoremap <silent> ga :<C-U>lua require('telescope.builtin').lsp_range_code_act "nnoremap <silent> ge <cmd>lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false})<CR> nnoremap <silent> ge <cmd>lua vim.diagnostic.open_float({focusable = false})<CR> -nnoremap <leader>xx <cmd>TroubleToggle<cr> +nnoremap <silent> <leader>xx <cmd>TroubleToggle<cr> +"nnoremap <silent> <leader>nc <cmd>lua neogen_dwim()<CR> +nnoremap <silent> <leader>nc <cmd>lua require('neogen').generate({ type = 'any' })<CR> " Set updatetime for CursorHold " 300ms of no cursor movement to trigger CursorHold @@ -291,8 +294,8 @@ autocmd BufWritePre *.go lua vim.lsp.buf.formatting_seq_sync(nil, 1000) autocmd BufWritePre *.go :silent! lua org_imports(3000) " Goto previous/next diagnostic warning/error -nnoremap <silent> g[ <cmd>lua vim.lsp.diagnostic.goto_prev()<CR> -nnoremap <silent> g] <cmd>lua vim.lsp.diagnostic.goto_next()<CR> +nnoremap <silent> g[ <cmd>lua vim.diagnostic.goto_prev()<CR> +nnoremap <silent> g] <cmd>lua vim.diagnostic.goto_next()<CR> let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy'] let g:completion_matching_smart_case = 1 From 51eebfe113c404103bf4952716ef65944c45a7fa Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 10 May 2022 16:07:03 -0700 Subject: [PATCH 010/126] go tooling variable --- .config/fish/config.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 649d657..abc6bc4 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -2,5 +2,6 @@ set PATH ~/bin ~/.local/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /us set fish_greeting "" set EDITOR vi +set -x GOPATH ~/.go . ~/.config/fish/fish_aliases.fish From d2a7a8263c0aa4929f281d20fda6c31283a47372 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 11 May 2022 16:14:54 -0700 Subject: [PATCH 011/126] Fix fish settings and better telescope for nvim --- .config/fish/conf.d/virtualfish-loader.fish | 12 +++++++-- .i3/config | 4 +-- .vim/nvim.lua | 39 ++++++++++++++++++++++++----- .vimrc | 5 ++-- .zshrc | 19 ++------------ 5 files changed, 50 insertions(+), 29 deletions(-) diff --git a/.config/fish/conf.d/virtualfish-loader.fish b/.config/fish/conf.d/virtualfish-loader.fish index eee0754..562c018 100644 --- a/.config/fish/conf.d/virtualfish-loader.fish +++ b/.config/fish/conf.d/virtualfish-loader.fish @@ -1,4 +1,12 @@ set -g VIRTUALFISH_VERSION 2.5.4 set -g VIRTUALFISH_PYTHON_EXEC /bin/python -source /usr/lib/python3.10/site-packages/virtualfish/virtual.fish -emit virtualfish_did_setup_plugins \ No newline at end of file + +set vfpaths /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish /usr/lib/python3.10/site-packages/virtualfish/virtual.fish /usr/lib/python3.9/site-packages/virtualfish/virtual.fish + +for vfpath in vfpaths + if test -f $vfpath + source $vfpath + emit virtualfish_did_setup_plugins + break + end +end diff --git a/.i3/config b/.i3/config index badf175..0574562 100644 --- a/.i3/config +++ b/.i3/config @@ -236,5 +236,5 @@ bindsym $win+Shift+l exec "playerctl next" #} #exec --no-startup-id xfce4-panel --disable-wm-check #exec polybar HDMI1 -exec --no-startup-id nitrogen --restore -exec --no-startup-id picom -b --config ~/.compton.conf +#exec --no-startup-id nitrogen --restore +#exec --no-startup-id picom -b --config ~/.compton.conf diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 4cf53a6..5d719d2 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -247,11 +247,17 @@ require('trouble').setup { }, } +local trouble_telescope = require("trouble.providers.telescope") + require('telescope').setup { defaults = { mappings = { n = { ["q"] = require('telescope.actions').close, + ["<c-t>"] = trouble_telescope.open_with_trouble, + }, + i = { + ["<c-t>"] = trouble_telescope.open_with_trouble, }, }, }, @@ -293,6 +299,11 @@ local dropdown = require'telescope.themes'.get_dropdown({ --winblend = 10 }) +local telescope_ivy = require'telescope.themes'.get_ivy({ + +}) + + -- -- Treesitter -- @@ -377,22 +388,38 @@ require"neogen".setup {} live_grep_repo = function(conf) --local opt = dropdown - local opt = { - cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] - } + local opt = telescope_ivy + opt['cwd'] = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + --local opt = { + --cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + --} for k,v in pairs(conf) do opt[k] = v end builtin.live_grep(opt) end git_grep_word = function(conf) --local opt = dropdown - local opt = { - cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] - } + local opt = telescope_ivy + opt['cwd'] = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + --local opt = { + --cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + --} for k,v in pairs(conf) do opt[k] = v end builtin.grep_string(opt) end +buffer_telescope = function(conf) + local opt = telescope_ivy + for k,v in pairs(conf) do opt[k] = v end + builtin.buffers(opt) +end + +file_list = function(conf) + local opt = telescope_ivy + for k,v in pairs(conf) do opt[k] = v end + builtin.git_files(opt) +end + --- --- My own "where" clause generator for Rust diff --git a/.vimrc b/.vimrc index 2720533..99192a6 100644 --- a/.vimrc +++ b/.vimrc @@ -992,7 +992,7 @@ nnoremap <silent> <Leader>aa :<C-u>RgRoot!<CR> "nnoremap <silent> <Leader>aw :<C-u>RgRoot! <C-r><C-w><CR> "nnoremap <C-l> :<C-u>Files! `git rev-parse --show-toplevel`<CR> "nnoremap <C-k> :<C-u>GFiles<CR> -nnoremap <C-k> <cmd>lua require('telescope.builtin').git_files()<cr> +nnoremap <silent> <C-k> <cmd>lua file_list{}<cr> nnoremap <silent> <Leader>ag <cmd>lua live_grep_repo{ word_match = "-w", only_sort_text = true, search = ''}<cr> nnoremap <silent> <Leader>aw <cmd>lua git_grep_word{ word_match = "-w", only_sort_text = true, initial_mode = "normal" }<cr> @@ -1001,7 +1001,8 @@ nnoremap <silent> <Leader>aw <cmd>lua git_grep_word{ word_match = "-w", only_sor nnoremap <Leader>hh :A<CR> " CommandT is useful, but if I'm juggling lots of buffers, limit it to another " one I have open (instead of standard <Leader>t). -nnoremap <silent> <Leader>o :<C-u>Buffers<CR> +"nnoremap <silent> <Leader>o :<C-u>Buffers<CR> +nnoremap <silent> <Leader>o <cmd>lua buffer_telescope{initial_mode = "normal"}<cr> "nnoremap <Leader>j <C-^> "nnoremap <Leader>p :PTW nnoremap <Leader>p :LustyJugglePrevious<CR> diff --git a/.zshrc b/.zshrc index 9b662af..2add78b 100644 --- a/.zshrc +++ b/.zshrc @@ -56,23 +56,6 @@ for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do done PR_NO_COLOUR="%{$terminfo[sgr0]%}" - ### - # Decide whether to set a screen title -# if [[ "$TERM" == "screen" ]]; then -# PR_STITLE=$'%{\ekzsh\e\\%}' -# else -# PR_STITLE='' -# fi - -# preexec () { -# local CMD="${1/#sudo /#}" -# local CMD="${CMD/#nano /}" -# local CMD="${CMD/#ssh />}" -# $SCREENME true || echo -ne "\ek${CMD%% *}\e\\" -# } - #precmd () { - #$SCREENME true || echo -ne "\ekzsh\e\\" - #} case `uname` in Darwin) PR_HOST_COLOR=$PR_CYAN @@ -181,6 +164,8 @@ if [ -f '/home/barak/local/google-cloud-sdk/path.zsh.inc' ]; then source '/home/ # The next line enables shell command completion for gcloud. if [ -f '/home/barak/local/google-cloud-sdk/completion.zsh.inc' ]; then source '/home/barak/local/google-cloud-sdk/completion.zsh.inc'; fi +if [ -f '/usr/local/lib/bazel/bin/_bazel' ]; then source '/usr/local/lib/bazel/bin/_bazel'; fi + # This enables autocomplete for kubectl if [ $commands[kubectl] ]; then source <(kubectl completion zsh) From 2502a78da7f4d2ee2cca0c2309896ee20837b5f0 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Thu, 26 May 2022 17:41:08 -0700 Subject: [PATCH 012/126] vim-qf plugin for quickfix --- .vimrc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 99192a6..0dc1b9b 100644 --- a/.vimrc +++ b/.vimrc @@ -196,6 +196,7 @@ Plug 'zchee/vim-goasm' "\ } "Plug 'ensime/ensime-vim', { 'do': ':UpdateRemotePlugins' } "Plug 'neoclide/coc.nvim', {'branch': 'release'} +Plug 'romainl/vim-qf' Plug 'neovim/nvim-lspconfig' Plug 'nvim-lua/lsp_extensions.nvim' Plug 'hrsh7th/nvim-compe' @@ -266,7 +267,7 @@ nnoremap <silent> gy <cmd>lua vim.lsp.buf.type_definition()<CR> nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR> nnoremap <silent> gs <cmd>lua vim.lsp.buf.signature_help()<CR> nnoremap <silent> gR <cmd>lua vim.lsp.buf.rename()<CR> -nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR> +"nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR> nnoremap <silent> gr <cmd>lua require('telescope.builtin').lsp_references({initial_mode = "normal"})<cr> nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR> nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR> @@ -275,9 +276,10 @@ nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR> nnoremap <silent> ga <cmd>lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"})<cr> vnoremap <silent> ga :<C-U>lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"})<cr> "nnoremap <silent> ge <cmd>lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false})<CR> -nnoremap <silent> ge <cmd>lua vim.diagnostic.open_float({focusable = false})<CR> +"nnoremap <silent> ge <cmd>lua vim.diagnostic.open_float({focusable = false})<CR> nnoremap <silent> <leader>xx <cmd>TroubleToggle<cr> +nnoremap <silent> <leader>xq <cmd>lua vim.diagnostic.setqflist()<CR> "nnoremap <silent> <leader>nc <cmd>lua neogen_dwim()<CR> nnoremap <silent> <leader>nc <cmd>lua require('neogen').generate({ type = 'any' })<CR> @@ -310,6 +312,15 @@ inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 }) " **** End LSP + + +let g:qf_auto_open_quickfix = 1 +let g:qf_auto_open_loclist = 0 + +nmap <PageUp> <Plug>(qf_qf_previous) +nmap <PageDown> <Plug>(qf_qf_next) +nmap ge <Plug>(qf_qf_toggle) + "" Sources "source ~/.vim/supertab.vim "source ~/.vim/charm.vim From 1e5bd3255d9646889829de0e322c3f9a2e5728ce Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Thu, 26 May 2022 17:42:31 -0700 Subject: [PATCH 013/126] add qf.vim --- .vim/after/ftplugin/qf.vim | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .vim/after/ftplugin/qf.vim diff --git a/.vim/after/ftplugin/qf.vim b/.vim/after/ftplugin/qf.vim new file mode 100644 index 0000000..895d7ac --- /dev/null +++ b/.vim/after/ftplugin/qf.vim @@ -0,0 +1,3 @@ +nmap <buffer> { <Plug>(qf_previous_file) +nmap <buffer> } <Plug>(qf_next_file) +nmap <buffer> dd <cmd>.Reject<cr> From 7c65b5f6126e1ed295c103b73d83653f35bc96c4 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 8 Jun 2022 15:04:55 -0700 Subject: [PATCH 014/126] alias for changing font size --- .config/fish/functions/fish_user_key_bindings.fish | 4 ++++ bin/unborkify | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.config/fish/functions/fish_user_key_bindings.fish b/.config/fish/functions/fish_user_key_bindings.fish index ff0d9f3..cb9f03e 100644 --- a/.config/fish/functions/fish_user_key_bindings.fish +++ b/.config/fish/functions/fish_user_key_bindings.fish @@ -1,3 +1,7 @@ function fish_user_key_bindings fzf_key_bindings end + +function fsize + sed -i "s/size:.*/size: $argv/" $HOME/.config/alacritty/alacritty.yml +end diff --git a/bin/unborkify b/bin/unborkify index 120f56d..111940a 100755 --- a/bin/unborkify +++ b/bin/unborkify @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl +#!/usr/bin/perl use Getopt::Std; getopts('u'); From 6aaa5018aeb82151907fd8662b13adee80e5525c Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 8 Jun 2022 15:12:58 -0700 Subject: [PATCH 015/126] display terminal size in tmux --- .tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index 47e3e77..3f8b099 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -56,7 +56,7 @@ set-window-option -g window-style fg=#aaaaaa,bg=#111111 set-window-option -g window-active-style fg=terminal,bg=terminal set -g status-left '#[fg=green][ #H ][ ' -set -g status-right '#[fg=green]][ #[bright]#[fg=blue]%Y-%m-%d #[fg=white]%I:%M #[dim]#[fg=green]]' +set -g status-right '#[fg=green]][ #{pane_width}x#{pane_height} #[bright]#[fg=blue]%Y-%m-%d #[fg=white]%I:%M #[dim]#[fg=green]]' # Notifying if other windows has activities setw -g monitor-activity on From 14c50758fbc778387f3fcbccfd7b7e5b3975d9d7 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 8 Jun 2022 15:14:06 -0700 Subject: [PATCH 016/126] Small nvim fixes --- .vim/nvim.lua | 2 +- .vimrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 5d719d2..1c4023d 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -65,7 +65,7 @@ function org_imports(wait_ms) for _, res in pairs(result or {}) do for _, r in pairs(res.result or {}) do if r.edit then - vim.lsp.util.apply_workspace_edit(r.edit) + vim.lsp.util.apply_workspace_edit(r.edit, "utf-8") else vim.lsp.buf.execute_command(r.command) end diff --git a/.vimrc b/.vimrc index 0dc1b9b..fed699c 100644 --- a/.vimrc +++ b/.vimrc @@ -294,7 +294,7 @@ autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 1000) autocmd BufWritePre *.py lua vim.lsp.buf.formatting_sync(nil, 1000) autocmd BufWritePre *.rs lua vim.lsp.buf.formatting_seq_sync(nil, 1000) autocmd BufWritePre *.go lua vim.lsp.buf.formatting_seq_sync(nil, 1000) -autocmd BufWritePre *.go :silent! lua org_imports(3000) +autocmd BufWritePre *.go silent! lua org_imports(3000) " Goto previous/next diagnostic warning/error nnoremap <silent> g[ <cmd>lua vim.diagnostic.goto_prev()<CR> From c9520bf079dd20ce64d7997bb277b2adaa670a82 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 8 Jun 2022 15:04:55 -0700 Subject: [PATCH 017/126] alias for changing font size --- .config/fish/functions/fish_user_key_bindings.fish | 4 ++++ bin/unborkify | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.config/fish/functions/fish_user_key_bindings.fish b/.config/fish/functions/fish_user_key_bindings.fish index ff0d9f3..cb9f03e 100644 --- a/.config/fish/functions/fish_user_key_bindings.fish +++ b/.config/fish/functions/fish_user_key_bindings.fish @@ -1,3 +1,7 @@ function fish_user_key_bindings fzf_key_bindings end + +function fsize + sed -i "s/size:.*/size: $argv/" $HOME/.config/alacritty/alacritty.yml +end diff --git a/bin/unborkify b/bin/unborkify index 120f56d..111940a 100755 --- a/bin/unborkify +++ b/bin/unborkify @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl +#!/usr/bin/perl use Getopt::Std; getopts('u'); From c864b6df9f221e40ae62e1a20bde746e10fb88f2 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 8 Jun 2022 15:12:58 -0700 Subject: [PATCH 018/126] display terminal size in tmux --- .tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index fa9b85b..be04e79 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -58,7 +58,7 @@ set-window-option -g window-style fg=#aaaaaa,bg=terminal set-window-option -g window-active-style fg=terminal,bg=terminal set -g status-left '#[fg=green][ #H ][ ' -set -g status-right '#[fg=green]][ #[bright]#[fg=blue]%Y-%m-%d #[fg=white]%I:%M #[dim]#[fg=green]]' +set -g status-right '#[fg=green]][ #{pane_width}x#{pane_height} #[bright]#[fg=blue]%Y-%m-%d #[fg=white]%I:%M #[dim]#[fg=green]]' # Notifying if other windows has activities setw -g monitor-activity on From 9cac6e0f8505e0f94436165af89029c123fbc9c7 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 19 Jul 2022 14:11:08 -0700 Subject: [PATCH 019/126] update vimrc from hermia --- .vim/nvim.lua | 303 ++++++++++++++++++++++++++++++---------------------------- .vimrc | 9 +- 2 files changed, 162 insertions(+), 150 deletions(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 1c4023d..3f5fb93 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -1,7 +1,7 @@ -require('nvim-autopairs').setup{} +require('nvim-autopairs').setup {} -- nvim_lsp object -local nvim_lsp = require'lspconfig' +local nvim_lsp = require 'lspconfig' -- function to attach completion when setting up lsp local on_attach = function(client) @@ -18,19 +18,29 @@ rust_capabilities.textDocument.completion.completionItem.resolveSupport = { } -- Enable rust_analyzer -nvim_lsp.rust_analyzer.setup({ - on_attach=on_attach, - capabilities=rust_capabilities, +nvim_lsp.rust_analyzer.setup({ + on_attach = on_attach, + capabilities = rust_capabilities, }) -nvim_lsp.gopls.setup({ on_attach=on_attach }) -nvim_lsp.pyright.setup({ on_attach=on_attach }) -nvim_lsp.clangd.setup({ on_attach=on_attach }) +nvim_lsp.gopls.setup({ on_attach = on_attach }) +nvim_lsp.pyright.setup({ on_attach = on_attach }) +nvim_lsp.clangd.setup({ on_attach = on_attach }) +nvim_lsp.tsserver.setup { + cmd = { "/home/barak/.yarn/bin/typescript-language-server", "--stdio" } +} +nvim_lsp.vuels.setup { + cmd = { "/home/barak/.yarn/bin/vls" } +} + +nvim_lsp.svelte.setup { + cmd = { "/home/barak/.yarn/bin/svelteserver", "--stdio" } +} local runtime_path = vim.split(package.path, ';') table.insert(runtime_path, "lua/?.lua") table.insert(runtime_path, "lua/?/init.lua") -require'lspconfig'.sumneko_lua.setup { +require 'lspconfig'.sumneko_lua.setup { settings = { Lua = { runtime = { @@ -41,7 +51,7 @@ require'lspconfig'.sumneko_lua.setup { }, diagnostics = { -- Get the language server to recognize the `vim` global - globals = {'vim'}, + globals = { 'vim' }, }, workspace = { -- Make the server aware of Neovim runtime files @@ -56,52 +66,52 @@ require'lspconfig'.sumneko_lua.setup { } function org_imports(wait_ms) - local params = vim.lsp.util.make_range_params() + local params = vim.lsp.util.make_range_params() - params.context = {only = {"source.organizeImports"}} + params.context = { only = { "source.organizeImports" } } - local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, wait_ms) + local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, wait_ms) - for _, res in pairs(result or {}) do - for _, r in pairs(res.result or {}) do - if r.edit then - vim.lsp.util.apply_workspace_edit(r.edit, "utf-8") - else - vim.lsp.buf.execute_command(r.command) - end - end - end + for _, res in pairs(result or {}) do + for _, r in pairs(res.result or {}) do + if r.edit then + vim.lsp.util.apply_workspace_edit(r.edit, "utf-8") + else + vim.lsp.buf.execute_command(r.command) + end + end + end end nvim_lsp.efm.setup { - init_options = {documentFormatting = true}, - settings = { - rootMarkers = {".git/"}, - languages = { - lua = { - { formatCommand = "lua-format -i", formatStdin = true } - }, - python = { - { formatCommand = 'black --quiet -', formatStdin = true } - }, - rust = { - { formatCommand = 'rustfmt', formatStdin = true } - } - } + init_options = { documentFormatting = true }, + settings = { + rootMarkers = { ".git/" }, + languages = { + lua = { + { formatCommand = "lua-format -i", formatStdin = true } + }, + python = { + { formatCommand = 'black --quiet -', formatStdin = true } + }, + rust = { + { formatCommand = 'rustfmt', formatStdin = true } + } } + } } -- Enable diagnostics vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - signs = true, - update_in_insert = false, - } + virtual_text = false, + signs = true, + update_in_insert = false, +} ) -- Compe setup -require'compe'.setup { +require 'compe'.setup { enabled = true; autocomplete = true; debug = false; @@ -122,21 +132,21 @@ require'compe'.setup { } --signature_cfg = { - --hint_enable = true, - --hint_prefix = "% ", - --handler_opts = { - --border = "none" - --}, +--hint_enable = true, +--hint_prefix = "% ", +--handler_opts = { +--border = "none" +--}, --} --require'lsp_signature'.on_attach(signature_cfg) saga_cfg = { - code_action_prompt = { - enable = false, - sign = false, - virtual_text = false, - }, + code_action_prompt = { + enable = false, + sign = false, + virtual_text = false, + }, } -- require'lspsaga'.init_lsp_saga(saga_cfg) @@ -145,12 +155,12 @@ local t = function(str) end local check_back_space = function() - local col = vim.fn.col('.') - 1 - if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then - return true - else - return false - end + local col = vim.fn.col('.') - 1 + if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then + return true + else + return false + end end -- Use (s-)tab to: @@ -173,49 +183,49 @@ _G.s_tab_complete = function() end end -vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true}) -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}) +vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", { expr = true }) +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 }) require('lspkind').init({ - -- disables text annotations - --with_text = false, - --with_text = true, + -- disables text annotations + --with_text = false, + --with_text = true, - -- defines how annotations are shown - -- default: symbol - -- options: 'text', 'text_symbol', 'symbol_text', 'symbol' - mode = 'symbol', + -- defines how annotations are shown + -- default: symbol + -- options: 'text', 'text_symbol', 'symbol_text', 'symbol' + mode = 'symbol', - -- default symbol map - -- can be either 'default' or 'codicons' - preset = 'default', + -- default symbol map + -- can be either 'default' or 'codicons' + preset = 'default', - -- override preset symbols - -- default: {} - --symbol_map = { - --Method = 'm', - --Function = 'f', - --Text = 'txt', - --Constructor = 'new', - --Variable = 'var', - --Class = 'cls', - --Interface = 'iface', - --Module = 'mod', - --Property = 'prop', - --Unit = 'unit', - --Value = 'val', - --Enum = 'enum', - --Keyword = 'kw', - --Snippet = 'sn', - --Color = 'color', - --File = 'file', - --Folder = 'fold', - --EnumMember = 'enum', - --Constant = 'const', - --Struct = 'struct', - --}, + -- override preset symbols + -- default: {} + --symbol_map = { + --Method = 'm', + --Function = 'f', + --Text = 'txt', + --Constructor = 'new', + --Variable = 'var', + --Class = 'cls', + --Interface = 'iface', + --Module = 'mod', + --Property = 'prop', + --Unit = 'unit', + --Value = 'val', + --Enum = 'enum', + --Keyword = 'kw', + --Snippet = 'sn', + --Color = 'color', + --File = 'file', + --Folder = 'fold', + --EnumMember = 'enum', + --Constant = 'const', + --Struct = 'struct', + --}, }) --require('rust-tools').setup({ @@ -224,27 +234,27 @@ require('lspkind').init({ require('trouble').setup { mode = "document_diagnostics", auto_close = true, - action_keys = { -- key mappings for actions in the trouble list - -- map to {} to remove a mapping, for example: - -- close = {}, - --close = "q", -- close the list - --cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor - --refresh = "r", -- manually refresh - jump = {"o", "<tab>"}, -- jump to the diagnostic or open / close folds - --open_split = { "<c-x>" }, -- open buffer in new split - --open_vsplit = { "<c-v>" }, -- open buffer in new vsplit - open_tab = { }, -- open buffer in new tab - jump_close = {"<cr>"}, -- jump to the diagnostic and close the list - toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode - toggle_preview = "P", -- toggle auto_preview - hover = "K", -- opens a small popup with the full multiline message - preview = "p", -- preview the diagnostic location - close_folds = {"zM", "zm"}, -- close all folds - open_folds = {"zR", "zr"}, -- open all folds - toggle_fold = {"zA", "za"}, -- toggle fold of current file - previous = "k", -- previous item - next = "j" -- next item - }, + action_keys = { -- key mappings for actions in the trouble list + -- map to {} to remove a mapping, for example: + -- close = {}, + --close = "q", -- close the list + --cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor + --refresh = "r", -- manually refresh + jump = { "o", "<tab>" }, -- jump to the diagnostic or open / close folds + --open_split = { "<c-x>" }, -- open buffer in new split + --open_vsplit = { "<c-v>" }, -- open buffer in new vsplit + open_tab = {}, -- open buffer in new tab + jump_close = { "<cr>" }, -- jump to the diagnostic and close the list + toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode + toggle_preview = "P", -- toggle auto_preview + hover = "K", -- opens a small popup with the full multiline message + preview = "p", -- preview the diagnostic location + close_folds = { "zM", "zm" }, -- close all folds + open_folds = { "zR", "zr" }, -- open all folds + toggle_fold = { "zA", "za" }, -- toggle fold of current file + previous = "k", -- previous item + next = "j" -- next item + }, } local trouble_telescope = require("trouble.providers.telescope") @@ -283,23 +293,23 @@ require('telescope').setup { }, } -local builtin = require'telescope.builtin' +local builtin = require 'telescope.builtin' -local dropdown = require'telescope.themes'.get_dropdown({ +local dropdown = require 'telescope.themes'.get_dropdown({ --previewer = false, --prompt_title = "", --results_height = 16, --width = 0.6, --borderchars = { - --{"─", "│", "─", "│", "╭", "╮", "╯", "╰"}, - --prompt = {"─", "│", " ", "│", "╭", "╮", "│", "│"}, - --results = {"─", "│", "─", "│", "├", "┤", "╯", "╰"}, - --preview = {"─", "│", "─", "│", "╭", "╮", "╯", "╰"} + --{"─", "│", "─", "│", "╭", "╮", "╯", "╰"}, + --prompt = {"─", "│", " ", "│", "╭", "╮", "│", "│"}, + --results = {"─", "│", "─", "│", "├", "┤", "╯", "╰"}, + --preview = {"─", "│", "─", "│", "╭", "╮", "╯", "╰"} --}, --winblend = 10 }) -local telescope_ivy = require'telescope.themes'.get_ivy({ +local telescope_ivy = require 'telescope.themes'.get_ivy({ }) @@ -308,7 +318,7 @@ local telescope_ivy = require'telescope.themes'.get_ivy({ -- Treesitter -- -require'nvim-treesitter.configs'.setup { +require 'nvim-treesitter.configs'.setup { -- One of "all", "maintained" (parsers with maintainers), or a list of languages ensure_installed = { "c", @@ -374,13 +384,13 @@ require'nvim-treesitter.configs'.setup { } } -require"nvim-treesitter.highlight".set_custom_captures { +require "nvim-treesitter.highlight".set_custom_captures { -- Highlight the @foo.bar capture group with the "Identifier" highlight group. -- ["foo.bar"] = "Identifier", ["generic_type_param"] = "TSCGenericTypeParam", } -require"neogen".setup {} +require "neogen".setup {} -- -- Helper functions for my own grepping commands. @@ -391,9 +401,9 @@ live_grep_repo = function(conf) local opt = telescope_ivy opt['cwd'] = vim.fn.systemlist("git rev-parse --show-toplevel")[1] --local opt = { - --cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + --cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] --} - for k,v in pairs(conf) do opt[k] = v end + for k, v in pairs(conf) do opt[k] = v end builtin.live_grep(opt) end @@ -402,21 +412,21 @@ git_grep_word = function(conf) local opt = telescope_ivy opt['cwd'] = vim.fn.systemlist("git rev-parse --show-toplevel")[1] --local opt = { - --cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + --cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] --} - for k,v in pairs(conf) do opt[k] = v end + for k, v in pairs(conf) do opt[k] = v end builtin.grep_string(opt) end buffer_telescope = function(conf) local opt = telescope_ivy - for k,v in pairs(conf) do opt[k] = v end + for k, v in pairs(conf) do opt[k] = v end builtin.buffers(opt) end file_list = function(conf) local opt = telescope_ivy - for k,v in pairs(conf) do opt[k] = v end + for k, v in pairs(conf) do opt[k] = v end builtin.git_files(opt) end @@ -425,15 +435,15 @@ end --- My own "where" clause generator for Rust --- function string.insert(str1, str2, pos) - return str1:sub(1,pos)..str2..str1:sub(pos+1) + return str1:sub(1, pos) .. str2 .. str1:sub(pos + 1) end function string.split(s, delimiter) - result = {}; - for match in (s..delimiter):gmatch("(.-)"..delimiter) do - table.insert(result, match); - end - return result; + result = {}; + for match in (s .. delimiter):gmatch("(.-)" .. delimiter) do + table.insert(result, match); + end + return result; end local function rust_whereify_line(line, var_name) @@ -456,13 +466,14 @@ local function rust_whereify_line(line, var_name) local whitespace = string.match(line, "^(%s*)") - local generic = "<"..var_name..">" + local generic = "<" .. var_name .. ">" local out = string.insert(line, generic, paren - 1) local brace = string.find(out, "%{") if brace == nil then brace = string.len(out) end - out = string.insert(out, "\n"..whitespace.."where\n"..whitespace.." "..var_name..": ,\n"..whitespace, brace - 1) + out = string.insert(out, "\n" .. whitespace .. "where\n" .. whitespace .. " " .. var_name .. ": ,\n" .. whitespace, + brace - 1) return string.split(out, "\n") end @@ -471,8 +482,8 @@ function rust_where_at_line() local var_name = vim.fn.input("Variable: ") local lineNum, col = unpack(vim.api.nvim_win_get_cursor(0)) local replacements = rust_whereify_line(vim.api.nvim_get_current_line(), var_name) - vim.api.nvim_buf_set_lines(0, lineNum-1, lineNum, false, replacements) - vim.api.nvim_win_set_cursor(0, {lineNum + 2, 4}) + vim.api.nvim_buf_set_lines(0, lineNum - 1, lineNum, false, replacements) + vim.api.nvim_win_set_cursor(0, { lineNum + 2, 4 }) end function neogen_dwim() @@ -483,17 +494,17 @@ function neogen_dwim() ["function_signature_item"] = "func", ["struct_item"] = "class", ["trait_item"] = "class", - ["package_clause"] = "type", - ["const_declaration"] = "type", + ["package_clause"] = "type", + ["const_declaration"] = "type", ["var_declaration"] = "type", ["class_definition"] = "class", } - local ts_utils = require'nvim-treesitter.ts_utils' + local ts_utils = require 'nvim-treesitter.ts_utils' local current_node = ts_utils.get_node_at_cursor() while (current_node) do local v = table[current_node:type()] - if v then + if v then require('neogen').generate({ type = v }) break else diff --git a/.vimrc b/.vimrc index fed699c..a7de08e 100644 --- a/.vimrc +++ b/.vimrc @@ -171,7 +171,7 @@ Plug 'plytophogy/vim-virtualenv' Plug 'lunaru/vim-less' Plug 'hylang/vim-hy', {'for': 'hy'} "Plug 'mhartington/nvim-typescript' -Plug 'leafgarland/typescript-vim' +"Plug 'leafgarland/typescript-vim' Plug 'leafOfTree/vim-svelte-plugin' "Plug 'posva/vim-vue' Plug 'Shougo/context_filetype.vim' @@ -272,9 +272,10 @@ nnoremap <silent> gr <cmd>lua require('telescope.builtin').lsp_references({ini nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR> nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR> "nnoremap <silent> gd <cmd>lua vim.lsp.buf.declaration()<CR> -"nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR> -nnoremap <silent> ga <cmd>lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"})<cr> -vnoremap <silent> ga :<C-U>lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"})<cr> +nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR> +"nnoremap <silent> ga <cmd>lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"})<cr> +vnoremap <silent> ga <cmd>lua vim.lsp.buf.range_code_action()<CR> +"vnoremap <silent> ga :<C-U>lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"})<cr> "nnoremap <silent> ge <cmd>lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false})<CR> "nnoremap <silent> ge <cmd>lua vim.diagnostic.open_float({focusable = false})<CR> From 8f4ceb7e2e5f60df981938cd3b3bfdaf45d45fae Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 19 Jul 2022 14:11:47 -0700 Subject: [PATCH 020/126] updates from deneb --- .vim/nvim.lua | 5 +++-- .vimrc | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 5d719d2..ed03b61 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -30,6 +30,7 @@ local runtime_path = vim.split(package.path, ';') table.insert(runtime_path, "lua/?.lua") table.insert(runtime_path, "lua/?/init.lua") + require'lspconfig'.sumneko_lua.setup { settings = { Lua = { @@ -55,13 +56,13 @@ require'lspconfig'.sumneko_lua.setup { }, } +require('go').setup() + function org_imports(wait_ms) local params = vim.lsp.util.make_range_params() - params.context = {only = {"source.organizeImports"}} local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, wait_ms) - for _, res in pairs(result or {}) do for _, r in pairs(res.result or {}) do if r.edit then diff --git a/.vimrc b/.vimrc index 0dc1b9b..eb8a754 100644 --- a/.vimrc +++ b/.vimrc @@ -144,7 +144,7 @@ Plug 'SirVer/ultisnips' Plug 'honza/vim-snippets' "Plug 'fatih/vim-go' Plug 'tpope/vim-abolish' -Plug 'sheerun/vim-polyglot' +"Plug 'sheerun/vim-polyglot' Plug 'Shougo/denite.nvim' Plug 'plytophogy/vim-virtualenv' "Plug 'ervandew/supertab' @@ -212,6 +212,7 @@ Plug 'kyazdani42/nvim-web-devicons' " for file icons "Plug 'kyazdani42/nvim-tree.lua' Plug 'ray-x/lsp_signature.nvim' +Plug 'ray-x/go.nvim' Plug 'RishabhRD/popfix' Plug 'RishabhRD/nvim-lsputils' @@ -272,9 +273,10 @@ nnoremap <silent> gr <cmd>lua require('telescope.builtin').lsp_references({ini nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR> nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR> "nnoremap <silent> gd <cmd>lua vim.lsp.buf.declaration()<CR> -"nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR> -nnoremap <silent> ga <cmd>lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"})<cr> -vnoremap <silent> ga :<C-U>lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"})<cr> +nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR> +"nnoremap <silent> ga <cmd>lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"})<cr> +vnoremap <silent> ga <cmd>lua vim.lsp.buf.range_code_actions()<CR> +"vnoremap <silent> ga :<C-U>lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"})<cr> "nnoremap <silent> ge <cmd>lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false})<CR> "nnoremap <silent> ge <cmd>lua vim.diagnostic.open_float({focusable = false})<CR> From a7c30c7a27753e997d88ff0ceff778a8f75e3d74 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sun, 24 Jul 2022 13:44:18 -0700 Subject: [PATCH 021/126] Add skeletons, fix double-eval of filetype.vim --- .vim/filetype.vim | 7 +++++-- .vim/skeletons/skeleton.vue | 19 ------------------- .vim/skeletons/svelte.skel | 9 +++++++++ .vim/skeletons/vue.skel | 19 +++++++++++++++++++ .vimrc | 3 +++ 5 files changed, 36 insertions(+), 21 deletions(-) delete mode 100644 .vim/skeletons/skeleton.vue create mode 100644 .vim/skeletons/svelte.skel create mode 100644 .vim/skeletons/vue.skel diff --git a/.vim/filetype.vim b/.vim/filetype.vim index a02e290..4db43a4 100644 --- a/.vim/filetype.vim +++ b/.vim/filetype.vim @@ -1,8 +1,10 @@ " general per-language filetype file -if exists("did\_load\_filetypes") +if exists("g:did_load_personal_filetypes") finish endif +let g:did_load_personal_filetypes = 1 + " Filetype mappingss augroup markdown au! BufRead,BufNewFile *.mkd setfiletype markdown @@ -117,7 +119,8 @@ autocmd FileType idris let b:auto_trim_whitespace=1 autocmd FileType java let b:auto_trim_whitespace=1 augroup templates - autocmd BufNewFile *.vue 0r ~/.vim/skeletons/skeleton.vue + autocmd BufNewFile *.vue 0r ~/.vim/skeletons/vue.skel + autocmd BufNewFile *.svelte 0r ~/.vim/skeletons/svelte.skel augroup end augroup rust diff --git a/.vim/skeletons/skeleton.vue b/.vim/skeletons/skeleton.vue deleted file mode 100644 index 8310166..0000000 --- a/.vim/skeletons/skeleton.vue +++ /dev/null @@ -1,19 +0,0 @@ -<template> - -</template> - -<script> -//import header from './header.vue' - -export default { - name: 'components', - data () { - return { - msg: 'Hello World' - } - } -} -</script> - -<style> -</style> diff --git a/.vim/skeletons/svelte.skel b/.vim/skeletons/svelte.skel new file mode 100644 index 0000000..4f2a325 --- /dev/null +++ b/.vim/skeletons/svelte.skel @@ -0,0 +1,9 @@ +<script lang="ts"> + import { onMount, onDestroy } from "svelte"; +</script> + +<div> +</div> + +<style> +</style> diff --git a/.vim/skeletons/vue.skel b/.vim/skeletons/vue.skel new file mode 100644 index 0000000..8310166 --- /dev/null +++ b/.vim/skeletons/vue.skel @@ -0,0 +1,19 @@ +<template> + +</template> + +<script> +//import header from './header.vue' + +export default { + name: 'components', + data () { + return { + msg: 'Hello World' + } + } +} +</script> + +<style> +</style> diff --git a/.vimrc b/.vimrc index 1bb6605..4b0b9dc 100644 --- a/.vimrc +++ b/.vimrc @@ -355,9 +355,12 @@ colorscheme codedark "colorscheme slate "colorscheme dante + " Turn on the cursorline (highlight on line under cursor) but only for the " window and buffer you're currently in. A handy trick, I'm trying out as of " 2013-04-12 but the jury is still out. +" +" 2022-07-24 -- It's essential and I got a laugh reading this 9 years later. autocmd BufEnter * setlocal cursorline autocmd WinEnter * setlocal cursorline autocmd WinLeave * setlocal nocursorline From e4d00421144b3e65f0fba741608cb0b507948a56 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sun, 21 Aug 2022 13:40:53 -0700 Subject: [PATCH 022/126] add missing fish file, new alacritty binding --- .config/alacritty/alacritty.yml | 8 +- .config/fish/conf.d/key-bindings.fish | 172 ++++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 .config/fish/conf.d/key-bindings.fish diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 15b423e..22cb253 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -866,13 +866,19 @@ hints: mods: Control|Shift - regex: "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)\ [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" + action: Copy + binding: + key: U + mods: Control|Shift + - regex: "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)\ + [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" command: xdg-open post_processing: true mouse: enabled: true mods: None binding: - key: U + key: L mods: Control|Shift #debug: # Display the time it takes to redraw each frame. diff --git a/.config/fish/conf.d/key-bindings.fish b/.config/fish/conf.d/key-bindings.fish new file mode 100644 index 0000000..36b3aa3 --- /dev/null +++ b/.config/fish/conf.d/key-bindings.fish @@ -0,0 +1,172 @@ +# ____ ____ +# / __/___ / __/ +# / /_/_ / / /_ +# / __/ / /_/ __/ +# /_/ /___/_/ key-bindings.fish +# +# - $FZF_TMUX_OPTS +# - $FZF_CTRL_T_COMMAND +# - $FZF_CTRL_T_OPTS +# - $FZF_CTRL_R_OPTS +# - $FZF_ALT_C_COMMAND +# - $FZF_ALT_C_OPTS + +# Key bindings +# ------------ +function fzf_key_bindings + + # Store current token in $dir as root for the 'find' command + function fzf-file-widget -d "List files and folders" + set -l commandline (__fzf_parse_commandline) + set -l dir $commandline[1] + set -l fzf_query $commandline[2] + set -l prefix $commandline[3] + + # "-path \$dir'*/\\.*'" matches hidden files/folders inside $dir but not + # $dir itself, even if hidden. + test -n "$FZF_CTRL_T_COMMAND"; or set -l FZF_CTRL_T_COMMAND " + command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \ + -o -type f -print \ + -o -type d -print \ + -o -type l -print 2> /dev/null | sed 's@^\./@@'" + + test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40% + begin + set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" + eval "$FZF_CTRL_T_COMMAND | "(__fzfcmd)' -m --query "'$fzf_query'"' | while read -l r; set result $result $r; end + end + if [ -z "$result" ] + commandline -f repaint + return + else + # Remove last token from commandline. + commandline -t "" + end + for i in $result + commandline -it -- $prefix + commandline -it -- (string escape $i) + commandline -it -- ' ' + end + commandline -f repaint + end + + function fzf-history-widget -d "Show command history" + test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40% + begin + set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT $FZF_DEFAULT_OPTS --tiebreak=index --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS +m" + + set -l FISH_MAJOR (echo $version | cut -f1 -d.) + set -l FISH_MINOR (echo $version | cut -f2 -d.) + + # history's -z flag is needed for multi-line support. + # history's -z flag was added in fish 2.4.0, so don't use it for versions + # before 2.4.0. + if [ "$FISH_MAJOR" -gt 2 -o \( "$FISH_MAJOR" -eq 2 -a "$FISH_MINOR" -ge 4 \) ]; + history -z | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | read -lz result + and commandline -- $result + else + history | eval (__fzfcmd) -q '(commandline)' | read -l result + and commandline -- $result + end + end + commandline -f repaint + end + + function fzf-cd-widget -d "Change directory" + set -l commandline (__fzf_parse_commandline) + set -l dir $commandline[1] + set -l fzf_query $commandline[2] + set -l prefix $commandline[3] + + test -n "$FZF_ALT_C_COMMAND"; or set -l FZF_ALT_C_COMMAND " + command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \ + -o -type d -print 2> /dev/null | sed 's@^\./@@'" + test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40% + begin + set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" + eval "$FZF_ALT_C_COMMAND | "(__fzfcmd)' +m --query "'$fzf_query'"' | read -l result + + if [ -n "$result" ] + builtin cd -- $result + + # Remove last token from commandline. + commandline -t "" + commandline -it -- $prefix + end + end + + commandline -f repaint + end + + function __fzfcmd + test -n "$FZF_TMUX"; or set FZF_TMUX 0 + test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40% + if [ -n "$FZF_TMUX_OPTS" ] + echo "fzf-tmux $FZF_TMUX_OPTS -- " + else if [ $FZF_TMUX -eq 1 ] + echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- " + else + echo "fzf" + end + end + + bind \ct fzf-file-widget + bind \cr fzf-history-widget + bind \ec fzf-cd-widget + + if bind -M insert > /dev/null 2>&1 + bind -M insert \ct fzf-file-widget + bind -M insert \cr fzf-history-widget + bind -M insert \ec fzf-cd-widget + end + + function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath, fzf query, and optional -option= prefix' + set -l commandline (commandline -t) + + # strip -option= from token if present + set -l prefix (string match -r -- '^-[^\s=]+=' $commandline) + set commandline (string replace -- "$prefix" '' $commandline) + + # eval is used to do shell expansion on paths + eval set commandline $commandline + + if [ -z $commandline ] + # Default to current directory with no --query + set dir '.' + set fzf_query '' + else + set dir (__fzf_get_dir $commandline) + + if [ "$dir" = "." -a (string sub -l 1 -- $commandline) != '.' ] + # if $dir is "." but commandline is not a relative path, this means no file path found + set fzf_query $commandline + else + # Also remove trailing slash after dir, to "split" input properly + set fzf_query (string replace -r "^$dir/?" -- '' "$commandline") + end + end + + echo $dir + echo $fzf_query + echo $prefix + end + + function __fzf_get_dir -d 'Find the longest existing filepath from input string' + set dir $argv + + # Strip all trailing slashes. Ignore if $dir is root dir (/) + if [ (string length -- $dir) -gt 1 ] + set dir (string replace -r '/*$' -- '' $dir) + end + + # Iteratively check if dir exists and strip tail end of path + while [ ! -d "$dir" ] + # If path is absolute, this can keep going until ends up at / + # If path is relative, this can keep going until entire input is consumed, dirname returns "." + set dir (dirname -- "$dir") + end + + echo $dir + end + +end From 423a767254f83efb73128248ed26933aa60dc4bb Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Fri, 26 Aug 2022 19:32:02 -0700 Subject: [PATCH 023/126] better alacritty for linux --- .config/alacritty/alacritty.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 22cb253..c3819db 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -29,9 +29,9 @@ window: # Number of lines/columns (not pixels) in the terminal. The number of columns # must be at least `2`, while using a value of `0` for columns and lines will # fall back to the window manager's recommended size. - #dimensions: - # columns: 0 - # lines: 0 + dimensions: + columns: 106 + lines: 24 # Window position (changes require restart) # @@ -72,7 +72,7 @@ window: # # Values for `startup_mode` (macOS only): # - SimpleFullscreen - #startup_mode: Windowed + startup_mode: Windowed # Window title #title: Alacritty @@ -92,7 +92,7 @@ window: # Override the variant of the GTK theme. Commonly supported values are `dark` # and `light`. Set this to `None` to use the default theme variant. #gtk_theme_variant: None - opacity: 0.92 + opacity: 0.88 scrolling: # Maximum number of lines in the scrollback buffer. @@ -151,7 +151,7 @@ font: style: Oblique # Point size - size: 17.0 + size: 19.0 # Offset is the extra space around each character. `offset.y` can be thought # of as modifying the line spacing, and `offset.x` as modifying the letter @@ -830,7 +830,7 @@ key_bindings: #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } # (Windows only) - #- { key: Return, mods: Alt, action: ToggleFullscreen } + - { key: Return, mods: Alt, action: ToggleFullscreen } # (macOS only) #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } From 77e0a5a50f6e5493624276ba867d7d5a83f87c0c Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Fri, 26 Aug 2022 19:41:07 -0700 Subject: [PATCH 024/126] remove vimrc error on fedora --- .vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.vimrc b/.vimrc index 4b0b9dc..62c2653 100644 --- a/.vimrc +++ b/.vimrc @@ -87,6 +87,7 @@ endif let g:tex_flavor = 'latex' let g:polyglot_disabled = ['latex'] +let g:powerline_loaded = 1 " Required: From 41db2b047e96417824f1451a0270b8c16b717b3d Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Fri, 26 Aug 2022 22:55:25 -0400 Subject: [PATCH 025/126] add rofi to dotfiles --- .config/rofi/config.rasi | 3 + .local/share/rofi/themes/rounded-blue-dark.rasi | 18 +++++ .local/share/rofi/themes/rounded-common.rasi | 94 +++++++++++++++++++++ .local/share/rofi/themes/rounded-gray-dark.rasi | 18 +++++ .local/share/rofi/themes/rounded-green-dark.rasi | 18 +++++ .local/share/rofi/themes/rounded-nord-dark.rasi | 22 +++++ .local/share/rofi/themes/rounded-orange-dark.rasi | 18 +++++ .local/share/rofi/themes/rounded-pink-dark.rasi | 18 +++++ .local/share/rofi/themes/rounded-purple-dark.rasi | 18 +++++ .local/share/rofi/themes/rounded-red-dark.rasi | 18 +++++ .local/share/rofi/themes/rounded-yellow-dark.rasi | 18 +++++ .local/share/rofi/themes/spotlight-dark.rasi | 99 +++++++++++++++++++++++ .local/share/rofi/themes/spotlight.rasi | 99 +++++++++++++++++++++++ 13 files changed, 461 insertions(+) create mode 100644 .config/rofi/config.rasi create mode 100644 .local/share/rofi/themes/rounded-blue-dark.rasi create mode 100644 .local/share/rofi/themes/rounded-common.rasi create mode 100644 .local/share/rofi/themes/rounded-gray-dark.rasi create mode 100644 .local/share/rofi/themes/rounded-green-dark.rasi create mode 100644 .local/share/rofi/themes/rounded-nord-dark.rasi create mode 100644 .local/share/rofi/themes/rounded-orange-dark.rasi create mode 100644 .local/share/rofi/themes/rounded-pink-dark.rasi create mode 100644 .local/share/rofi/themes/rounded-purple-dark.rasi create mode 100644 .local/share/rofi/themes/rounded-red-dark.rasi create mode 100644 .local/share/rofi/themes/rounded-yellow-dark.rasi create mode 100644 .local/share/rofi/themes/spotlight-dark.rasi create mode 100644 .local/share/rofi/themes/spotlight.rasi diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi new file mode 100644 index 0000000..523ae81 --- /dev/null +++ b/.config/rofi/config.rasi @@ -0,0 +1,3 @@ +//@theme "/home/barak/.local/share/rofi/themes/spotlight-dark.rasi" +//@theme "/home/barak/.local/share/rofi/themes/rounded-blue-dark.rasi" +@theme "/home/barak/.local/share/rofi/themes/spotlight-dark.rasi" diff --git a/.local/share/rofi/themes/rounded-blue-dark.rasi b/.local/share/rofi/themes/rounded-blue-dark.rasi new file mode 100644 index 0000000..712d714 --- /dev/null +++ b/.local/share/rofi/themes/rounded-blue-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #1A73E8F2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/.local/share/rofi/themes/rounded-common.rasi b/.local/share/rofi/themes/rounded-common.rasi new file mode 100644 index 0000000..5072337 --- /dev/null +++ b/.local/share/rofi/themes/rounded-common.rasi @@ -0,0 +1,94 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "Roboto 12"; + + background-color: transparent; + text-color: @fg0; + + margin: 0px; + padding: 0px; + spacing: 0px; +} + +window { + location: center; + width: 480; + y-offset: -200; + border-radius: 24px; + + background-color: @bg0; +} + +mainbox { + padding: 12px; +} + +inputbar { + background-color: @bg1; + border-color: @bg3; + + border: 2px; + border-radius: 16px; + + padding: 8px 16px; + spacing: 8px; + children: [ prompt, entry ]; +} + +prompt { + text-color: @fg2; +} + +entry { + placeholder: "Search"; + placeholder-color: @fg3; +} + +message { + margin: 12px 0 0; + border-radius: 16px; + border-color: @bg2; + background-color: @bg2; +} + +textbox { + padding: 8px 24px; +} + +listview { + background-color: transparent; + + margin: 12px 0 0; + lines: 8; + columns: 1; + + fixed-height: false; +} + +element { + padding: 8px 16px; + spacing: 8px; + border-radius: 16px; +} + +element normal active { + text-color: @bg3; +} + +element selected normal, element selected active { + background-color: @bg3; +} + +element-icon { + size: 1em; + vertical-align: 0.5; +} + +element-text { + text-color: inherit; +} diff --git a/.local/share/rofi/themes/rounded-gray-dark.rasi b/.local/share/rofi/themes/rounded-gray-dark.rasi new file mode 100644 index 0000000..943280d --- /dev/null +++ b/.local/share/rofi/themes/rounded-gray-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #616161F2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/.local/share/rofi/themes/rounded-green-dark.rasi b/.local/share/rofi/themes/rounded-green-dark.rasi new file mode 100644 index 0000000..a268f62 --- /dev/null +++ b/.local/share/rofi/themes/rounded-green-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #4CAF50F2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/.local/share/rofi/themes/rounded-nord-dark.rasi b/.local/share/rofi/themes/rounded-nord-dark.rasi new file mode 100644 index 0000000..ef35389 --- /dev/null +++ b/.local/share/rofi/themes/rounded-nord-dark.rasi @@ -0,0 +1,22 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #2E3440F2; + bg1: #3B4252; + bg2: #4C566A80; + bg3: #88C0D0F2; + fg0: #D8DEE9; + fg1: #ECEFF4; + fg2: #D8DEE9; + fg3: #4C566A; +} + +@import "rounded-common.rasi" + +element selected { + text-color: @bg1; +} diff --git a/.local/share/rofi/themes/rounded-orange-dark.rasi b/.local/share/rofi/themes/rounded-orange-dark.rasi new file mode 100644 index 0000000..da4acea --- /dev/null +++ b/.local/share/rofi/themes/rounded-orange-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #F57C00F2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/.local/share/rofi/themes/rounded-pink-dark.rasi b/.local/share/rofi/themes/rounded-pink-dark.rasi new file mode 100644 index 0000000..2288dc0 --- /dev/null +++ b/.local/share/rofi/themes/rounded-pink-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #EC407AF2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/.local/share/rofi/themes/rounded-purple-dark.rasi b/.local/share/rofi/themes/rounded-purple-dark.rasi new file mode 100644 index 0000000..55c651b --- /dev/null +++ b/.local/share/rofi/themes/rounded-purple-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #AB47BCF2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/.local/share/rofi/themes/rounded-red-dark.rasi b/.local/share/rofi/themes/rounded-red-dark.rasi new file mode 100644 index 0000000..c1d71a6 --- /dev/null +++ b/.local/share/rofi/themes/rounded-red-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #E53935F2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/.local/share/rofi/themes/rounded-yellow-dark.rasi b/.local/share/rofi/themes/rounded-yellow-dark.rasi new file mode 100644 index 0000000..dbdaeb3 --- /dev/null +++ b/.local/share/rofi/themes/rounded-yellow-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #FBC02DF2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/.local/share/rofi/themes/spotlight-dark.rasi b/.local/share/rofi/themes/spotlight-dark.rasi new file mode 100644 index 0000000..2e68c69 --- /dev/null +++ b/.local/share/rofi/themes/spotlight-dark.rasi @@ -0,0 +1,99 @@ +/******************************************************************************* + * MACOS SPOTLIGHT LIKE DARK THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "Montserrat 12"; + + bg0: #242424E6; + bg1: #7E7E7E80; + bg2: #0860f2E6; + + fg0: #DEDEDE; + fg1: #FFFFFF; + fg2: #DEDEDE80; + + background-color: transparent; + text-color: @fg0; + + margin: 0; + padding: 0; + spacing: 0; +} + +window { + background-color: @bg0; + + location: center; + width: 640; + y-offset: -200; + border-radius: 8; +} + +inputbar { + font: "Montserrat 20"; + padding: 12px; + spacing: 12px; + children: [ icon-search, entry ]; +} + +icon-search { + expand: false; + filename: "search"; + size: 28px; +} + +icon-search, entry, element-icon, element-text { + vertical-align: 0.5; +} + +entry { + font: inherit; + + placeholder : "Search"; + placeholder-color : @fg2; +} + +message { + border: 2px 0 0; + border-color: @bg1; + background-color: @bg1; +} + +textbox { + padding: 8px 24px; +} + +listview { + lines: 10; + columns: 1; + + fixed-height: false; + border: 1px 0 0; + border-color: @bg1; +} + +element { + padding: 8px 16px; + spacing: 16px; + background-color: transparent; +} + +element normal active { + text-color: @bg2; +} + +element selected normal, element selected active { + background-color: @bg2; + text-color: @fg1; +} + +element-icon { + size: 1em; +} + +element-text { + text-color: inherit; +} diff --git a/.local/share/rofi/themes/spotlight.rasi b/.local/share/rofi/themes/spotlight.rasi new file mode 100644 index 0000000..3f17463 --- /dev/null +++ b/.local/share/rofi/themes/spotlight.rasi @@ -0,0 +1,99 @@ +/******************************************************************************* + * MACOS SPOTLIGHT LIKE THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "Montserrat 12"; + + bg0: #F5F5F5BF; + bg1: #7E7E7E80; + bg2: #0860F2E6; + + fg0: #242424; + fg1: #FFFFFF; + fg2: #24242480; + + background-color: transparent; + text-color: @fg0; + + margin: 0; + padding: 0; + spacing: 0; +} + +window { + background-color: @bg0; + + location: center; + width: 640; + y-offset: -200; + border-radius: 8; +} + +inputbar { + font: "Montserrat 20"; + padding: 12px; + spacing: 12px; + children: [ icon-search, entry ]; +} + +icon-search { + expand: false; + filename: "search"; + size: 28px; +} + +icon-search, entry, element-icon, element-text { + vertical-align: 0.5; +} + +entry { + font: inherit; + + placeholder : "Search"; + placeholder-color : @fg2; +} + +message { + border: 2px 0 0; + border-color: @bg1; + background-color: @bg1; +} + +textbox { + padding: 8px 24px; +} + +listview { + lines: 10; + columns: 1; + + fixed-height: false; + border: 1px 0 0; + border-color: @bg1; +} + +element { + padding: 8px 16px; + spacing: 16px; + background-color: transparent; +} + +element normal active { + text-color: @bg2; +} + +element selected normal, element selected active { + background-color: @bg2; + text-color: @fg1; +} + +element-icon { + size: 1em; +} + +element-text { + text-color: inherit; +} From da084d324320414250e679ed3ed26436f87dbafc Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 30 Aug 2022 00:17:29 -0700 Subject: [PATCH 026/126] better configs, fix flatpaks --- .config/fish/config.fish | 8 ++++++++ .local/share/applications/com.spotify.Client.desktop | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.config/fish/config.fish b/.config/fish/config.fish index abc6bc4..ce0e409 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,5 +1,13 @@ set PATH ~/bin ~/.local/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin $PATH +if command -vq flatpak + set -ga fish_user_paths ~/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bin + set -gx --path XDG_DATA_DIRS /usr/local/share/ /usr/share/ ~/.local/share/flatpak/exports/share + for install_dir in (flatpak --installations) + set -gxa XDG_DATA_DIRS $install_dir/exports/share + end +end + set fish_greeting "" set EDITOR vi set -x GOPATH ~/.go diff --git a/.local/share/applications/com.spotify.Client.desktop b/.local/share/applications/com.spotify.Client.desktop index 1240b5d..bd0a8d4 100755 --- a/.local/share/applications/com.spotify.Client.desktop +++ b/.local/share/applications/com.spotify.Client.desktop @@ -4,7 +4,7 @@ Name=Spotify GenericName=Online music streaming service Comment=Access all of your favorite music Icon=com.spotify.Client -Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client --force-device-scale-factor=1.5 @@u %U @@ +Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client --force-device-scale-factor=1.3 @@u %U @@ Terminal=false MimeType=x-scheme-handler/spotify; Categories=Audio;Music;AudioVideo; From 972c4d7a4d130de9e0746d9a205bfde4852e3de8 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Mon, 26 Sep 2022 21:24:08 -0700 Subject: [PATCH 027/126] update ragel filetype for vim and add .yarnrc --- .vim/filetype.vim | 4 ++++ .vimrc | 1 + .yarnrc | 6 ++++++ 3 files changed, 11 insertions(+) create mode 100644 .yarnrc diff --git a/.vim/filetype.vim b/.vim/filetype.vim index 4db43a4..7ab5a03 100644 --- a/.vim/filetype.vim +++ b/.vim/filetype.vim @@ -32,6 +32,10 @@ augroup pcal au BufNewFile,BufRead *.pcal setf tla augroup END +augroup ragel + au BufNewFile,BufRead *.rl setf ragel +augroup END + au! BufNewFile,BufRead *.pde setf arduino diff --git a/.vimrc b/.vimrc index 62c2653..9f8c7a5 100644 --- a/.vimrc +++ b/.vimrc @@ -171,6 +171,7 @@ Plug 'plytophogy/vim-virtualenv' " Plugins for syntax Plug 'lunaru/vim-less' Plug 'hylang/vim-hy', {'for': 'hy'} +Plug 'jneen/ragel.vim' "Plug 'mhartington/nvim-typescript' "Plug 'leafgarland/typescript-vim' Plug 'leafOfTree/vim-svelte-plugin' diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 0000000..c0c6531 --- /dev/null +++ b/.yarnrc @@ -0,0 +1,6 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +lastUpdateCheck 1664156115452 +prefix "/home/barak/.yarn" From d9fc1b77659b0024477a7f4729e411a94be4f60f Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 29 Nov 2022 10:45:32 -0800 Subject: [PATCH 028/126] add rust-analyzer config to nvim.lua --- .vim/nvim.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index fb95890..0cd4e9b 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -21,6 +21,17 @@ rust_capabilities.textDocument.completion.completionItem.resolveSupport = { nvim_lsp.rust_analyzer.setup({ on_attach = on_attach, capabilities = rust_capabilities, + settings = { + ['rust-analyzer'] = { + checkOnSave = { + allFeatures = true, + overrideCommand = { + 'cargo', 'clippy', '--workspace', '--message-format=json', + '--all-targets', '--all-features' + } + } + } + } }) nvim_lsp.gopls.setup({ on_attach = on_attach }) nvim_lsp.pyright.setup({ on_attach = on_attach }) From 1114ddf9477244732ba33062876b72ddfc8714e9 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 6 Dec 2022 16:02:54 -0800 Subject: [PATCH 029/126] update vim plugins --- .config/fish/conf.d/virtualfish-loader.fish | 16 ++++------------ .config/fish/config.fish | 2 +- .config/fish/fish_aliases.fish | 2 +- .vim/nvim.lua | 17 ++++++++++++----- .vimrc | 12 +++++++----- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.config/fish/conf.d/virtualfish-loader.fish b/.config/fish/conf.d/virtualfish-loader.fish index 562c018..c0790b2 100644 --- a/.config/fish/conf.d/virtualfish-loader.fish +++ b/.config/fish/conf.d/virtualfish-loader.fish @@ -1,12 +1,4 @@ -set -g VIRTUALFISH_VERSION 2.5.4 -set -g VIRTUALFISH_PYTHON_EXEC /bin/python - -set vfpaths /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish /usr/lib/python3.10/site-packages/virtualfish/virtual.fish /usr/lib/python3.9/site-packages/virtualfish/virtual.fish - -for vfpath in vfpaths - if test -f $vfpath - source $vfpath - emit virtualfish_did_setup_plugins - break - end -end +set -g VIRTUALFISH_VERSION 2.5.5 +set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python +source /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish +emit virtualfish_did_setup_plugins \ No newline at end of file diff --git a/.config/fish/config.fish b/.config/fish/config.fish index ce0e409..85134a2 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,4 +1,4 @@ -set PATH ~/bin ~/.local/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin $PATH +set PATH ~/bin ~/.local/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin ~/.ghcup/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin $PATH if command -vq flatpak set -ga fish_user_paths ~/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bin diff --git a/.config/fish/fish_aliases.fish b/.config/fish/fish_aliases.fish index ec2b922..1004a49 100644 --- a/.config/fish/fish_aliases.fish +++ b/.config/fish/fish_aliases.fish @@ -52,4 +52,4 @@ alias srsly="orly -s" #Funnies alias whothefuckis='finger' alias whoami="echo 24601" - +alias yeet="rm -rf" diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 0cd4e9b..522e167 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -35,6 +35,7 @@ nvim_lsp.rust_analyzer.setup({ }) nvim_lsp.gopls.setup({ on_attach = on_attach }) nvim_lsp.pyright.setup({ on_attach = on_attach }) + nvim_lsp.clangd.setup({ on_attach = on_attach }) nvim_lsp.tsserver.setup { cmd = { "/home/barak/.yarn/bin/typescript-language-server", "--stdio" } @@ -42,6 +43,9 @@ nvim_lsp.tsserver.setup { nvim_lsp.vuels.setup { cmd = { "/home/barak/.yarn/bin/vls" } } +nvim_lsp.hls.setup { + cmd = { "haskell-language-server-wrapper", "--lsp" } +} nvim_lsp.svelte.setup { cmd = { "/home/barak/.yarn/bin/svelteserver", "--stdio" } @@ -397,14 +401,17 @@ require 'nvim-treesitter.configs'.setup { } } -require "nvim-treesitter.highlight".set_custom_captures { - -- Highlight the @foo.bar capture group with the "Identifier" highlight group. - -- ["foo.bar"] = "Identifier", - ["generic_type_param"] = "TSCGenericTypeParam", -} +--require "nvim-treesitter.highlight".set_custom_captures { +---- Highlight the @foo.bar capture group with the "Identifier" highlight group. +---- ["foo.bar"] = "Identifier", +--["generic_type_param"] = "TSCGenericTypeParam", +--} require "neogen".setup {} +require('leap').set_default_keymaps() +require("flit").setup {} + -- -- Helper functions for my own grepping commands. -- diff --git a/.vimrc b/.vimrc index 9f8c7a5..b4f5e7f 100644 --- a/.vimrc +++ b/.vimrc @@ -231,7 +231,9 @@ Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-treesitter/playground' "Plug 'ggandor/lightspeed.nvim' -Plug 'justinmk/vim-sneak' +"Plug 'justinmk/vim-sneak' +Plug 'ggandor/leap.nvim' +Plug 'ggandor/flit.nvim' Plug 'simrat39/rust-tools.nvim' Plug 'Shougo/unite.vim' @@ -395,10 +397,10 @@ let g:UseGooglePythonSettings = 0 " * sneak.vim "let g:sneak#label = 1 -map f <Plug>Sneak_f -map F <Plug>Sneak_F -map t <Plug>Sneak_t -map T <Plug>Sneak_T +"map f <Plug>Sneak_f +"map F <Plug>Sneak_F +"map t <Plug>Sneak_t +"map T <Plug>Sneak_T " * Jedi let g:jedi#goto_command = "gd" From 06a0ac7cc423f06ab14a1806f2c7a8325cbb817c Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 6 Dec 2022 18:15:06 -0800 Subject: [PATCH 030/126] update vim colors for TreeSitter --- .vim/nvim.lua | 10 ++++------ .vimrc | 4 ++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 522e167..f31be04 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -375,6 +375,10 @@ require 'nvim-treesitter.configs'.setup { -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, + --custom_captures = { + --["generic_type_param"] = "TSCGenericTypeParam", + --["type_identifier"] = "TSCGenericTypeParam", + --}, }, indent = { @@ -401,12 +405,6 @@ require 'nvim-treesitter.configs'.setup { } } ---require "nvim-treesitter.highlight".set_custom_captures { ----- Highlight the @foo.bar capture group with the "Identifier" highlight group. ----- ["foo.bar"] = "Identifier", ---["generic_type_param"] = "TSCGenericTypeParam", ---} - require "neogen".setup {} require('leap').set_default_keymaps() diff --git a/.vimrc b/.vimrc index b4f5e7f..945e6a1 100644 --- a/.vimrc +++ b/.vimrc @@ -1068,3 +1068,7 @@ function! s:denite_my_settings() abort endfunction map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR> + +" Final hi links for TreeSitter + +hi link @type.rust TSCSecondaryTypeParam From 5ebe434fbf78785717f9a96b7c0de875846696fd Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 7 Dec 2022 14:02:32 -0800 Subject: [PATCH 031/126] add quickfixing to telescope --- .vim/nvim.lua | 26 +++++++++++++++++++++++--- .vimrc | 17 +++++++++-------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index f31be04..90b225a 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -275,16 +275,25 @@ require('trouble').setup { } local trouble_telescope = require("trouble.providers.telescope") +local builtin = require 'telescope.builtin' + +local sendtoqf = function(loc) + local actions = require('telescope.actions') + actions.send_to_qflist(loc) + builtin.quickfix({ initial_mode = "normal" }) +end require('telescope').setup { defaults = { mappings = { n = { ["q"] = require('telescope.actions').close, + ["ff"] = sendtoqf, ["<c-t>"] = trouble_telescope.open_with_trouble, }, i = { ["<c-t>"] = trouble_telescope.open_with_trouble, + ["ff"] = require('telescope.actions').send_to_qflist, }, }, }, @@ -307,10 +316,15 @@ require('telescope').setup { height = 15, }, }, + quickfix = { + theme = "ivy", + layout_config = { + height = 15, + }, + }, }, } -local builtin = require 'telescope.builtin' local dropdown = require 'telescope.themes'.get_dropdown({ --previewer = false, @@ -376,8 +390,8 @@ require 'nvim-treesitter.configs'.setup { -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, --custom_captures = { - --["generic_type_param"] = "TSCGenericTypeParam", - --["type_identifier"] = "TSCGenericTypeParam", + --["generic_type_param"] = "TSCGenericTypeParam", + --["type_identifier"] = "TSCGenericTypeParam", --}, }, @@ -448,6 +462,12 @@ file_list = function(conf) builtin.git_files(opt) end +--quickfix_telescope = function(conf) +--local opt = telescope_ivy +--for k, v in pairs(conf) do opt[k] = v end +--builtin.quickfix(opt) +--end + --- --- My own "where" clause generator for Rust diff --git a/.vimrc b/.vimrc index 945e6a1..f8aec23 100644 --- a/.vimrc +++ b/.vimrc @@ -198,7 +198,7 @@ Plug 'zchee/vim-goasm' "\ } "Plug 'ensime/ensime-vim', { 'do': ':UpdateRemotePlugins' } "Plug 'neoclide/coc.nvim', {'branch': 'release'} -Plug 'romainl/vim-qf' +"Plug 'romainl/vim-qf' Plug 'neovim/nvim-lspconfig' Plug 'nvim-lua/lsp_extensions.nvim' Plug 'hrsh7th/nvim-compe' @@ -296,8 +296,8 @@ set updatetime=500 autocmd CursorHold * lua vim.diagnostic.open_float({focusable = false}) " Autoformat on save -autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 1000) -autocmd BufWritePre *.py lua vim.lsp.buf.formatting_sync(nil, 1000) +autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_seq_sync(nil, 1000) +autocmd BufWritePre *.py lua vim.lsp.buf.formatting_seq_sync(nil, 1000) autocmd BufWritePre *.rs lua vim.lsp.buf.formatting_seq_sync(nil, 1000) autocmd BufWritePre *.go lua vim.lsp.buf.formatting_seq_sync(nil, 1000) autocmd BufWritePre *.go silent! lua org_imports(3000) @@ -320,12 +320,12 @@ inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 }) -let g:qf_auto_open_quickfix = 1 -let g:qf_auto_open_loclist = 0 +"let g:qf_auto_open_quickfix = 1 +"let g:qf_auto_open_loclist = 0 -nmap <PageUp> <Plug>(qf_qf_previous) -nmap <PageDown> <Plug>(qf_qf_next) -nmap ge <Plug>(qf_qf_toggle) +"nmap <PageUp> <Plug>(qf_qf_previous) +"nmap <PageDown> <Plug>(qf_qf_next) +"nmap ge <Plug>(qf_qf_toggle) "" Sources "source ~/.vim/supertab.vim @@ -1015,6 +1015,7 @@ nnoremap <silent> <Leader>aa :<C-u>RgRoot!<CR> nnoremap <silent> <C-k> <cmd>lua file_list{}<cr> nnoremap <silent> <Leader>ag <cmd>lua live_grep_repo{ word_match = "-w", only_sort_text = true, search = ''}<cr> nnoremap <silent> <Leader>aw <cmd>lua git_grep_word{ word_match = "-w", only_sort_text = true, initial_mode = "normal" }<cr> +nnoremap <silent> <Leader>q <cmd>lua require('telescope.builtin').quickfix{ initial_mode = "normal" }<cr> " For C++ -- A is a great plugin which allows you to jump from the c file to the " header and vice-versa. Mneumonic here is headerheader. From c667df83fa866b21a305b8c538114b2ecb8083e6 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Fri, 20 Jan 2023 15:18:11 -0800 Subject: [PATCH 032/126] add gohtmltmpl fix to vim config --- .vim/filetype.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.vim/filetype.vim b/.vim/filetype.vim index 7ab5a03..09676a1 100644 --- a/.vim/filetype.vim +++ b/.vim/filetype.vim @@ -130,3 +130,14 @@ augroup end augroup rust autocmd FileType rust nnoremap <Leader>lg <cmd>lua rust_where_at_line()<CR> augroup end + +function DetectGoHtmlTmpl() + if expand('%:e') == "html" && search("{{") != 0 + setfiletype gohtmltmpl + endif +endfunction + +augroup filetypedetect + " gohtmltmpl + au BufRead,BufNewFile *.html call DetectGoHtmlTmpl() +augroup END From d784acc82ab80c1f7b46a09575d380eadd5bb5fe Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Thu, 18 May 2023 15:23:57 -0700 Subject: [PATCH 033/126] Newer vimrc and asdf --- .config/fish/config.fish | 9 +++++++++ .config/k9s/config.yml | 17 +++++++++++------ .vim/nvim.lua | 7 +++++-- .vimrc | 5 +++-- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 85134a2..8160044 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -12,4 +12,13 @@ set fish_greeting "" set EDITOR vi set -x GOPATH ~/.go +if test -e $HOME/.asdf/asdf.fish + . ~/.asdf/asdf.fish +end + . ~/.config/fish/fish_aliases.fish + +# The next line updates PATH for the Google Cloud SDK. +if [ -f '/home/barak/local/google-cloud-sdk/path.fish.inc' ]; . '/home/barak/local/google-cloud-sdk/path.fish.inc'; end + +set GOOGLE_APPLICATION_CREDENTIALS "/home/barak/.memtoken.json" diff --git a/.config/k9s/config.yml b/.config/k9s/config.yml index 09a109e..9bf600b 100644 --- a/.config/k9s/config.yml +++ b/.config/k9s/config.yml @@ -2,11 +2,13 @@ k9s: refreshRate: 2 maxConnRetry: 5 enableMouse: true - headless: true + headless: false logoless: true crumbsless: false readOnly: false + noExitOnCtrlC: false noIcons: true + skipLatestRevCheck: false logger: tail: 100 buffer: 5000 @@ -14,27 +16,30 @@ k9s: fullScreenLogs: false textWrap: false showTime: false - currentContext: kubernetes-admin@kubernetes - currentCluster: kubernetes + currentContext: gke_memvp-25499_us-central1-c_ke-cluster-1 + currentCluster: gke_memvp-25499_us-central1-c_ke-cluster-1 clusters: - kubernetes: + gke_memvp-25499_us-central1-c_ke-cluster-1: namespace: active: all + lockFavorites: false favorites: + - backfill - all - default view: - active: pods + active: job featureGates: nodeShell: false shellPod: - image: busybox:1.31 + image: busybox:1.35.0 command: [] args: [] namespace: default limits: cpu: 100m memory: 100Mi + labels: {} portForwardAddress: localhost thresholds: cpu: diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 90b225a..e1bb878 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -55,7 +55,7 @@ local runtime_path = vim.split(package.path, ';') table.insert(runtime_path, "lua/?.lua") table.insert(runtime_path, "lua/?/init.lua") -require 'lspconfig'.sumneko_lua.setup { +require 'lspconfig'.lua_ls.setup { settings = { Lua = { runtime = { @@ -103,7 +103,7 @@ end nvim_lsp.efm.setup { init_options = { documentFormatting = true }, settings = { - rootMarkers = { ".git/" }, + rootMarkers = { ".git/", "package.json" }, languages = { lua = { { formatCommand = "lua-format -i", formatStdin = true } @@ -113,6 +113,9 @@ nvim_lsp.efm.setup { }, rust = { { formatCommand = 'rustfmt', formatStdin = true } + }, + typescript = { + { formatCommand = 'pnpm exec eslint --fix' } } } } diff --git a/.vimrc b/.vimrc index f8aec23..d34bebb 100644 --- a/.vimrc +++ b/.vimrc @@ -147,7 +147,7 @@ Plug 'honza/vim-snippets' Plug 'tpope/vim-abolish' "Plug 'sheerun/vim-polyglot' Plug 'Shougo/denite.nvim' -Plug 'plytophogy/vim-virtualenv' +"Plug 'plytophogy/vim-virtualenv' "Plug 'ervandew/supertab' "Plug 'ncm2/ncm2' "Plug 'roxma/nvim-yarp' @@ -299,8 +299,9 @@ autocmd CursorHold * lua vim.diagnostic.open_float({focusable = false}) autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_seq_sync(nil, 1000) autocmd BufWritePre *.py lua vim.lsp.buf.formatting_seq_sync(nil, 1000) autocmd BufWritePre *.rs lua vim.lsp.buf.formatting_seq_sync(nil, 1000) -autocmd BufWritePre *.go lua vim.lsp.buf.formatting_seq_sync(nil, 1000) +autocmd BufWritePre *.go lua vim.lsp.buf.format({ async = false }) autocmd BufWritePre *.go silent! lua org_imports(3000) +autocmd BufWritePre *.ts lua vim.lsp.buf.format({ async = false }) " Goto previous/next diagnostic warning/error nnoremap <silent> g[ <cmd>lua vim.diagnostic.goto_prev()<CR> From 140f471283191c84c1ba451b239eac3d583a2182 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Thu, 18 May 2023 15:27:15 -0700 Subject: [PATCH 034/126] desktop update --- .config/alacritty/alacritty.yml | 2 +- .gitconfig | 1 + .vim/autoload/plug.vim | 35 +++++++++++++++++--------- .vim/indent/gohtmltmpl.vim | 54 +++++++++++++++++++++++++++++++++++++++++ .vim/nvim.lua | 5 ++++ .vimrc | 6 +++-- 6 files changed, 88 insertions(+), 15 deletions(-) create mode 100644 .vim/indent/gohtmltmpl.vim diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index c3819db..8059159 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -171,7 +171,7 @@ font: # # Thin strokes are suitable for retina displays, but for non-retina screens # it is recommended to set `use_thin_strokes` to `false`. - use_thin_strokes: true + #use_thin_strokes: true # If `true`, bold text is drawn using the bright color variants. draw_bold_text_with_bright_colors: false diff --git a/.gitconfig b/.gitconfig index 3bfb3b1..cf7ec6b 100644 --- a/.gitconfig +++ b/.gitconfig @@ -20,6 +20,7 @@ hist = show-branch -a undo-last = reset HEAD^ unstage = restore --staged + latest = branch --sort=committerdate [diff] renamelimit = 0 diff --git a/.vim/autoload/plug.vim b/.vim/autoload/plug.vim index 6a958cb..9c3011f 100644 --- a/.vim/autoload/plug.vim +++ b/.vim/autoload/plug.vim @@ -22,7 +22,7 @@ " Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' " " " On-demand loading -" Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } +" Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' } " Plug 'tpope/vim-fireplace', { 'for': 'clojure' } " " " Using a non-default branch @@ -242,6 +242,8 @@ function! plug#begin(...) let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p')) elseif exists('g:plug_home') let home = s:path(g:plug_home) + elseif has('nvim') + let home = stdpath('data') . '/plugged' elseif !empty(&rtp) let home = s:path(split(&rtp, ',')[0]) . '/plugged' else @@ -350,7 +352,7 @@ function! plug#end() endif let lod = { 'ft': {}, 'map': {}, 'cmd': {} } - if exists('g:did_load_filetypes') + if get(g:, 'did_load_filetypes', 0) filetype off endif for name in g:plugs_order @@ -405,7 +407,7 @@ function! plug#end() for [map, names] in items(lod.map) for [mode, map_prefix, key_prefix] in - \ [['i', '<C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] + \ [['i', '<C-\><C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] execute printf( \ '%snoremap <silent> %s %s:<C-U>call <SID>lod_map(%s, %s, %s, "%s")<CR>', \ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix) @@ -1208,7 +1210,8 @@ function! s:update_impl(pull, force, args) abort normal! 2G silent! redraw - let s:clone_opt = [] + " Set remote name, overriding a possible user git config's clone.defaultRemoteName + let s:clone_opt = ['--origin', 'origin'] if get(g:, 'plug_shallow', 1) call extend(s:clone_opt, ['--depth', '1']) if s:git_version_requirement(1, 7, 10) @@ -2618,26 +2621,34 @@ function! s:preview_commit() let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7,9}') if empty(sha) - return + let name = matchstr(getline('.'), '^- \zs[^:]*\ze:$') + if empty(name) + return + endif + let title = 'HEAD@{1}..' + let command = 'git diff --no-color HEAD@{1}' + else + let title = sha + let command = 'git show --no-color --pretty=medium '.sha + let name = s:find_name(line('.')) endif - let name = s:find_name(line('.')) if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir) return endif if exists('g:plug_pwindow') && !s:is_preview_window_open() execute g:plug_pwindow - execute 'e' sha + execute 'e' title else - execute 'pedit' sha + execute 'pedit' title wincmd P endif - setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable + setlocal previewwindow filetype=git buftype=nofile bufhidden=wipe nobuflisted modifiable let batchfile = '' try let [sh, shellcmdflag, shrd] = s:chsh(1) - let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha + let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && '.command if s:is_win let [batchfile, cmd] = s:batchfile(cmd) endif @@ -2763,9 +2774,9 @@ function! s:snapshot(force, ...) abort 1 let anchor = line('$') - 3 let names = sort(keys(filter(copy(g:plugs), - \'has_key(v:val, "uri") && !has_key(v:val, "commit") && isdirectory(v:val.dir)'))) + \'has_key(v:val, "uri") && isdirectory(v:val.dir)'))) for name in reverse(names) - let sha = s:git_revision(g:plugs[name].dir) + let sha = has_key(g:plugs[name], 'commit') ? g:plugs[name].commit : s:git_revision(g:plugs[name].dir) if !empty(sha) call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha)) redraw diff --git a/.vim/indent/gohtmltmpl.vim b/.vim/indent/gohtmltmpl.vim new file mode 100644 index 0000000..8cc544a --- /dev/null +++ b/.vim/indent/gohtmltmpl.vim @@ -0,0 +1,54 @@ +if exists("b:did_indent") + finish +endif + +runtime! indent/html.vim + +" Indent Golang HTML templates +setlocal indentexpr=GetGoHTMLTmplIndent(v:lnum) +setlocal indentkeys+==else,=end + +" Only define the function once. +if exists("*GetGoHTMLTmplIndent") + finish +endif + +" don't spam the user when Vim is started in Vi compatibility mode +let s:cpo_save = &cpo +set cpo&vim + +function! GetGoHTMLTmplIndent(lnum) + " Get HTML indent + if exists('*HtmlIndent') + let ind = HtmlIndent() + else + let ind = HtmlIndentGet(a:lnum) + endif + + " The value of a single shift-width + if exists('*shiftwidth') + let sw = shiftwidth() + else + let sw = &sw + endif + + " If need to indent based on last line + let last_line = getline(a:lnum-1) + if last_line =~ '^\s*{{-\=\s*\%(if\|else\|range\|with\|define\|block\).*}}' + let ind += sw + endif + + " End of FuncMap block + let current_line = getline(a:lnum) + if current_line =~ '^\s*{{-\=\s*\%(else\|end\).*}}' + let ind -= sw + endif + + return ind +endfunction + +" restore Vi compatibility settings +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: sw=2 ts=2 et diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 90b225a..d67b707 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -355,18 +355,23 @@ require 'nvim-treesitter.configs'.setup { "c", "cpp", "css", + "dockerfile", "fish", "go", + "haskell", + "html", "javascript", "json", "lua", "make", "markdown", + "proto", "python", "query", "rust", "svelte", "typescript", + "toml", "vim", "yaml", }, diff --git a/.vimrc b/.vimrc index f8aec23..a38cc4b 100644 --- a/.vimrc +++ b/.vimrc @@ -172,6 +172,7 @@ Plug 'plytophogy/vim-virtualenv' Plug 'lunaru/vim-less' Plug 'hylang/vim-hy', {'for': 'hy'} Plug 'jneen/ragel.vim' +Plug 'NoahTheDuke/vim-just' "Plug 'mhartington/nvim-typescript' "Plug 'leafgarland/typescript-vim' Plug 'leafOfTree/vim-svelte-plugin' @@ -181,7 +182,7 @@ Plug 'Shougo/context_filetype.vim' Plug 'fedorenchik/AnsiEsc' Plug 'hwayne/tla.vim' Plug 'zchee/vim-goasm' -"Plug 'cappyzawa/starlark.vim' +Plug 'cappyzawa/starlark.vim' " Plugins that autocomplete "Plug 'Shougo/deoplete.nvim' @@ -1016,6 +1017,7 @@ nnoremap <silent> <C-k> <cmd>lua file_list{}<cr> nnoremap <silent> <Leader>ag <cmd>lua live_grep_repo{ word_match = "-w", only_sort_text = true, search = ''}<cr> nnoremap <silent> <Leader>aw <cmd>lua git_grep_word{ word_match = "-w", only_sort_text = true, initial_mode = "normal" }<cr> nnoremap <silent> <Leader>q <cmd>lua require('telescope.builtin').quickfix{ initial_mode = "normal" }<cr> +nnoremap <silent> <Leader>ff <cmd>lua require('telescope.builtin').quickfix{ initial_mode = "normal" }<cr> " For C++ -- A is a great plugin which allows you to jump from the c file to the " header and vice-versa. Mneumonic here is headerheader. @@ -1023,7 +1025,7 @@ nnoremap <Leader>hh :A<CR> " CommandT is useful, but if I'm juggling lots of buffers, limit it to another " one I have open (instead of standard <Leader>t). "nnoremap <silent> <Leader>o :<C-u>Buffers<CR> -nnoremap <silent> <Leader>o <cmd>lua buffer_telescope{initial_mode = "normal"}<cr> +nnoremap <silent> <Leader>o <cmd>lua buffer_telescope{}<cr> "nnoremap <Leader>j <C-^> "nnoremap <Leader>p :PTW nnoremap <Leader>p :LustyJugglePrevious<CR> From e94b86c137a51568819eea4e9c840f7818a3474f Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 23 May 2023 15:58:24 -0700 Subject: [PATCH 035/126] update nvim telescope config --- .config/fish/conf.d/virtualfish-loader.fish | 8 +-- .../share/applications/com.spotify.Client.desktop | 2 +- .tmux.conf | 8 ++- .vim/nvim.lua | 68 ++++++++-------------- .vimrc | 10 ++-- 5 files changed, 40 insertions(+), 56 deletions(-) diff --git a/.config/fish/conf.d/virtualfish-loader.fish b/.config/fish/conf.d/virtualfish-loader.fish index c0790b2..e306e12 100644 --- a/.config/fish/conf.d/virtualfish-loader.fish +++ b/.config/fish/conf.d/virtualfish-loader.fish @@ -1,4 +1,4 @@ -set -g VIRTUALFISH_VERSION 2.5.5 -set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python -source /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish -emit virtualfish_did_setup_plugins \ No newline at end of file +#set -g VIRTUALFISH_VERSION 2.5.5 +#set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python +#source /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish +emit virtualfish_did_setup_plugins diff --git a/.local/share/applications/com.spotify.Client.desktop b/.local/share/applications/com.spotify.Client.desktop index bd0a8d4..f2f9fc4 100755 --- a/.local/share/applications/com.spotify.Client.desktop +++ b/.local/share/applications/com.spotify.Client.desktop @@ -4,7 +4,7 @@ Name=Spotify GenericName=Online music streaming service Comment=Access all of your favorite music Icon=com.spotify.Client -Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client --force-device-scale-factor=1.3 @@u %U @@ +Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client --force-device-scale-factor=2 @@u %U @@ Terminal=false MimeType=x-scheme-handler/spotify; Categories=Audio;Music;AudioVideo; diff --git a/.tmux.conf b/.tmux.conf index be04e79..3c76fe2 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -15,6 +15,8 @@ bind -n M-j select-pane -D bind -n M-k select-pane -U bind -n M-h select-pane -L bind -n M-l select-pane -R +bind -n M-n next-window +bind -n M-p previous-window bind-key C-n next-window bind-key C-p previous-window set -g set-titles off @@ -32,11 +34,12 @@ bind -r K resize-pane -U 5 bind -r L resize-pane -R 5 # better mnemonics for splitting panes! -bind | split-window -h -bind - split-window -v +#bind | split-window -h +#bind - split-window -v bind v split-window -h bind = select-layout even-horizontal +bind | select-layout main-vertical bind-key C-t new-window "ttyd -R -d -t fontSize=18 tmux attach -t `tmux display -p '#S'`" # Status Bar @@ -47,6 +50,7 @@ set -g status-interval 1 #set -g status-right '#[fg=green]#(~/src/tpom/tpom) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]' set -g status-justify centre # center align window list set -g status-style fg=white,bg=default +set -g main-pane-width 68% # default window title colors set-window-option -g window-status-style fg=white,bg=default,dim diff --git a/.vim/nvim.lua b/.vim/nvim.lua index e1bb878..c1b73b3 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -324,6 +324,30 @@ require('telescope').setup { layout_config = { height = 15, }, + initial_mode = "normal", + }, + git_files = { + theme = "ivy", + }, + grep_string = { + theme = "ivy", + layout_config = { + height = 15, + }, + initial_mode = "normal", + }, + live_grep = { + theme = "ivy", + layout_config = { + height = 15, + }, + }, + buffers = { + theme = "ivy", + layout_config = { + height = 15, + }, + initial_mode = "normal", }, }, } @@ -427,50 +451,6 @@ require "neogen".setup {} require('leap').set_default_keymaps() require("flit").setup {} --- --- Helper functions for my own grepping commands. --- - -live_grep_repo = function(conf) - --local opt = dropdown - local opt = telescope_ivy - opt['cwd'] = vim.fn.systemlist("git rev-parse --show-toplevel")[1] - --local opt = { - --cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] - --} - for k, v in pairs(conf) do opt[k] = v end - builtin.live_grep(opt) -end - -git_grep_word = function(conf) - --local opt = dropdown - local opt = telescope_ivy - opt['cwd'] = vim.fn.systemlist("git rev-parse --show-toplevel")[1] - --local opt = { - --cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] - --} - for k, v in pairs(conf) do opt[k] = v end - builtin.grep_string(opt) -end - -buffer_telescope = function(conf) - local opt = telescope_ivy - for k, v in pairs(conf) do opt[k] = v end - builtin.buffers(opt) -end - -file_list = function(conf) - local opt = telescope_ivy - for k, v in pairs(conf) do opt[k] = v end - builtin.git_files(opt) -end - ---quickfix_telescope = function(conf) ---local opt = telescope_ivy ---for k, v in pairs(conf) do opt[k] = v end ---builtin.quickfix(opt) ---end - --- --- My own "where" clause generator for Rust diff --git a/.vimrc b/.vimrc index d34bebb..8448196 100644 --- a/.vimrc +++ b/.vimrc @@ -1013,10 +1013,10 @@ nnoremap <silent> <Leader>aa :<C-u>RgRoot!<CR> "nnoremap <silent> <Leader>aw :<C-u>RgRoot! <C-r><C-w><CR> "nnoremap <C-l> :<C-u>Files! `git rev-parse --show-toplevel`<CR> "nnoremap <C-k> :<C-u>GFiles<CR> -nnoremap <silent> <C-k> <cmd>lua file_list{}<cr> -nnoremap <silent> <Leader>ag <cmd>lua live_grep_repo{ word_match = "-w", only_sort_text = true, search = ''}<cr> -nnoremap <silent> <Leader>aw <cmd>lua git_grep_word{ word_match = "-w", only_sort_text = true, initial_mode = "normal" }<cr> -nnoremap <silent> <Leader>q <cmd>lua require('telescope.builtin').quickfix{ initial_mode = "normal" }<cr> +nnoremap <silent> <C-k> <cmd>lua require('telescope.builtin').git_files{}<cr> +nnoremap <silent> <Leader>ag <cmd>lua require('telescope.builtin').live_grep{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1], search = ''}<cr> +nnoremap <silent> <Leader>aw <cmd>lua require('telescope.builtin').grep_string{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1]}<cr> +nnoremap <silent> <Leader>q <cmd>lua require('telescope.builtin').quickfix{}<cr> " For C++ -- A is a great plugin which allows you to jump from the c file to the " header and vice-versa. Mneumonic here is headerheader. @@ -1024,7 +1024,7 @@ nnoremap <Leader>hh :A<CR> " CommandT is useful, but if I'm juggling lots of buffers, limit it to another " one I have open (instead of standard <Leader>t). "nnoremap <silent> <Leader>o :<C-u>Buffers<CR> -nnoremap <silent> <Leader>o <cmd>lua buffer_telescope{initial_mode = "normal"}<cr> +nnoremap <silent> <Leader>o <cmd>lua require('telescope.builtin').buffers{}<cr> "nnoremap <Leader>j <C-^> "nnoremap <Leader>p :PTW nnoremap <Leader>p :LustyJugglePrevious<CR> From 0a3fdd0682e80683bb4404f03577efd34045e355 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Thu, 25 May 2023 15:42:35 -0700 Subject: [PATCH 036/126] use TS exclusively for rust --- .vim/nvim.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index a25c8ab..e8dd274 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -19,7 +19,9 @@ rust_capabilities.textDocument.completion.completionItem.resolveSupport = { -- Enable rust_analyzer nvim_lsp.rust_analyzer.setup({ - on_attach = on_attach, + on_attach = function(client, bufnr) + client.server_capabilities.semanticTokensProvider = nil + end, capabilities = rust_capabilities, settings = { ['rust-analyzer'] = { From 9a2666798aef0889ae7790f86e2e188b443f63de Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 30 May 2023 09:19:13 -0700 Subject: [PATCH 037/126] highlights for go --- .vim/nvim.lua | 19 ++++++++++++++++++- .vimrc | 7 +++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index e8dd274..2ee4804 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -35,7 +35,24 @@ nvim_lsp.rust_analyzer.setup({ } } }) -nvim_lsp.gopls.setup({ on_attach = on_attach }) +nvim_lsp.gopls.setup({ + on_attach = function (client, bufnr) + client.server_capabilities.semanticTokensProvider = { + full = true, + legend = { + --tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', }, + tokenTypes = { 'namespace' }, + tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary', + }, + } + } + end, + settings = { + gopls = { + semanticTokens = true, + }, + }, +}) nvim_lsp.pyright.setup({ on_attach = on_attach }) nvim_lsp.clangd.setup({ on_attach = on_attach }) diff --git a/.vimrc b/.vimrc index b54aa61..bc496f4 100644 --- a/.vimrc +++ b/.vimrc @@ -1073,6 +1073,13 @@ endfunction map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR> +function! Syn() + for id in synstack(line("."), col(".")) + echo synIDattr(id, "name") + endfor +endfunction +map <F10> command! -nargs=0 Syn call Syn() + " Final hi links for TreeSitter hi link @type.rust TSCSecondaryTypeParam From 60d9c2182a83aeef9cc740de10399ac9a745bef9 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sun, 4 Jun 2023 18:22:56 -0700 Subject: [PATCH 038/126] fix auto-format --- .vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index bc496f4..cc5bc4e 100644 --- a/.vimrc +++ b/.vimrc @@ -297,9 +297,9 @@ set updatetime=500 autocmd CursorHold * lua vim.diagnostic.open_float({focusable = false}) " Autoformat on save -autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_seq_sync(nil, 1000) -autocmd BufWritePre *.py lua vim.lsp.buf.formatting_seq_sync(nil, 1000) -autocmd BufWritePre *.rs lua vim.lsp.buf.formatting_seq_sync(nil, 1000) +autocmd BufWritePre *.lua lua vim.lsp.buf.format({ async = false }) +autocmd BufWritePre *.py lua vim.lsp.buf.format({ async = false }) +autocmd BufWritePre *.rs lua vim.lsp.buf.format({ async = false }) autocmd BufWritePre *.go lua vim.lsp.buf.format({ async = false }) autocmd BufWritePre *.go silent! lua org_imports(3000) autocmd BufWritePre *.ts lua vim.lsp.buf.format({ async = false }) From 8b096b569ac62108620dbb4277df8269861f895a Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sun, 4 Jun 2023 18:23:10 -0700 Subject: [PATCH 039/126] make rofi bigger --- .local/share/rofi/themes/spotlight-dark.rasi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/share/rofi/themes/spotlight-dark.rasi b/.local/share/rofi/themes/spotlight-dark.rasi index 2e68c69..b61bc21 100644 --- a/.local/share/rofi/themes/spotlight-dark.rasi +++ b/.local/share/rofi/themes/spotlight-dark.rasi @@ -5,7 +5,7 @@ *******************************************************************************/ * { - font: "Montserrat 12"; + font: "Montserrat 18"; bg0: #242424E6; bg1: #7E7E7E80; @@ -18,7 +18,7 @@ background-color: transparent; text-color: @fg0; - margin: 0; + margin: 0.1em; padding: 0; spacing: 0; } @@ -33,7 +33,7 @@ window { } inputbar { - font: "Montserrat 20"; + font: "Montserrat 32"; padding: 12px; spacing: 12px; children: [ icon-search, entry ]; From 349040764740cfe226794a147692289efd3de98b Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 11 Jul 2023 14:34:19 -0700 Subject: [PATCH 040/126] add terraform TreeSitter and git LFS --- .gitconfig | 5 +++++ .vim/nvim.lua | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitconfig b/.gitconfig index cf7ec6b..4336734 100644 --- a/.gitconfig +++ b/.gitconfig @@ -52,3 +52,8 @@ ff = only [init] defaultBranch = main +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 2ee4804..91a1ea4 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -55,7 +55,7 @@ nvim_lsp.gopls.setup({ }) nvim_lsp.pyright.setup({ on_attach = on_attach }) -nvim_lsp.clangd.setup({ on_attach = on_attach }) +--nvim_lsp.clangd.setup({ on_attach = on_attach }) nvim_lsp.tsserver.setup { cmd = { "/home/barak/.yarn/bin/typescript-language-server", "--stdio" } } @@ -416,8 +416,9 @@ require 'nvim-treesitter.configs'.setup { "query", "rust", "svelte", - "typescript", + "terraform", "toml", + "typescript", "vim", "yaml", }, From aab3bef14aa6c7d6a57ff6d457ff41aed61353d1 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 9 Jan 2024 13:09:11 -0800 Subject: [PATCH 041/126] tmux & vim --- .tmux.conf | 5 +++-- .vim/nvim.lua | 45 +++++++++++++++++++++++++++++---------------- .vimrc | 12 ++++++++++-- 3 files changed, 42 insertions(+), 20 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 3c76fe2..4de1421 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -46,7 +46,6 @@ bind-key C-t new-window "ttyd -R -d -t fontSize=18 tmux attach -t `tmux display #set -g status-bg black set -g status-interval 1 #set -g status-left '#[fg=green]#H#[default]' -#set -g status-left-length 20 #set -g status-right '#[fg=green]#(~/src/tpom/tpom) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]' set -g status-justify centre # center align window list set -g status-style fg=white,bg=default @@ -61,8 +60,10 @@ set-window-option -g window-status-current-style fg=cyan,bg=default,bright set-window-option -g window-style fg=#aaaaaa,bg=terminal set-window-option -g window-active-style fg=terminal,bg=terminal -set -g status-left '#[fg=green][ #H ][ ' +set -g status-left '#[fg=green][ #h ][' +set -g status-left-length 40 set -g status-right '#[fg=green]][ #{pane_width}x#{pane_height} #[bright]#[fg=blue]%Y-%m-%d #[fg=white]%I:%M #[dim]#[fg=green]]' +set -g status-right-length 40 # Notifying if other windows has activities setw -g monitor-activity on diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 2ee4804..1ed2ca3 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -36,22 +36,23 @@ nvim_lsp.rust_analyzer.setup({ } }) nvim_lsp.gopls.setup({ - on_attach = function (client, bufnr) - client.server_capabilities.semanticTokensProvider = { - full = true, - legend = { - --tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', }, - tokenTypes = { 'namespace' }, - tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary', - }, - } - } - end, - settings = { - gopls = { - semanticTokens = true, - }, - }, + on_attach = function(client, bufnr) + client.server_capabilities.semanticTokensProvider = { + full = true, + legend = { + --tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', }, + tokenTypes = { 'namespace' }, + tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', + 'modification', 'documentation', 'defaultLibrary', + }, + } + } + end, + settings = { + gopls = { + semanticTokens = true, + }, + }, }) nvim_lsp.pyright.setup({ on_attach = on_attach }) @@ -475,6 +476,18 @@ require "neogen".setup {} require('leap').set_default_keymaps() require("flit").setup {} +require('snippy').setup({ + mappings = { + is = { + [',,'] = 'expand_or_advance', + [',.'] = 'previous', + }, + nx = { + ['<leader>x'] = 'cut_text', + }, + }, +}) + --- --- My own "where" clause generator for Rust diff --git a/.vimrc b/.vimrc index cc5bc4e..73062b5 100644 --- a/.vimrc +++ b/.vimrc @@ -141,7 +141,10 @@ Plug 'vim-airline/vim-airline-themes' Plug 'airblade/vim-rooter' "Plug 'bling/vim-bufferline' Plug 'majutsushi/tagbar' -Plug 'SirVer/ultisnips' +"Plug 'SirVer/ultisnips' +Plug 'dcampos/nvim-snippy' +Plug 'rafamadriz/friendly-snippets' + Plug 'honza/vim-snippets' "Plug 'fatih/vim-go' Plug 'tpope/vim-abolish' @@ -280,7 +283,7 @@ nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR> "nnoremap <silent> gd <cmd>lua vim.lsp.buf.declaration()<CR> nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR> "nnoremap <silent> ga <cmd>lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"})<cr> -vnoremap <silent> ga <cmd>lua vim.lsp.buf.range_code_action()<CR> +vnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR> "vnoremap <silent> ga :<C-U>lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"})<cr> "nnoremap <silent> ge <cmd>lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false})<CR> "nnoremap <silent> ge <cmd>lua vim.diagnostic.open_float({focusable = false})<CR> @@ -1083,3 +1086,8 @@ map <F10> command! -nargs=0 Syn call Syn() " Final hi links for TreeSitter hi link @type.rust TSCSecondaryTypeParam + +let s:gptool_temp = expand($HOME . '/src/gptool/bindings.vim') +if filereadable(s:gptool_temp) + exec ':so ' . s:gptool_temp +endif From 4eca2ee06aec6ae4b5ba8b960312c49bcbe8bf2b Mon Sep 17 00:00:00 2001 From: Barak Michener <barakmich@openai.com> Date: Tue, 9 Jan 2024 13:20:23 -0800 Subject: [PATCH 042/126] right prompt to nil, ignore work configs --- .config/fish/.gitignore | 1 + .config/fish/config.fish | 4 ++++ .config/fish/functions/fish_right_prompt.fish | 1 + 3 files changed, 6 insertions(+) create mode 100644 .config/fish/.gitignore create mode 100644 .config/fish/functions/fish_right_prompt.fish diff --git a/.config/fish/.gitignore b/.config/fish/.gitignore new file mode 100644 index 0000000..44e4e55 --- /dev/null +++ b/.config/fish/.gitignore @@ -0,0 +1 @@ +work.fish diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 8160044..0fababc 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -16,6 +16,10 @@ if test -e $HOME/.asdf/asdf.fish . ~/.asdf/asdf.fish end +if test -e $HOME/.config/fish/work.fish + . ~/.config/fish/work.fish +end + . ~/.config/fish/fish_aliases.fish # The next line updates PATH for the Google Cloud SDK. diff --git a/.config/fish/functions/fish_right_prompt.fish b/.config/fish/functions/fish_right_prompt.fish new file mode 100644 index 0000000..25b3eab --- /dev/null +++ b/.config/fish/functions/fish_right_prompt.fish @@ -0,0 +1 @@ +function fish_right_prompt; end From 2e878811950c1cc55db04f495509bcf4737f18e1 Mon Sep 17 00:00:00 2001 From: Barak Michener <barakmich@openai.com> Date: Tue, 9 Jan 2024 13:24:18 -0800 Subject: [PATCH 043/126] python/efm config that's better --- .vim/filetype.vim | 3 + .vim/nvim.lua | 165 +++++++++++++++++++++++++++++++++++++++++++++--------- .vimrc | 11 ++-- 3 files changed, 148 insertions(+), 31 deletions(-) diff --git a/.vim/filetype.vim b/.vim/filetype.vim index 09676a1..20dba9f 100644 --- a/.vim/filetype.vim +++ b/.vim/filetype.vim @@ -99,6 +99,9 @@ augroup go autocmd FileType go set softtabstop=2 autocmd FileType go set shiftwidth=2 autocmd FileType go set noexpandtab + autocmd FileType go imap <buffer> <silent> <Leader>rr <C-o>:GoIfErr<cr> + autocmd FileType go nmap <buffer> <silent> <Leader>rr :GoIfErr<cr> + autocmd FileType go nnoremap <silent> <Leader>im <cmd>lua require('telescope').extensions.goimpl.goimpl{theme = "ivy", layout_config = {height = 10}}<cr> "autocmd FileType go nmap <Leader>gd <Plug>(go-doc) "autocmd FileType go nmap gd <Plug>(go-def) augroup END diff --git a/.vim/nvim.lua b/.vim/nvim.lua index d441658..e6837a2 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -7,6 +7,13 @@ local nvim_lsp = require 'lspconfig' local on_attach = function(client) end +-- Set my preferred diagnostic options +local diagnostic_options = { + virtual_text = false, + signs = true, + update_in_insert = false, +} + local rust_capabilities = vim.lsp.protocol.make_client_capabilities() rust_capabilities.textDocument.completion.completionItem.snippetSupport = true rust_capabilities.textDocument.completion.completionItem.resolveSupport = { @@ -17,6 +24,16 @@ rust_capabilities.textDocument.completion.completionItem.resolveSupport = { } } +local default_capabilities = vim.lsp.protocol.make_client_capabilities() +default_capabilities.textDocument.completion.completionItem.snippetSupport = true +default_capabilities.textDocument.completion.completionItem.resolveSupport = { + properties = { + 'documentation', + 'detail', + 'additionalTextEdits', + } +} + -- Enable rust_analyzer nvim_lsp.rust_analyzer.setup({ on_attach = function(client, bufnr) @@ -54,7 +71,80 @@ nvim_lsp.gopls.setup({ }, }, }) -nvim_lsp.pyright.setup({ on_attach = on_attach }) + +local function filter(arr, func) + -- Filter in place + -- https://stackoverflow.com/questions/49709998/how-to-filter-a-lua-array-inplace + local new_index = 1 + local size_orig = #arr + for old_index, v in ipairs(arr) do + if func(v, old_index) then + arr[new_index] = v + new_index = new_index + 1 + end + end + for i = new_index, size_orig do arr[i] = nil end +end + +local function pyright_accessed_filter(diagnostic) + -- Allow kwargs to be unused, sometimes you want many functions to take the + -- same arguments but you don't use all the arguments in all the functions, + -- so kwargs is used to suck up all the extras + if diagnostic.message == '"kwargs" is not accessed' then + return false + end + -- Allow variables starting with an underscore + if string.match(diagnostic.message, '"_.+" is not accessed') then + return false + end + + return true +end + +local function pyright_custom_diagnostic(a, params, client_id, c, config) + filter(params.diagnostics, pyright_accessed_filter) + vim.lsp.diagnostic.on_publish_diagnostics(a, params, client_id, c, config) +end + +nvim_lsp.pyright.setup({ on_attach = function(client, bufnr) + vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(pyright_custom_diagnostic, diagnostic_options) +end}) +--nvim_lsp.pyright.setup({ on_attach = on_attach }) +--nvim_lsp.pylsp.setup({ + --on_attach = on_attach, + --settings = { + --pylsp = { + --plugins = { + ---- formatter options + ----black = { enabled = true }, + --autopep8 = { enabled = false }, + --yapf = { enabled = false }, + ---- linter options + --pylint = { enabled = false, executable = "pylint" }, + --pyflakes = { enabled = false }, + --pycodestyle = { enabled = false }, + ---- type checker + --pylsp_mypy = { enabled = true }, + ---- auto-completion options + --jedi_completion = { enabled = false }, + ---- import sorting + ----pyls_isort = { enabled = true }, + ----flake8 = { + ----maxLineLength = 100, + ----}, + --pycodestyle = { + --maxLineLength = 100, + --}, + ----rope_autoimport = { + ----enabled = true + ----}, + ----rope_completion = { + ----enabled = true + ----}, + --} + --} + --} +--}) --nvim_lsp.clangd.setup({ on_attach = on_attach }) nvim_lsp.tsserver.setup { @@ -100,7 +190,12 @@ require 'lspconfig'.lua_ls.setup { }, } -require('go').setup() + +require('go').setup({ + iferr_vertical_shift = 2 +}) + +require('telescope').load_extension('goimpl') function org_imports(wait_ms) local params = vim.lsp.util.make_range_params() @@ -120,35 +215,42 @@ function org_imports(wait_ms) end end -nvim_lsp.efm.setup { - init_options = { documentFormatting = true }, - settings = { - rootMarkers = { ".git/", "package.json" }, - languages = { - lua = { - { formatCommand = "lua-format -i", formatStdin = true } - }, - python = { - { formatCommand = 'black --quiet -', formatStdin = true } - }, - rust = { - { formatCommand = 'rustfmt', formatStdin = true } - }, - typescript = { - { formatCommand = 'pnpm exec eslint --fix' } - } - } - } +-- register linters +local luaformat = require("efmls-configs.formatters.lua_format") +local rustfmt = require('efmls-configs.formatters.rustfmt') +local black = require('efmls-configs.formatters.black') +local mypy = require('efmls-configs.linters.mypy') +local eslint = require('efmls-configs.linters.eslint') +local isort = require('efmls-configs.formatters.isort') +local languages = { + typescript = { eslint }, + lua = { luaformat }, + python = { black, mypy, isort }, + rust = { rustfmt }, } +local efmls_config = { + filetypes = vim.tbl_keys(languages), + settings = { + rootMarkers = { '.git/' }, + languages = languages, + }, + init_options = { + documentFormatting = true, + documentRangeFormatting = true, + }, +} + +require('lspconfig').efm.setup(vim.tbl_extend('force', efmls_config, { + -- Pass your custom lsp config below like on_attach and capabilities + on_attach = on_attach, + capabilities = default_capabilities, +})) + -- Enable diagnostics vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - signs = true, - update_in_insert = false, -} -) + vim.lsp.diagnostic.on_publish_diagnostics, + diagnostic_options) -- Compe setup require 'compe'.setup { @@ -321,6 +423,12 @@ require('telescope').setup { }, }, pickers = { + goimpl = { + theme = "ivy", + layout_config = { + height = 10, + }, + }, lsp_code_actions = { theme = "ivy", layout_config = { @@ -367,6 +475,7 @@ require('telescope').setup { layout_config = { height = 15, }, + ignore_current_buffer = true, initial_mode = "normal", }, }, @@ -571,3 +680,5 @@ function neogen_dwim() end end end + +require("murdock") diff --git a/.vimrc b/.vimrc index 73062b5..5e61d1e 100644 --- a/.vimrc +++ b/.vimrc @@ -222,7 +222,9 @@ Plug 'ray-x/go.nvim' Plug 'RishabhRD/popfix' Plug 'RishabhRD/nvim-lsputils' +Plug 'stevanmilic/nvim-lspimport' Plug 'folke/trouble.nvim' +Plug 'creativenull/efmls-configs-nvim', { 'tag': 'v1.*' } " Plugins that do specific things "Plug 'Shougo/vimproc.vim' @@ -254,6 +256,7 @@ Plug 'danymat/neogen' " Unclear "Plug 'ncm2/float-preview.nvim' Plug 'lambdalisue/gina.vim' +Plug 'edolphin-ydf/goimpl.nvim' call plug#end() @@ -292,6 +295,8 @@ nnoremap <silent> <leader>xx <cmd>TroubleToggle<cr> nnoremap <silent> <leader>xq <cmd>lua vim.diagnostic.setqflist()<CR> "nnoremap <silent> <leader>nc <cmd>lua neogen_dwim()<CR> nnoremap <silent> <leader>nc <cmd>lua require('neogen').generate({ type = 'any' })<CR> +nnoremap <silent> gm <cmd>lua require('lspimport').import()<CR> + " Set updatetime for CursorHold " 300ms of no cursor movement to trigger CursorHold @@ -1029,7 +1034,8 @@ nnoremap <Leader>hh :A<CR> " CommandT is useful, but if I'm juggling lots of buffers, limit it to another " one I have open (instead of standard <Leader>t). "nnoremap <silent> <Leader>o :<C-u>Buffers<CR> -nnoremap <silent> <Leader>o <cmd>lua require('telescope.builtin').buffers{}<cr> +nnoremap <silent> <Leader>o <cmd>lua require('telescope.builtin').buffers{initial_mode = "insert"}<cr> +nnoremap <silent> <C-j> <cmd>lua require('telescope.builtin').buffers{prompt_prefix = " "}<cr> "nnoremap <Leader>j <C-^> "nnoremap <Leader>p :PTW nnoremap <Leader>p :LustyJugglePrevious<CR> @@ -1046,9 +1052,6 @@ endif " ** SEE ALSO ** " filetype.vim -command Comments lexpr system($HOME . '/src/gogh/src/github.com/barakmich/gogh/gogh') - - "call remote#host#RegisterPlugin('python3', '/home/barak/.vim/bundle/deoplete.nvim/rplugin/python3/deoplete', [ "\ {'sync': v:true, 'name': '_deoplete', 'type': 'function', 'opts': {}}, "\ ]) From fc663940ff92b2c8c13b828bd479b855a57c27be Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 9 Jan 2024 13:32:30 -0800 Subject: [PATCH 044/126] [nvim] filetype-lua update and nvim.lua cleanup --- .vim/filetype.vim | 1 + .vim/nvim.lua | 147 ++++++++++++++++++++++++------------------------------ 2 files changed, 66 insertions(+), 82 deletions(-) diff --git a/.vim/filetype.vim b/.vim/filetype.vim index 20dba9f..48fb035 100644 --- a/.vim/filetype.vim +++ b/.vim/filetype.vim @@ -124,6 +124,7 @@ autocmd FileType proto let b:auto_trim_whitespace=1 autocmd FileType hy let b:auto_trim_whitespace=1 autocmd FileType idris let b:auto_trim_whitespace=1 autocmd FileType java let b:auto_trim_whitespace=1 +autocmd FileType lua let b:auto_trim_whitespace=1 augroup templates autocmd BufNewFile *.vue 0r ~/.vim/skeletons/vue.skel diff --git a/.vim/nvim.lua b/.vim/nvim.lua index e6837a2..5c69511 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -73,77 +73,77 @@ nvim_lsp.gopls.setup({ }) local function filter(arr, func) - -- Filter in place - -- https://stackoverflow.com/questions/49709998/how-to-filter-a-lua-array-inplace - local new_index = 1 - local size_orig = #arr - for old_index, v in ipairs(arr) do - if func(v, old_index) then - arr[new_index] = v - new_index = new_index + 1 - end + -- Filter in place + -- https://stackoverflow.com/questions/49709998/how-to-filter-a-lua-array-inplace + local new_index = 1 + local size_orig = #arr + for old_index, v in ipairs(arr) do + if func(v, old_index) then + arr[new_index] = v + new_index = new_index + 1 end - for i = new_index, size_orig do arr[i] = nil end + end + for i = new_index, size_orig do arr[i] = nil end end local function pyright_accessed_filter(diagnostic) - -- Allow kwargs to be unused, sometimes you want many functions to take the - -- same arguments but you don't use all the arguments in all the functions, - -- so kwargs is used to suck up all the extras - if diagnostic.message == '"kwargs" is not accessed' then - return false - end - -- Allow variables starting with an underscore - if string.match(diagnostic.message, '"_.+" is not accessed') then - return false - end + -- Allow kwargs to be unused, sometimes you want many functions to take the + -- same arguments but you don't use all the arguments in all the functions, + -- so kwargs is used to suck up all the extras + if diagnostic.message == '"kwargs" is not accessed' then + return false + end + -- Allow variables starting with an underscore + if string.match(diagnostic.message, '"_.+" is not accessed') then + return false + end - return true + return true end local function pyright_custom_diagnostic(a, params, client_id, c, config) - filter(params.diagnostics, pyright_accessed_filter) - vim.lsp.diagnostic.on_publish_diagnostics(a, params, client_id, c, config) + filter(params.diagnostics, pyright_accessed_filter) + vim.lsp.diagnostic.on_publish_diagnostics(a, params, client_id, c, config) end nvim_lsp.pyright.setup({ on_attach = function(client, bufnr) - vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(pyright_custom_diagnostic, diagnostic_options) -end}) + vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(pyright_custom_diagnostic, diagnostic_options) +end }) --nvim_lsp.pyright.setup({ on_attach = on_attach }) ---nvim_lsp.pylsp.setup({ - --on_attach = on_attach, - --settings = { - --pylsp = { - --plugins = { - ---- formatter options - ----black = { enabled = true }, - --autopep8 = { enabled = false }, - --yapf = { enabled = false }, - ---- linter options - --pylint = { enabled = false, executable = "pylint" }, - --pyflakes = { enabled = false }, - --pycodestyle = { enabled = false }, - ---- type checker - --pylsp_mypy = { enabled = true }, - ---- auto-completion options - --jedi_completion = { enabled = false }, - ---- import sorting - ----pyls_isort = { enabled = true }, - ----flake8 = { - ----maxLineLength = 100, - ----}, - --pycodestyle = { - --maxLineLength = 100, - --}, - ----rope_autoimport = { - ----enabled = true - ----}, - ----rope_completion = { - ----enabled = true - ----}, - --} - --} - --} +--nvim_lsp.pylsp.setup({ +--on_attach = on_attach, +--settings = { +--pylsp = { +--plugins = { +---- formatter options +----black = { enabled = true }, +--autopep8 = { enabled = false }, +--yapf = { enabled = false }, +---- linter options +--pylint = { enabled = false, executable = "pylint" }, +--pyflakes = { enabled = false }, +--pycodestyle = { enabled = false }, +---- type checker +--pylsp_mypy = { enabled = true }, +---- auto-completion options +--jedi_completion = { enabled = false }, +---- import sorting +----pyls_isort = { enabled = true }, +----flake8 = { +----maxLineLength = 100, +----}, +--pycodestyle = { +--maxLineLength = 100, +--}, +----rope_autoimport = { +----enabled = true +----}, +----rope_completion = { +----enabled = true +----}, +--} +--} +--} --}) --nvim_lsp.clangd.setup({ on_attach = on_attach }) @@ -249,8 +249,9 @@ require('lspconfig').efm.setup(vim.tbl_extend('force', efmls_config, { -- Enable diagnostics vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, - diagnostic_options) + vim.lsp.diagnostic.on_publish_diagnostics, + diagnostic_options +) -- Compe setup require 'compe'.setup { @@ -283,7 +284,7 @@ require 'compe'.setup { --require'lsp_signature'.on_attach(signature_cfg) -saga_cfg = { +local saga_cfg = { code_action_prompt = { enable = false, sign = false, @@ -317,6 +318,7 @@ _G.tab_complete = function() return vim.fn['compe#complete']() end end + _G.s_tab_complete = function() if vim.fn.pumvisible() == 1 then return t "<C-p>" @@ -482,25 +484,6 @@ require('telescope').setup { } -local dropdown = require 'telescope.themes'.get_dropdown({ - --previewer = false, - --prompt_title = "", - --results_height = 16, - --width = 0.6, - --borderchars = { - --{"─", "│", "─", "│", "╭", "╮", "╯", "╰"}, - --prompt = {"─", "│", " ", "│", "╭", "╮", "│", "│"}, - --results = {"─", "│", "─", "│", "├", "┤", "╯", "╰"}, - --preview = {"─", "│", "─", "│", "╭", "╮", "╯", "╰"} - --}, - --winblend = 10 -}) - -local telescope_ivy = require 'telescope.themes'.get_ivy({ - -}) - - -- -- Treesitter -- @@ -607,7 +590,7 @@ function string.insert(str1, str2, pos) end function string.split(s, delimiter) - result = {}; + local result = {}; for match in (s .. delimiter):gmatch("(.-)" .. delimiter) do table.insert(result, match); end From 61df077539c0dc6d3d674421fac4e44e23b3ed19 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 9 Jan 2024 13:34:15 -0800 Subject: [PATCH 045/126] [misc] cargo in bash, smaller spotify on 4k --- .bash_profile | 1 + .bashrc | 1 + .config/fish/conf.d/virtualfish-loader.fish | 8 ++++---- .local/share/applications/com.spotify.Client.desktop | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.bash_profile b/.bash_profile index 9aee501..6df125f 100644 --- a/.bash_profile +++ b/.bash_profile @@ -20,3 +20,4 @@ fi # Added by ~/.emacs.d/install.sh export PATH=$HOME/.cask/bin:$PATH +. "$HOME/.cargo/env" diff --git a/.bashrc b/.bashrc index f714772..57a4468 100644 --- a/.bashrc +++ b/.bashrc @@ -161,3 +161,4 @@ fi if [ -f ~/local/google-cloud-sdk/completion.bash.inc ]; then . ~/local/google-cloud-sdk/completion.bash.inc fi +. "$HOME/.cargo/env" diff --git a/.config/fish/conf.d/virtualfish-loader.fish b/.config/fish/conf.d/virtualfish-loader.fish index e306e12..88cbd8e 100644 --- a/.config/fish/conf.d/virtualfish-loader.fish +++ b/.config/fish/conf.d/virtualfish-loader.fish @@ -1,4 +1,4 @@ -#set -g VIRTUALFISH_VERSION 2.5.5 -#set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python -#source /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish -emit virtualfish_did_setup_plugins +set -g VIRTUALFISH_VERSION 2.5.5 +set -g VIRTUALFISH_PYTHON_EXEC /bin/python +source /home/barak/.local/lib/python3.11/site-packages/virtualfish/virtual.fish +emit virtualfish_did_setup_plugins \ No newline at end of file diff --git a/.local/share/applications/com.spotify.Client.desktop b/.local/share/applications/com.spotify.Client.desktop index f2f9fc4..1240b5d 100755 --- a/.local/share/applications/com.spotify.Client.desktop +++ b/.local/share/applications/com.spotify.Client.desktop @@ -4,7 +4,7 @@ Name=Spotify GenericName=Online music streaming service Comment=Access all of your favorite music Icon=com.spotify.Client -Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client --force-device-scale-factor=2 @@u %U @@ +Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client --force-device-scale-factor=1.5 @@u %U @@ Terminal=false MimeType=x-scheme-handler/spotify; Categories=Audio;Music;AudioVideo; From b9b5ebe8079f5532fc38858812cd6e6be79bfab1 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 16 Jan 2024 15:41:36 -0800 Subject: [PATCH 046/126] [vim] iferr `,ife` and better previews when searching files --- .vim/filetype.vim | 4 ++-- .vim/nvim.lua | 2 ++ .vimrc | 11 +++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.vim/filetype.vim b/.vim/filetype.vim index 48fb035..f65b25b 100644 --- a/.vim/filetype.vim +++ b/.vim/filetype.vim @@ -99,8 +99,8 @@ augroup go autocmd FileType go set softtabstop=2 autocmd FileType go set shiftwidth=2 autocmd FileType go set noexpandtab - autocmd FileType go imap <buffer> <silent> <Leader>rr <C-o>:GoIfErr<cr> - autocmd FileType go nmap <buffer> <silent> <Leader>rr :GoIfErr<cr> + autocmd FileType go imap <buffer> <silent> <Leader>ife <C-o>:GoIfErr<cr> + autocmd FileType go nmap <buffer> <silent> <Leader>ife :GoIfErr<cr> autocmd FileType go nnoremap <silent> <Leader>im <cmd>lua require('telescope').extensions.goimpl.goimpl{theme = "ivy", layout_config = {height = 10}}<cr> "autocmd FileType go nmap <Leader>gd <Plug>(go-doc) "autocmd FileType go nmap gd <Plug>(go-def) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 5c69511..a8aa9ee 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -423,6 +423,8 @@ require('telescope').setup { ["ff"] = require('telescope.actions').send_to_qflist, }, }, + path_display = { "smart", "shorten" }, + dynamic_preview_title = true, }, pickers = { goimpl = { diff --git a/.vimrc b/.vimrc index 5e61d1e..011b093 100644 --- a/.vimrc +++ b/.vimrc @@ -83,6 +83,17 @@ if exists('veonim') set guifont=Droid\ Sans\ Mono\ Dotted:h20 " set linespace=10 endif + +if exists('g:neovide') + let g:neovide_floating_blur_amount_x = 2.0 + let g:neovide_floating_blur_amount_y = 2.0 + let g:neovide_transparency = 0.95 + let g:neovide_scroll_animation_length = 0.1 + let g:neovide_cursor_animation_length = 0.05 + let g:neovide_cursor_trail_size = 0.5 +endif + + " * Polyglot let g:tex_flavor = 'latex' From 133cc4d31cb5509386b26b7070941aaeed319a78 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 7 Feb 2024 16:55:41 -0800 Subject: [PATCH 047/126] alacritty.toml and vi reports better --- .config/alacritty/alacritty.toml | 122 +++++++++++++++++++++++++++++++++++++++ .config/fish/config.fish | 2 +- bin/vi | 4 +- 3 files changed, 125 insertions(+), 3 deletions(-) create mode 100644 .config/alacritty/alacritty.toml diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..a4a90f7 --- /dev/null +++ b/.config/alacritty/alacritty.toml @@ -0,0 +1,122 @@ +[bell] +color = "#ffffff" +duration = 200 + +[colors] +draw_bold_text_with_bright_colors = false + +[colors.bright] +black = "#565656" +blue = "#49a4f8" +cyan = "#99faf2" +green = "#c0e17d" +magenta = "#a47de9" +red = "#ec5357" +white = "#ffffff" +yellow = "#f9da6a" + +[colors.normal] +black = "#2e2e2e" +blue = "#47a0f3" +cyan = "#64dbed" +green = "#abe047" +magenta = "#7b5cb0" +red = "#eb4129" +white = "#e5e9f0" +yellow = "#f6c744" + +[colors.primary] +background = "#000000" +foreground = "#fffbf6" + +[env] +TERM = "xterm-256color" + +[font] +size = 20.0 + +[font.bold] +style = "Regular" + +[font.bold_italic] +style = "Oblique" + +[font.italic] +style = "Light Oblique" + +[font.normal] +family = "Iosevka Berkeley" +style = "Light" + +[hints] +alphabet = "jfkdls;ahgurieowpq" + +[[hints.enabled]] +action = "Copy" +regex = "[a-f0-9]{7,}" + +[hints.enabled.binding] +key = "H" +mods = "Control|Shift" + +[[hints.enabled]] +action = "Copy" +regex = "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" + +[hints.enabled.binding] +key = "U" +mods = "Control|Shift" + +[[hints.enabled]] +command = "xdg-open" +post_processing = true +regex = "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" + +[hints.enabled.binding] +key = "L" +mods = "Control|Shift" + +[hints.enabled.mouse] +enabled = true +mods = "None" + +[[keyboard.bindings]] +action = "ToggleViMode" +key = "Q" +mode = "Vi|~Search" + +[[keyboard.bindings]] +action = "Paste" +key = "P" +mode = "Vi|~Search" + +[[keyboard.bindings]] +action = "ToggleFullscreen" +key = "Return" +mods = "Alt" + +[[keyboard.bindings]] +action = "ToggleFullscreen" +key = "Return" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u001B." +key = "Period" +mods = "Command" + +[scrolling] +history = 10000 +multiplier = 3 + +[window] +opacity = 0.88 +startup_mode = "Windowed" + +[window.dimensions] +columns = 106 +lines = 24 + +[window.padding] +x = 3 +y = 3 diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 0fababc..85928c5 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,4 +1,4 @@ -set PATH ~/bin ~/.local/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin ~/.ghcup/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin $PATH +set PATH ~/bin ~/.local/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin ~/.ghcup/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin ~/.rye/shims $PATH if command -vq flatpak set -ga fish_user_paths ~/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bin diff --git a/bin/vi b/bin/vi index faeface..fe58154 100755 --- a/bin/vi +++ b/bin/vi @@ -2,7 +2,7 @@ export TERM=xterm-256color if [ -n "`which nvim`" ]; then - nvim "$@" + exec -a nvim nvim "$@" else - vim "$@" + exec -a vim vim "$@" fi From 4273b7612e11d1e1de4ac66a92f49d58736c84aa Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sun, 11 Feb 2024 16:14:35 -0800 Subject: [PATCH 048/126] vim indenting and code range --- .vim/nvim.lua | 93 ++++++++++++++++++++++++++++++----------------------------- .vimrc | 12 ++++++-- 2 files changed, 56 insertions(+), 49 deletions(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 91a1ea4..394074f 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -36,22 +36,23 @@ nvim_lsp.rust_analyzer.setup({ } }) nvim_lsp.gopls.setup({ - on_attach = function (client, bufnr) - client.server_capabilities.semanticTokensProvider = { - full = true, - legend = { - --tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', }, - tokenTypes = { 'namespace' }, - tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary', - }, - } - } - end, - settings = { - gopls = { - semanticTokens = true, - }, - }, + on_attach = function(client, bufnr) + client.server_capabilities.semanticTokensProvider = { + full = true, + legend = { + --tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', }, + tokenTypes = { 'namespace' }, + tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', + 'modification', 'documentation', 'defaultLibrary', + }, + } + } + end, + settings = { + gopls = { + semanticTokens = true, + }, + }, }) nvim_lsp.pyright.setup({ on_attach = on_attach }) @@ -67,7 +68,7 @@ nvim_lsp.hls.setup { } nvim_lsp.svelte.setup { - cmd = { "/home/barak/.yarn/bin/svelteserver", "--stdio" } + cmd = { "/home/barak/.bun/bin/bunx", "svelteserver", "--stdio" } } local runtime_path = vim.split(package.path, ';') @@ -143,31 +144,31 @@ nvim_lsp.efm.setup { -- Enable diagnostics vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - signs = true, - update_in_insert = false, -} + virtual_text = false, + signs = true, + update_in_insert = false, + } ) -- Compe setup require 'compe'.setup { - enabled = true; - autocomplete = true; - debug = false; - min_length = 1; - preselect = 'disable'; - throttle_time = 80; - source_timeout = 200; - incomplete_delay = 400; - max_abbr_width = 100; - max_kind_width = 100; - max_menu_width = 100; - documentation = true; + enabled = true, + autocomplete = true, + debug = false, + min_length = 1, + preselect = 'disable', + throttle_time = 80, + source_timeout = 200, + incomplete_delay = 400, + max_abbr_width = 100, + max_kind_width = 100, + max_menu_width = 100, + documentation = true, source = { - path = true; - nvim_lsp = true; - }; + path = true, + nvim_lsp = true, + }, } --signature_cfg = { @@ -282,17 +283,17 @@ require('trouble').setup { jump = { "o", "<tab>" }, -- jump to the diagnostic or open / close folds --open_split = { "<c-x>" }, -- open buffer in new split --open_vsplit = { "<c-v>" }, -- open buffer in new vsplit - open_tab = {}, -- open buffer in new tab - jump_close = { "<cr>" }, -- jump to the diagnostic and close the list - toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode - toggle_preview = "P", -- toggle auto_preview - hover = "K", -- opens a small popup with the full multiline message - preview = "p", -- preview the diagnostic location + open_tab = {}, -- open buffer in new tab + jump_close = { "<cr>" }, -- jump to the diagnostic and close the list + toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode + toggle_preview = "P", -- toggle auto_preview + hover = "K", -- opens a small popup with the full multiline message + preview = "p", -- preview the diagnostic location close_folds = { "zM", "zm" }, -- close all folds - open_folds = { "zR", "zr" }, -- open all folds + open_folds = { "zR", "zr" }, -- open all folds toggle_fold = { "zA", "za" }, -- toggle fold of current file - previous = "k", -- previous item - next = "j" -- next item + previous = "k", -- previous item + next = "j" -- next item }, } @@ -454,7 +455,7 @@ require 'nvim-treesitter.configs'.setup { playground = { enable = true, disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code persist_queries = false, -- Whether the query persists across vim sessions keybindings = { toggle_query_editor = 'o', diff --git a/.vimrc b/.vimrc index cc5bc4e..4b40af4 100644 --- a/.vimrc +++ b/.vimrc @@ -113,7 +113,6 @@ Plug 'chrisbra/NrrwRgn' "Plug 'tpope/vim-fireplace', {'for': 'clojure'} ""Plug 'terryma/vim-multiple-cursors' "Plug 'ambv/black' -Plug 'kana/vim-textobj-user' " Plugins I wish I used more @@ -126,7 +125,6 @@ Plug 'tpope/vim-unimpaired' Plug 'b4winckler/vim-angry' Plug 'tpope/vim-surround' Plug 'junegunn/vim-easy-align' -Plug 'bps/vim-textobj-python' " Plugins I NEED Plug 'scrooloose/nerdcommenter' @@ -230,6 +228,8 @@ Plug 'kristijanhusak/defx-icons' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-treesitter/playground' +Plug 'nvim-treesitter/nvim-treesitter-textobjects' + "Plug 'ggandor/lightspeed.nvim' "Plug 'justinmk/vim-sneak' @@ -280,7 +280,7 @@ nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR> "nnoremap <silent> gd <cmd>lua vim.lsp.buf.declaration()<CR> nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR> "nnoremap <silent> ga <cmd>lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"})<cr> -vnoremap <silent> ga <cmd>lua vim.lsp.buf.range_code_action()<CR> +vnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR> "vnoremap <silent> ga :<C-U>lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"})<cr> "nnoremap <silent> ge <cmd>lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false})<CR> "nnoremap <silent> ge <cmd>lua vim.diagnostic.open_float({focusable = false})<CR> @@ -1083,3 +1083,9 @@ map <F10> command! -nargs=0 Syn call Syn() " Final hi links for TreeSitter hi link @type.rust TSCSecondaryTypeParam + +let s:gptool_temp = expand($HOME . '/src/gptool/bindings.vim') +if filereadable(s:gptool_temp) + exec ':so ' . s:gptool_temp +endif + From bf1dbe95e9fc78e1a053317678d9206344011a58 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Mon, 12 Feb 2024 13:44:17 -0800 Subject: [PATCH 049/126] delete the virtualfish loader (moving to rye for my own stuff) --- .config/fish/conf.d/virtualfish-loader.fish | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .config/fish/conf.d/virtualfish-loader.fish diff --git a/.config/fish/conf.d/virtualfish-loader.fish b/.config/fish/conf.d/virtualfish-loader.fish deleted file mode 100644 index 88cbd8e..0000000 --- a/.config/fish/conf.d/virtualfish-loader.fish +++ /dev/null @@ -1,4 +0,0 @@ -set -g VIRTUALFISH_VERSION 2.5.5 -set -g VIRTUALFISH_PYTHON_EXEC /bin/python -source /home/barak/.local/lib/python3.11/site-packages/virtualfish/virtual.fish -emit virtualfish_did_setup_plugins \ No newline at end of file From 1ff79d8a850fd9237d7e304d33bc8e7713997aa0 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 14 Feb 2024 15:50:28 -0800 Subject: [PATCH 050/126] add alacritty toml --- .config/alacritty/alacritty.toml | 122 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 .config/alacritty/alacritty.toml diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..c228dcd --- /dev/null +++ b/.config/alacritty/alacritty.toml @@ -0,0 +1,122 @@ +[bell] +color = "#ffffff" +duration = 200 + +[colors] +draw_bold_text_with_bright_colors = false + +[colors.bright] +black = "#565656" +blue = "#49a4f8" +cyan = "#99faf2" +green = "#c0e17d" +magenta = "#a47de9" +red = "#ec5357" +white = "#ffffff" +yellow = "#f9da6a" + +[colors.normal] +black = "#2e2e2e" +blue = "#47a0f3" +cyan = "#64dbed" +green = "#abe047" +magenta = "#7b5cb0" +red = "#eb4129" +white = "#e5e9f0" +yellow = "#f6c744" + +[colors.primary] +background = "#000000" +foreground = "#fffbf6" + +[env] +TERM = "xterm-256color" + +[font] +size = 19.0 + +[font.bold] +style = "Regular" + +[font.bold_italic] +style = "Oblique" + +[font.italic] +style = "Light Oblique" + +[font.normal] +family = "Iosevka Berkeley" +style = "Light" + +[hints] +alphabet = "jfkdls;ahgurieowpq" + +[[hints.enabled]] +action = "Copy" +regex = "[a-f0-9]{7,}" + +[hints.enabled.binding] +key = "H" +mods = "Control|Shift" + +[[hints.enabled]] +action = "Copy" +regex = "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" + +[hints.enabled.binding] +key = "U" +mods = "Control|Shift" + +[[hints.enabled]] +command = "xdg-open" +post_processing = true +regex = "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" + +[hints.enabled.binding] +key = "L" +mods = "Control|Shift" + +[hints.enabled.mouse] +enabled = true +mods = "None" + +[[keyboard.bindings]] +action = "ToggleViMode" +key = "Q" +mode = "Vi|~Search" + +[[keyboard.bindings]] +action = "Paste" +key = "P" +mode = "Vi|~Search" + +[[keyboard.bindings]] +action = "ToggleFullscreen" +key = "Return" +mods = "Alt" + +[[keyboard.bindings]] +action = "ToggleFullscreen" +key = "Return" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u001B." +key = "Period" +mods = "Command" + +[scrolling] +history = 10000 +multiplier = 3 + +[window] +opacity = 0.88 +startup_mode = "Windowed" + +[window.dimensions] +columns = 106 +lines = 24 + +[window.padding] +x = 3 +y = 3 From ede78da06aea317a9ac7eb038b74e7d9adbb2c40 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 9 Mar 2024 20:38:45 -0800 Subject: [PATCH 051/126] [vim] Add :Q as :q like :W/:w --- .vimrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index c07d3ce..33ae6e0 100644 --- a/.vimrc +++ b/.vimrc @@ -657,11 +657,15 @@ set statusline+=\ %P "percent through file " ** SMALL FUNCTIONS THAT DON'T FIT AS PLUGINS *** -" Add capital W so I can be lazy about my shift key +" Add capital W and Q so I can be lazy about my shift key if !exists(":W") command W :w endif +if !exists(":Q") + command Q :q +endif + " CD to the path of the file I'm editing. command Cdf :cd %:p:h From d1e31d35b33e2bbaf3d69a95126ac0e1a2d51689 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 9 Mar 2024 20:40:31 -0800 Subject: [PATCH 052/126] remove spacemacs and edit again -- this needs to not happen (the editing, not the spacemacs) --- .config/alacritty/alacritty.yml | 2 +- .emacs.d/init.el | 35 ----------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 .emacs.d/init.el diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 8059159..39e69bc 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -151,7 +151,7 @@ font: style: Oblique # Point size - size: 19.0 + size: 20.0 # Offset is the extra space around each character. `offset.y` can be thought # of as modifying the line spacing, and `offset.x` as modifying the letter diff --git a/.emacs.d/init.el b/.emacs.d/init.el deleted file mode 100644 index 289257d..0000000 --- a/.emacs.d/init.el +++ /dev/null @@ -1,35 +0,0 @@ -;;; init.el --- Spacemacs Initialization File -;; -;; Copyright (c) 2012-2016 Sylvain Benner & Contributors -;; -;; Author: Sylvain Benner <sylvain.benner@gmail.com> -;; URL: https://github.com/syl20bnr/spacemacs -;; -;; This file is not part of GNU Emacs. -;; -;;; License: GPLv3 - -;; Without this comment emacs25 adds (package-initialize) here -;; (package-initialize) - -;; Increase gc-cons-threshold, depending on your system you may set it back to a -;; lower value in your dotfile (function `dotspacemacs/user-config') -(setq gc-cons-threshold 100000000) - -(defconst spacemacs-version "0.200.3" "Spacemacs version.") -(defconst spacemacs-emacs-min-version "24.4" "Minimal version of Emacs.") - -(if (not (version<= spacemacs-emacs-min-version emacs-version)) - (message (concat "Your version of Emacs (%s) is too old. " - "Spacemacs requires Emacs version %s or above.") - emacs-version spacemacs-emacs-min-version) - (load-file (concat (file-name-directory load-file-name) - "core/core-load-paths.el")) - (require 'core-spacemacs) - (spacemacs/init) - (spacemacs/maybe-install-dotfile) - (configuration-layer/sync) - (spacemacs-buffer/display-info-box) - (spacemacs/setup-startup-hook) - (require 'server) - (unless (server-running-p) (server-start))) From 509ccdc88b17874144fd6d182d274f730ed48e0c Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 9 Mar 2024 20:45:05 -0800 Subject: [PATCH 053/126] [alacritty] unify --- .config/alacritty/alacritty.toml | 128 --------------------------------------- 1 file changed, 128 deletions(-) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 6419f63..c20c7e0 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,131 +1,3 @@ -[bell] -color = "#ffffff" -duration = 200 - -[colors] -draw_bold_text_with_bright_colors = false - -[colors.bright] -black = "#565656" -blue = "#49a4f8" -cyan = "#99faf2" -green = "#c0e17d" -magenta = "#a47de9" -red = "#ec5357" -white = "#ffffff" -yellow = "#f9da6a" - -[colors.normal] -black = "#2e2e2e" -blue = "#47a0f3" -cyan = "#64dbed" -green = "#abe047" -magenta = "#7b5cb0" -red = "#eb4129" -white = "#e5e9f0" -yellow = "#f6c744" - -[colors.primary] -background = "#000000" -foreground = "#fffbf6" - -[env] -TERM = "xterm-256color" - -[font] -size = 20.0 - -[font.bold] -style = "Regular" - -[font.bold_italic] -style = "Oblique" - -[font.italic] -style = "Light Oblique" - -[font.normal] -family = "Iosevka Berkeley" -style = "Light" - -[hints] -alphabet = "jfkdls;ahgurieowpq" - -[[hints.enabled]] -action = "Copy" -regex = "[a-f0-9]{7,}" - -[hints.enabled.binding] -key = "H" -mods = "Control|Shift" - -[[hints.enabled]] -action = "Copy" -regex = "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" - -[hints.enabled.binding] -key = "U" -mods = "Control|Shift" - -[[hints.enabled]] -command = "xdg-open" -post_processing = true -regex = "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" - -[hints.enabled.binding] -key = "L" -mods = "Control|Shift" - -[hints.enabled.mouse] -enabled = true -mods = "None" - -[[keyboard.bindings]] -action = "ToggleViMode" -key = "Q" -mode = "Vi|~Search" - -[[keyboard.bindings]] -action = "Paste" -key = "P" -mode = "Vi|~Search" - -[[keyboard.bindings]] -action = "ToggleFullscreen" -key = "Return" -mods = "Alt" - -[[keyboard.bindings]] -action = "ToggleFullscreen" -key = "Return" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u001B." -key = "Period" -mods = "Command" - -[scrolling] -history = 10000 -multiplier = 3 - -[window] -opacity = 0.88 -startup_mode = "Windowed" - -[window.dimensions] -columns = 106 -lines = 24 - -[window.padding] -x = 3 -y = 3 -||||||| b9b5ebe -======= -[bell] -color = "#ffffff" -duration = 200 - [colors] draw_bold_text_with_bright_colors = false From d5e31079f6975c59eff1873ca8a637277a632d98 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 9 Mar 2024 21:29:51 -0800 Subject: [PATCH 054/126] [bin] add battery test --- bin/battery | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100755 bin/battery diff --git a/bin/battery b/bin/battery new file mode 100755 index 0000000..03ce28b --- /dev/null +++ b/bin/battery @@ -0,0 +1,132 @@ +#!/bin/sh + +HEART_FULL=♥ +HEART_EMPTY=♡ +[ -z "$NUM_HEARTS" ] && + NUM_HEARTS=5 + +cutinate() +{ + perc=$1 + inc=$(( 100 / $NUM_HEARTS)) + + + for i in `seq $NUM_HEARTS`; do + if [ $perc -lt 100 ]; then + echo $HEART_EMPTY + else + echo $HEART_FULL + fi + perc=$(( $perc + $inc )) + done +} + +linux_get_bat () +{ + echo $(( $BAT_TOTAL / $BAT_COUNT )) +} + + +openbsd_get_bat () +{ + bf=$(sysctl -n hw.sensors.acpibat0.amphour0 | cut -d ' ' -f 1) + bn=$(sysctl -n hw.sensors.acpibat0.amphour3 | cut -d ' ' -f 1) + echo "(($bn * 100) / $bf)" | bc -l | awk -F '.' '{ print $1 }'; +} + +freebsd_get_bat () +{ + sysctl -n hw.acpi.battery.life +} + +battery_status() +{ +case $(uname -s) in + "Linux") + BATTERIES=$(ls /sys/class/power_supply | grep BAT) + BAT_COUNT=$(ls /sys/class/power_supply | grep BAT | wc -l) + [ $BAT_COUNT -eq 0 ] && return + for BATTERY in $BATTERIES; do + BAT_PATH=/sys/class/power_supply/$BATTERY + STATUS=$BAT_PATH/status + [ "$1" = `cat $STATUS` ] || [ "$1" = "" ] || return 0 + if [ -f "$BAT_PATH/energy_full" ]; then + naming="energy" + elif [ -f "$BAT_PATH/charge_full" ]; then + naming="charge" + elif [ -f "$BAT_PATH/capacity" ]; then + cat "$BAT_PATH/capacity" + return 0 + fi + BAT_PERCENT=$(( 100 * $(cat $BAT_PATH/${naming}_now) / $(cat $BAT_PATH/${naming}_full) )) + BAT_TOTAL=$(( ${BAT_TOTAL-0} + $BAT_PERCENT )) + done + linux_get_bat + ;; + "FreeBSD") + STATUS=`sysctl -n hw.acpi.battery.state` + case $1 in + "Discharging") + if [ $STATUS -eq 1 ]; then + freebsd_get_bat + fi + ;; + "Charging") + if [ $STATUS -eq 2 ]; then + freebsd_get_bat + fi + ;; + "") + freebsd_get_bat + ;; + esac + ;; + "OpenBSD") + openbsd_get_bat + ;; + "Darwin") + case $1 in + "Discharging") + ext="No";; + "Charging") + ext="Yes";; + esac + + ioreg -c AppleSmartBattery -w0 | \ + grep -o '"[^"]*" = [^ ]*' | \ + sed -e 's/= //g' -e 's/"//g' | \ + sort | \ + while read key value; do + case $key in + "MaxCapacity") + export maxcap=$value;; + "CurrentCapacity") + export curcap=$value;; + "ExternalConnected") + if [ -n "$ext" ] && [ "$ext" != "$value" ]; then + exit + fi + ;; + "FullyCharged") + if [ "$value" = "Yes" ]; then + exit + fi + ;; + esac + if [[ -n "$maxcap" && -n $curcap ]]; then + echo $(( 100 * $curcap / $maxcap )) + break + fi + done +esac +} + +BATTERY_STATUS=`battery_status $1` +[ -z "$BATTERY_STATUS" ] && exit + +if [ -n "$CUTE_BATTERY_INDICATOR" ]; then + cutinate $BATTERY_STATUS +else + echo ${BATTERY_STATUS}% +fi + From e75d93975c87b5bd0426a8ff1dacc281af097062 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 9 Mar 2024 21:34:37 -0800 Subject: [PATCH 055/126] [tmux] add battery to lower right corner --- .tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index 4de1421..2b2a1ed 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -62,7 +62,7 @@ set-window-option -g window-active-style fg=terminal,bg=terminal set -g status-left '#[fg=green][ #h ][' set -g status-left-length 40 -set -g status-right '#[fg=green]][ #{pane_width}x#{pane_height} #[bright]#[fg=blue]%Y-%m-%d #[fg=white]%I:%M #[dim]#[fg=green]]' +set -g status-right '#[fg=green]][#(battery) #{pane_width}x#{pane_height} #[bright]#[fg=blue]%Y-%m-%d #[fg=white]%I:%M #[dim]#[fg=green]]' set -g status-right-length 40 # Notifying if other windows has activities From 80f3c7ec184a2b106405dea4bd709571c58b0245 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Thu, 14 Mar 2024 19:26:19 -0700 Subject: [PATCH 056/126] [alacritty] tomlify --- .config/alacritty/alacritty.toml | 4 + .config/alacritty/alacritty.yml | 903 --------------------------------------- 2 files changed, 4 insertions(+), 903 deletions(-) delete mode 100644 .config/alacritty/alacritty.yml diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index c20c7e0..c228dcd 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,3 +1,7 @@ +[bell] +color = "#ffffff" +duration = 200 + [colors] draw_bold_text_with_bright_colors = false diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml deleted file mode 100644 index 39e69bc..0000000 --- a/.config/alacritty/alacritty.yml +++ /dev/null @@ -1,903 +0,0 @@ -# Configuration for Alacritty, the GPU enhanced terminal emulator. - -# Import additional configuration files -# -# Imports are loaded in order, skipping all missing files, with the importing -# file being loaded last. If a field is already present in a previous import, it -# will be replaced. -# -# All imports must either be absolute paths starting with `/`, or paths relative -# to the user's home directory starting with `~/`. -#import: -# - /path/to/alacritty.yml - -# Any items in the `env` entry below will be added as -# environment variables. Some entries may override variables -# set by alacritty itself. -env: - # TERM variable - # - # This value is used to set the `$TERM` environment variable for - # each instance of Alacritty. If it is not present, alacritty will - # check the local terminfo database and use `alacritty` if it is - # available, otherwise `xterm-256color` is used. - TERM: xterm-256color - -window: - # Window dimensions (changes require restart) - # - # Number of lines/columns (not pixels) in the terminal. The number of columns - # must be at least `2`, while using a value of `0` for columns and lines will - # fall back to the window manager's recommended size. - dimensions: - columns: 106 - lines: 24 - - # Window position (changes require restart) - # - # Specified in number of pixels. - # If the position is not set, the window manager will handle the placement. - #position: - # x: 0 - # y: 0 - - # Window padding (changes require restart) - # - # Blank space added around the window in pixels. This padding is scaled - # by DPI and the specified value is always added at both opposing sides. - padding: - x: 3 - y: 3 - - # Spread additional padding evenly around the terminal content. - #dynamic_padding: false - - # Window decorations - # - # Values for `decorations`: - # - full: Borders and title bar - # - none: Neither borders nor title bar - # - # Values for `decorations` (macOS only): - # - transparent: Title bar, transparent background and title bar buttons - # - buttonless: Title bar, transparent background and no title bar buttons - #decorations: full - - # Startup Mode (changes require restart) - # - # Values for `startup_mode`: - # - Windowed - # - Maximized - # - Fullscreen - # - # Values for `startup_mode` (macOS only): - # - SimpleFullscreen - startup_mode: Windowed - - # Window title - #title: Alacritty - - # Allow terminal applications to change Alacritty's window title. - #dynamic_title: true - - # Window class (Linux/BSD only): - #class: - # Application instance name - #instance: Alacritty - # General application class - #general: Alacritty - - # GTK theme variant (Linux/BSD only) - # - # Override the variant of the GTK theme. Commonly supported values are `dark` - # and `light`. Set this to `None` to use the default theme variant. - #gtk_theme_variant: None - opacity: 0.88 - -scrolling: - # Maximum number of lines in the scrollback buffer. - # Specifying '0' will disable scrolling. - history: 10000 - - # Scrolling distance multiplier. - multiplier: 3 - -# Font configuration -font: - # Normal (roman) font face - normal: - # Font family - # - # Default: - # - (macOS) Menlo - # - (Linux/BSD) monospace - # - (Windows) Consolas - family: "Iosevka Berkeley" - - # The `style` can be specified to pick a specific face. - style: Light - - # Bold font face - bold: - # Font family - # - # If the bold family is not specified, it will fall back to the - # value specified for the normal font. - #family: monospace - - # The `style` can be specified to pick a specific face. - style: Regular - - # Italic font face - italic: - # Font family - # - # If the italic family is not specified, it will fall back to the - # value specified for the normal font. - #family: monospace - - # The `style` can be specified to pick a specific face. - style: Light Oblique - - # Bold italic font face - bold_italic: - # Font family - # - # If the bold italic family is not specified, it will fall back to the - # value specified for the normal font. - #family: monospace - - # The `style` can be specified to pick a specific face. - style: Oblique - - # Point size - size: 20.0 - - # Offset is the extra space around each character. `offset.y` can be thought - # of as modifying the line spacing, and `offset.x` as modifying the letter - # spacing. - #offset: - # x: 0 - # y: 0 - - # Glyph offset determines the locations of the glyphs within their cells with - # the default being at the bottom. Increasing `x` moves the glyph to the - # right, increasing `y` moves the glyph upward. - #glyph_offset: - # x: 0 - # y: 0 - - # Thin stroke font rendering (macOS only) - # - # Thin strokes are suitable for retina displays, but for non-retina screens - # it is recommended to set `use_thin_strokes` to `false`. - #use_thin_strokes: true - -# If `true`, bold text is drawn using the bright color variants. -draw_bold_text_with_bright_colors: false - -# Colors (Tango) -#colors: - #primary: - #background: '#000000' - ##foreground: '#00ff00' - #foreground: '#fffbf6' - - ## Normal colors - #normal: - #black: '#2e3436' - #red: '#cc0000' - #green: '#73d216' - #yellow: '#edd400' - #blue: '#3465a4' - #magenta: '#75507b' - #cyan: '#06989a' - #white: '#d3d7cf' - - ## Bright colors - #bright: - #black: '#2e3436' - #red: '#ef2929' - #green: '#8ae234' - #yellow: '#fce94f' - #blue: '#729fcf' - #magenta: '#ad7fa8' - #cyan: '#34e2e2' - #white: '#eeeeec' - -# Colors (iTerm 2 default theme) -colors: - # Default colors - primary: - #background: '#101421' - background: '#000000' - foreground: '#fffbf6' - - # Normal colors - normal: - black: '#2e2e2e' - red: '#eb4129' - green: '#abe047' - yellow: '#f6c744' - blue: '#47a0f3' - #blue: '#57b0ff' - magenta: '#7b5cb0' - cyan: '#64dbed' - white: '#e5e9f0' - - # Bright colors - bright: - black: '#565656' - red: '#ec5357' - green: '#c0e17d' - yellow: '#f9da6a' - blue: '#49a4f8' - magenta: '#a47de9' - cyan: '#99faf2' - white: '#ffffff' - -# Colors (Tomorrow Night) -#colors: - ## Default colors - #primary: - #background: '#000000' - #foreground: '#ffffff' - - # Bright and dim foreground colors - # - # The dimmed foreground color is calculated automatically if it is not - # present. If the bright foreground color is not set, or - # `draw_bold_text_with_bright_colors` is `false`, the normal foreground - # color will be used. - #dim_foreground: '#828482' - #bright_foreground: '#eaeaea' - - # Cursor colors - # - # Colors which should be used to draw the terminal cursor. - # - # Allowed values are CellForeground and CellBackground, which reference the - # affected cell, or hexadecimal colors like #ff00ff. - #cursor: - # text: CellBackground - # cursor: CellForeground - - # Vi mode cursor colors - # - # Colors for the cursor when the vi mode is active. - # - # Allowed values are CellForeground and CellBackground, which reference the - # affected cell, or hexadecimal colors like #ff00ff. - #vi_mode_cursor: - # text: CellBackground - # cursor: CellForeground - - # Search colors - # - # Colors used for the search bar and match highlighting. - #search: - # Allowed values are CellForeground and CellBackground, which reference the - # affected cell, or hexadecimal colors like #ff00ff. - #matches: - # foreground: '#000000' - # background: '#ffffff' - #focused_match: - # foreground: CellBackground - # background: CellForeground - - #bar: - # background: '#c5c8c6' - # foreground: '#1d1f21' - - # Line indicator - # - # Color used for the indicator displaying the position in history during - # search and vi mode. - # - # By default, these will use the opposing primary color. - #line_indicator: - # foreground: None - # background: None - - # Selection colors - # - # Colors which should be used to draw the selection area. - # - # Allowed values are CellForeground and CellBackground, which reference the - # affected cell, or hexadecimal colors like #ff00ff. - #selection: - # text: CellBackground - # background: CellForeground - - # Normal colors - #normal: - # black: '#1d1f21' - # red: '#cc6666' - # green: '#b5bd68' - # yellow: '#f0c674' - # blue: '#81a2be' - # magenta: '#b294bb' - # cyan: '#8abeb7' - # white: '#c5c8c6' - - # Bright colors - #bright: - # black: '#666666' - # red: '#d54e53' - # green: '#b9ca4a' - # yellow: '#e7c547' - # blue: '#7aa6da' - # magenta: '#c397d8' - # cyan: '#70c0b1' - # white: '#eaeaea' - - # Dim colors - # - # If the dim colors are not set, they will be calculated automatically based - # on the `normal` colors. - #dim: - # black: '#131415' - # red: '#864343' - # green: '#777c44' - # yellow: '#9e824c' - # blue: '#556a7d' - # magenta: '#75617b' - # cyan: '#5b7d78' - # white: '#828482' - - # Indexed Colors - # - # The indexed colors include all colors from 16 to 256. - # When these are not set, they're filled with sensible defaults. - # - # Example: - # `- { index: 16, color: '#ff00ff' }` - # - #indexed_colors: [] - -# Bell -# -# The bell is rung every time the BEL control character is received. -bell: - # Visual Bell Animation - # - # Animation effect for flashing the screen when the visual bell is rung. - # - # Values for `animation`: - # - Ease - # - EaseOut - # - EaseOutSine - # - EaseOutQuad - # - EaseOutCubic - # - EaseOutQuart - # - EaseOutQuint - # - EaseOutExpo - # - EaseOutCirc - # - Linear - #animation: EaseOutExpo - - # Duration of the visual bell flash in milliseconds. A `duration` of `0` will - # disable the visual bell animation. - duration: 200 - - # Visual bell animation color. - color: '#ffffff' - - # Bell Command - # - # This program is executed whenever the bell is rung. - # - # When set to `command: None`, no command will be executed. - # - # Example: - # command: - # program: notify-send - # args: ["Hello, World!"] - # - #command: None - -# Background opacity -# -# Window opacity as a floating point number from `0.0` to `1.0`. -# The value `0.0` is completely transparent and `1.0` is opaque. -#background_opacity: 0.92 - -#selection: - # This string contains all characters that are used as separators for - # "semantic words" in Alacritty. - #semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" - - # When set to `true`, selected text will be copied to the primary clipboard. - #save_to_clipboard: false - -#cursor: - # Cursor style - #style: - # Cursor shape - # - # Values for `shape`: - # - ▇ Block - # - _ Underline - # - | Beam - #shape: Block - - # Cursor blinking state - # - # Values for `blinking`: - # - Never: Prevent the cursor from ever blinking - # - Off: Disable blinking by default - # - On: Enable blinking by default - # - Always: Force the cursor to always blink - #blinking: Off - - # Vi mode cursor style - # - # If the vi mode cursor style is `None` or not specified, it will fall back to - # the style of the active value of the normal cursor. - # - # See `cursor.style` for available options. - #vi_mode_style: None - - # Cursor blinking interval in milliseconds. - #blink_interval: 750 - - # If this is `true`, the cursor will be rendered as a hollow box when the - # window is not focused. - #unfocused_hollow: true - - # Thickness of the cursor relative to the cell width as floating point number - # from `0.0` to `1.0`. - #thickness: 0.15 - -# Live config reload (changes require restart) -#live_config_reload: true - -# Shell -# -# You can set `shell.program` to the path of your favorite shell, e.g. -# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the -# shell. -# -# Default: -# - (macOS) /bin/bash --login -# - (Linux/BSD) user login shell -# - (Windows) powershell -#shell: -# program: /bin/bash -# args: -# - --login - -# Startup directory -# -# Directory the shell is started in. If this is unset, or `None`, the working -# directory of the parent process will be used. -#working_directory: None - -# Send ESC (\x1b) before characters when alt is pressed. -#alt_send_esc: true - -#mouse: - # Click settings - # - # The `double_click` and `triple_click` settings control the time - # alacritty should wait for accepting multiple clicks as one double - # or triple click. - #double_click: { threshold: 300 } - #triple_click: { threshold: 300 } - - # If this is `true`, the cursor is temporarily hidden when typing. - #hide_when_typing: false - - #url: - # URL launcher - # - # This program is executed when clicking on a text which is recognized as a - # URL. The URL is always added to the command as the last parameter. - # - # When set to `launcher: None`, URL launching will be disabled completely. - # - # Default: - # - (macOS) open - # - (Linux/BSD) xdg-open - # - (Windows) explorer - #launcher: - # program: xdg-open - # args: [] - - # URL modifiers - # - # These are the modifiers that need to be held down for opening URLs when - # clicking on them. The available modifiers are documented in the key - # binding section. - #modifiers: None - -# Mouse bindings -# -# Mouse bindings are specified as a list of objects, much like the key -# bindings further below. -# -# To trigger mouse bindings when an application running within Alacritty -# captures the mouse, the `Shift` modifier is automatically added as a -# requirement. -# -# Each mouse binding will specify a: -# -# - `mouse`: -# -# - Middle -# - Left -# - Right -# - Numeric identifier such as `5` -# -# - `action` (see key bindings) -# -# And optionally: -# -# - `mods` (see key bindings) -#mouse_bindings: -# - { mouse: Middle, action: PasteSelection } - -# Key bindings -# -# Key bindings are specified as a list of objects. For example, this is the -# default paste binding: -# -# `- { key: V, mods: Control|Shift, action: Paste }` -# -# Each key binding will specify a: -# -# - `key`: Identifier of the key pressed -# -# - A-Z -# - F1-F24 -# - Key0-Key9 -# -# A full list with available key codes can be found here: -# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants -# -# Instead of using the name of the keys, the `key` field also supports using -# the scancode of the desired key. Scancodes have to be specified as a -# decimal number. This command will allow you to display the hex scancodes -# for certain keys: -# -# `showkey --scancodes`. -# -# Then exactly one of: -# -# - `chars`: Send a byte sequence to the running application -# -# The `chars` field writes the specified string to the terminal. This makes -# it possible to pass escape sequences. To find escape codes for bindings -# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside -# of tmux. Note that applications use terminfo to map escape sequences back -# to keys. It is therefore required to update the terminfo when changing an -# escape sequence. -# -# - `action`: Execute a predefined action -# -# - ToggleViMode -# - SearchForward -# Start searching toward the right of the search origin. -# - SearchBackward -# Start searching toward the left of the search origin. -# - Copy -# - Paste -# - IncreaseFontSize -# - DecreaseFontSize -# - ResetFontSize -# - ScrollPageUp -# - ScrollPageDown -# - ScrollHalfPageUp -# - ScrollHalfPageDown -# - ScrollLineUp -# - ScrollLineDown -# - ScrollToTop -# - ScrollToBottom -# - ClearHistory -# Remove the terminal's scrollback history. -# - Hide -# Hide the Alacritty window. -# - Minimize -# Minimize the Alacritty window. -# - Quit -# Quit Alacritty. -# - ToggleFullscreen -# - SpawnNewInstance -# Spawn a new instance of Alacritty. -# - ClearLogNotice -# Clear Alacritty's UI warning and error notice. -# - ClearSelection -# Remove the active selection. -# - ReceiveChar -# - None -# -# - Vi mode exclusive actions: -# -# - Open -# Open URLs at the cursor location with the launcher configured in -# `url.launcher`. -# - ToggleNormalSelection -# - ToggleLineSelection -# - ToggleBlockSelection -# - ToggleSemanticSelection -# Toggle semantic selection based on `selection.semantic_escape_chars`. -# -# - Vi mode exclusive cursor motion actions: -# -# - Up -# One line up. -# - Down -# One line down. -# - Left -# One character left. -# - Right -# One character right. -# - First -# First column, or beginning of the line when already at the first column. -# - Last -# Last column, or beginning of the line when already at the last column. -# - FirstOccupied -# First non-empty cell in this terminal row, or first non-empty cell of -# the line when already at the first cell of the row. -# - High -# Top of the screen. -# - Middle -# Center of the screen. -# - Low -# Bottom of the screen. -# - SemanticLeft -# Start of the previous semantically separated word. -# - SemanticRight -# Start of the next semantically separated word. -# - SemanticLeftEnd -# End of the previous semantically separated word. -# - SemanticRightEnd -# End of the next semantically separated word. -# - WordLeft -# Start of the previous whitespace separated word. -# - WordRight -# Start of the next whitespace separated word. -# - WordLeftEnd -# End of the previous whitespace separated word. -# - WordRightEnd -# End of the next whitespace separated word. -# - Bracket -# Character matching the bracket at the cursor's location. -# - SearchNext -# Beginning of the next match. -# - SearchPrevious -# Beginning of the previous match. -# - SearchStart -# Start of the match to the left of the vi mode cursor. -# - SearchEnd -# End of the match to the right of the vi mode cursor. -# -# - Search mode exclusive actions: -# - SearchFocusNext -# Move the focus to the next search match. -# - SearchFocusPrevious -# Move the focus to the previous search match. -# - SearchConfirm -# - SearchCancel -# - SearchClear -# Reset the search regex. -# - SearchDeleteWord -# Delete the last word in the search regex. -# - SearchHistoryPrevious -# Go to the previous regex in the search history. -# - SearchHistoryNext -# Go to the next regex in the search history. -# -# - macOS exclusive actions: -# - ToggleSimpleFullscreen -# Enter fullscreen without occupying another space. -# -# - Linux/BSD exclusive actions: -# -# - CopySelection -# Copy from the selection buffer. -# - PasteSelection -# Paste from the selection buffer. -# -# - `command`: Fork and execute a specified command plus arguments -# -# The `command` field must be a map containing a `program` string and an -# `args` array of command line parameter strings. For example: -# `{ program: "alacritty", args: ["-e", "vttest"] }` -# -# And optionally: -# -# - `mods`: Key modifiers to filter binding actions -# -# - Command -# - Control -# - Option -# - Super -# - Shift -# - Alt -# -# Multiple `mods` can be combined using `|` like this: -# `mods: Control|Shift`. -# Whitespace and capitalization are relevant and must match the example. -# -# - `mode`: Indicate a binding for only specific terminal reported modes -# -# This is mainly used to send applications the correct escape sequences -# when in different modes. -# -# - AppCursor -# - AppKeypad -# - Search -# - Alt -# - Vi -# -# A `~` operator can be used before a mode to apply the binding whenever -# the mode is *not* active, e.g. `~Alt`. -# -# Bindings are always filled by default, but will be replaced when a new -# binding with the same triggers is defined. To unset a default binding, it can -# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for -# a no-op if you do not wish to receive input characters for that binding. -# -# If the same trigger is assigned to multiple actions, all of them are executed -# in the order they were defined in. -key_bindings: - #- { key: Paste, action: Paste } - #- { key: Copy, action: Copy } - #- { key: L, mods: Control, action: ClearLogNotice } - #- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" } - #- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp, } - #- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown } - #- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop, } - #- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom } - - # Vi Mode - #- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom } - #- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode } - #- { key: Escape, mode: Vi|~Search, action: ClearSelection } - #- { key: I, mode: Vi|~Search, action: ScrollToBottom } - #- { key: I, mode: Vi|~Search, action: ToggleViMode } - #- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode } - #- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp } - #- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown } - #- { key: G, mode: Vi|~Search, action: ScrollToTop } - #- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom } - #- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp } - #- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown } - #- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp } - #- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown } - #- { key: Y, mode: Vi|~Search, action: Copy } - #- { key: Y, mode: Vi|~Search, action: ClearSelection } - #- { key: Copy, mode: Vi|~Search, action: ClearSelection } - #- { key: V, mode: Vi|~Search, action: ToggleNormalSelection } - #- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection } - #- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection } - #- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection } - #- { key: Return, mode: Vi|~Search, action: Open } - #- { key: K, mode: Vi|~Search, action: Up } - #- { key: J, mode: Vi|~Search, action: Down } - #- { key: H, mode: Vi|~Search, action: Left } - #- { key: L, mode: Vi|~Search, action: Right } - #- { key: Up, mode: Vi|~Search, action: Up } - #- { key: Down, mode: Vi|~Search, action: Down } - #- { key: Left, mode: Vi|~Search, action: Left } - #- { key: Right, mode: Vi|~Search, action: Right } - #- { key: Key0, mode: Vi|~Search, action: First } - #- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last } - #- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied } - #- { key: H, mods: Shift, mode: Vi|~Search, action: High } - #- { key: M, mods: Shift, mode: Vi|~Search, action: Middle } - #- { key: L, mods: Shift, mode: Vi|~Search, action: Low } - #- { key: B, mode: Vi|~Search, action: SemanticLeft } - #- { key: W, mode: Vi|~Search, action: SemanticRight } - #- { key: E, mode: Vi|~Search, action: SemanticRightEnd } - #- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft } - #- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight } - #- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd } - #- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket } - #- { key: Slash, mode: Vi|~Search, action: SearchForward } - #- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward } - #- { key: N, mode: Vi|~Search, action: SearchNext } - #- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious } - - { key: Q, mode: Vi|~Search, action: ToggleViMode } - - { key: P, mode: Vi|~Search, action: Paste } - - # Search Mode - #- { key: Return, mode: Search|Vi, action: SearchConfirm } - #- { key: Escape, mode: Search, action: SearchCancel } - #- { key: C, mods: Control, mode: Search, action: SearchCancel } - #- { key: U, mods: Control, mode: Search, action: SearchClear } - #- { key: W, mods: Control, mode: Search, action: SearchDeleteWord } - #- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious } - #- { key: N, mods: Control, mode: Search, action: SearchHistoryNext } - #- { key: Up, mode: Search, action: SearchHistoryPrevious } - #- { key: Down, mode: Search, action: SearchHistoryNext } - #- { key: Return, mode: Search|~Vi, action: SearchFocusNext } - #- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious } - - # (Windows, Linux, and BSD only) - #- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste } - #- { key: C, mods: Control|Shift, action: Copy } - #- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward } - #- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward } - #- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection } - #- { key: Insert, mods: Shift, action: PasteSelection } - #- { key: Key0, mods: Control, action: ResetFontSize } - #- { key: Equals, mods: Control, action: IncreaseFontSize } - #- { key: Plus, mods: Control, action: IncreaseFontSize } - #- { key: NumpadAdd, mods: Control, action: IncreaseFontSize } - #- { key: Minus, mods: Control, action: DecreaseFontSize } - #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } - - # (Windows only) - - { key: Return, mods: Alt, action: ToggleFullscreen } - - # (macOS only) - #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } - #- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory } - #- { key: Key0, mods: Command, action: ResetFontSize } - #- { key: Equals, mods: Command, action: IncreaseFontSize } - #- { key: Plus, mods: Command, action: IncreaseFontSize } - #- { key: NumpadAdd, mods: Command, action: IncreaseFontSize } - #- { key: Minus, mods: Command, action: DecreaseFontSize } - #- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } - #- { key: V, mods: Command, action: Paste } - #- { key: C, mods: Command, action: Copy } - #- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection } - #- { key: H, mods: Command, action: Hide } - #- { key: M, mods: Command, action: Minimize } - #- { key: Q, mods: Command, action: Quit } - #- { key: W, mods: Command, action: Quit } - #- { key: N, mods: Command, action: SpawnNewInstance } - #- { key: F, mods: Command|Control, action: ToggleFullscreen } - - { key: Return, mods: Command, action: ToggleFullscreen } - #- { key: F, mods: Command, mode: ~Search, action: SearchForward } - #- { key: B, mods: Command, mode: ~Search, action: SearchBackward } - # Support Alt-. - - { key: Period, mods: Command, chars: "\x1b\x2e" } - -hints: - alphabet: "jfkdls;ahgurieowpq" - enabled: - - regex: "[a-f0-9]{7,}" - action: Copy - binding: - key: H - mods: Control|Shift - - regex: "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)\ - [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" - action: Copy - binding: - key: U - mods: Control|Shift - - regex: "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)\ - [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" - command: xdg-open - post_processing: true - mouse: - enabled: true - mods: None - binding: - key: L - mods: Control|Shift -#debug: - # Display the time it takes to redraw each frame. - #render_timer: false - - # Keep the log file after quitting Alacritty. - #persistent_logging: false - - # Log level - # - # Values for `log_level`: - # - Off - # - Error - # - Warn - # - Info - # - Debug - # - Trace - #log_level: Warn - - # Print all received window events. - #print_events: false - From 0cab81e17c3dfff3804f08266edbd46e10810fd6 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 27 Mar 2024 11:06:03 -0700 Subject: [PATCH 057/126] [vim] add lir instead of defx (no python dep yay) --- .vim/lua/lir_setup.lua | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ .vim/nvim.lua | 21 ++++++------ .vimrc | 6 ++-- 3 files changed, 101 insertions(+), 13 deletions(-) create mode 100644 .vim/lua/lir_setup.lua diff --git a/.vim/lua/lir_setup.lua b/.vim/lua/lir_setup.lua new file mode 100644 index 0000000..c1728bc --- /dev/null +++ b/.vim/lua/lir_setup.lua @@ -0,0 +1,87 @@ +local actions = require 'lir.actions' +local mark_actions = require 'lir.mark.actions' +local clipboard_actions = require 'lir.clipboard.actions' + +require 'lir'.setup { + show_hidden_files = false, + ignore = { ".DS_Store" }, -- { ".DS_Store", "node_modules" } etc. + devicons = { + enable = true, + highlight_dirname = true + }, + mappings = { + ['l'] = actions.edit, + ['<C-s>'] = actions.split, + ['<C-v>'] = actions.vsplit, + ['<C-t>'] = actions.tabedit, + + ['h'] = actions.up, + ['q'] = actions.quit, + + ['K'] = actions.mkdir, + ['N'] = actions.newfile, + ['R'] = actions.rename, + ['@'] = actions.cd, + ['Y'] = actions.yank_path, + ['.'] = actions.toggle_show_hidden, + ['D'] = actions.delete, + + ['J'] = function() + mark_actions.toggle_mark() + vim.cmd('normal! j') + end, + ['C'] = clipboard_actions.copy, + ['X'] = clipboard_actions.cut, + ['P'] = clipboard_actions.paste, + }, + float = { + winblend = 0, + curdir_window = { + enable = false, + highlight_dirname = false + }, + + -- -- You can define a function that returns a table to be passed as the third + -- -- argument of nvim_open_win(). + -- win_opts = function() + -- local width = math.floor(vim.o.columns * 0.8) + -- local height = math.floor(vim.o.lines * 0.8) + -- return { + -- border = { + -- "+", "─", "+", "│", "+", "─", "+", "│", + -- }, + -- width = width, + -- height = height, + -- row = 1, + -- col = math.floor((vim.o.columns - width) / 2), + -- } + -- end, + }, + hide_cursor = true +} + +vim.api.nvim_create_autocmd({ 'FileType' }, { + pattern = { "lir" }, + callback = function() + -- use visual mode + vim.api.nvim_buf_set_keymap( + 0, + "x", + "J", + ':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>', + { noremap = true, silent = true } + ) + + -- echo cwd + -- vim.api.nvim_echo({ { vim.fn.expand("%:p"), "Normal" } }, false, {}) + end +}) + +-- custom folder icon +require 'nvim-web-devicons'.set_icon({ + lir_folder_icon = { + icon = "", + color = "#7ebae4", + name = "LirFolderNode" + } +}) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 5446414..0a15cfc 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -387,17 +387,17 @@ require('trouble').setup { jump = { "o", "<tab>" }, -- jump to the diagnostic or open / close folds --open_split = { "<c-x>" }, -- open buffer in new split --open_vsplit = { "<c-v>" }, -- open buffer in new vsplit - open_tab = {}, -- open buffer in new tab - jump_close = { "<cr>" }, -- jump to the diagnostic and close the list - toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode - toggle_preview = "P", -- toggle auto_preview - hover = "K", -- opens a small popup with the full multiline message - preview = "p", -- preview the diagnostic location + open_tab = {}, -- open buffer in new tab + jump_close = { "<cr>" }, -- jump to the diagnostic and close the list + toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode + toggle_preview = "P", -- toggle auto_preview + hover = "K", -- opens a small popup with the full multiline message + preview = "p", -- preview the diagnostic location close_folds = { "zM", "zm" }, -- close all folds - open_folds = { "zR", "zr" }, -- open all folds + open_folds = { "zR", "zr" }, -- open all folds toggle_fold = { "zA", "za" }, -- toggle fold of current file - previous = "k", -- previous item - next = "j" -- next item + previous = "k", -- previous item + next = "j" -- next item }, } @@ -549,7 +549,7 @@ require 'nvim-treesitter.configs'.setup { playground = { enable = true, disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code persist_queries = false, -- Whether the query persists across vim sessions keybindings = { toggle_query_editor = 'o', @@ -667,3 +667,4 @@ function neogen_dwim() end require("murdock") +require("lir_setup") diff --git a/.vimrc b/.vimrc index 33ae6e0..7960ea1 100644 --- a/.vimrc +++ b/.vimrc @@ -239,8 +239,7 @@ Plug 'creativenull/efmls-configs-nvim', { 'tag': 'v1.*' } "Plug 'Shougo/vimproc.vim' "Plug 'Shougo/vimfiler.vim' -Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' } -Plug 'kristijanhusak/defx-icons' +Plug 'tamago324/lir.nvim' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-treesitter/playground' @@ -922,7 +921,8 @@ endfunction "nmap gt :NERDTreeToggle<CR> "nmap <silent> gt :VimFilerExplorer -winwidth=40 -toggle -direction=rightbelow -parent -status -force-hide<CR> "nmap <silent> gt :VimFiler -status -auto-cd -parent -force-quit<CR> -nmap <silent> gt :Defx `escape(expand('%:p:h'), ' :')` -search=`expand('%:p')` -columns=icons:indent:filename:type<CR> +"nmap <silent> gt :Defx `escape(expand('%:p:h'), ' :')` -search=`expand('%:p')` -columns=icons:indent:filename:type<CR> +nmap <silent> gt :edit .<CR> ""nnoremap <silent> gt :NvimTreeToggle<CR> " The same for the TagList, useful for large C files. "nmap gb :TlistToggle<CR> From 02090ad839e63a34f441af2edbed0c60517a3340 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 27 Mar 2024 11:08:04 -0700 Subject: [PATCH 058/126] [karabiner] add karabiner config for next mac --- .../assets/complex_modifications/1701202333.json | 2853 ++++++++++++++++ .../automatic_backups/karabiner_20231128.json | 3006 +++++++++++++++++ .../automatic_backups/karabiner_20231129.json | 3126 +++++++++++++++++ .../automatic_backups/karabiner_20231130.json | 3126 +++++++++++++++++ .../automatic_backups/karabiner_20240108.json | 3214 ++++++++++++++++++ .../automatic_backups/karabiner_20240109.json | 3461 +++++++++++++++++++ .config/karabiner/karabiner.json | 3557 ++++++++++++++++++++ 7 files changed, 22343 insertions(+) create mode 100644 .config/karabiner/assets/complex_modifications/1701202333.json create mode 100644 .config/karabiner/automatic_backups/karabiner_20231128.json create mode 100644 .config/karabiner/automatic_backups/karabiner_20231129.json create mode 100644 .config/karabiner/automatic_backups/karabiner_20231130.json create mode 100644 .config/karabiner/automatic_backups/karabiner_20240108.json create mode 100644 .config/karabiner/automatic_backups/karabiner_20240109.json create mode 100644 .config/karabiner/karabiner.json diff --git a/.config/karabiner/assets/complex_modifications/1701202333.json b/.config/karabiner/assets/complex_modifications/1701202333.json new file mode 100644 index 0000000..93ebab3 --- /dev/null +++ b/.config/karabiner/assets/complex_modifications/1701202333.json @@ -0,0 +1,2853 @@ +{ + "rules": [ + { + "description": "Insert (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Backspace (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_or_backspace", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_or_backspace", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Delete (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_forward", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_forward", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Win [Open Spotlight]", + "manipulators": [ + { + "from": { + "key_code": "left_command" + }, + "to": [ + { + "key_code": "left_command" + } + ], + "to_if_alone": [ + { + "apple_vendor_keyboard_key_code": "spotlight" + } + ], + "type": "basic" + } + ] + }, + { + "description": "A (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "a", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "a", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "B (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "b", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "b", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "I (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "i", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "i", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "N (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "n", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "n", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "O (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "o", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "o", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "P (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "p", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "p", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "R (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "r", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "r", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "S (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "s", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "s", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "T (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "t", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "t", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "U (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "u", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "u", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "W (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "w", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "X (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "x", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "x", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Y (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "y", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "y", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Z (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "z", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "1 (Cmd) [Open Finder]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b com.apple.finder" + } + ], + "type": "basic" + } + ] + }, + { + "description": "2 (Cmd) [Open first pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "2", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:0:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "3 (Cmd) [Open second pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:1:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "4 (Cmd) [Open third pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:2:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "5 (Cmd) [Open fourth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "5", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:3:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "6 (Cmd) [Open fifth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "6", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:4:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "7 (Cmd) [Open sixth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "7", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:5:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "8 (Cmd) [Open eighth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "8", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:6:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "9 (Cmd) [Open ninth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "9", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:7:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "/ (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "slash", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Space (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F1", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f1", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F3", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f3", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "g", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Alt) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + } + ], + "title": "Windows Shortcuts" +} diff --git a/.config/karabiner/automatic_backups/karabiner_20231128.json b/.config/karabiner/automatic_backups/karabiner_20231128.json new file mode 100644 index 0000000..2ebc0af --- /dev/null +++ b/.config/karabiner/automatic_backups/karabiner_20231128.json @@ -0,0 +1,3006 @@ +{ + "global": { + "ask_for_confirmation_before_quitting": true, + "check_for_updates_on_startup": true, + "show_in_menu_bar": true, + "show_profile_name_in_menu_bar": false, + "unsafe_ui": false + }, + "profiles": [ + { + "complex_modifications": { + "parameters": { + "basic.simultaneous_threshold_milliseconds": 50, + "basic.to_delayed_action_delay_milliseconds": 500, + "basic.to_if_alone_timeout_milliseconds": 1000, + "basic.to_if_held_down_threshold_milliseconds": 500, + "mouse_motion_to_scroll.speed": 100 + }, + "rules": [ + { + "description": "Insert (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Backspace (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_or_backspace", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_or_backspace", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Delete (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_forward", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_forward", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Win [Open Spotlight]", + "manipulators": [ + { + "from": { + "key_code": "left_command" + }, + "to": [ + { + "key_code": "left_command" + } + ], + "to_if_alone": [ + { + "apple_vendor_keyboard_key_code": "spotlight" + } + ], + "type": "basic" + } + ] + }, + { + "description": "A (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "a", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "a", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "B (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "b", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "b", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "I (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "i", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "i", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "N (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "n", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "n", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "O (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "o", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "o", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "P (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "p", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "p", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "R (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "r", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "r", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "S (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "s", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "s", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "T (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "t", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "t", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "U (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "u", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "u", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "W (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "w", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "X (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "x", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "x", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Y (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "y", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "y", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Z (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "z", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "1 (Cmd) [Open Finder]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b com.apple.finder" + } + ], + "type": "basic" + } + ] + }, + { + "description": "2 (Cmd) [Open first pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "2", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:0:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "3 (Cmd) [Open second pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:1:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "4 (Cmd) [Open third pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:2:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "5 (Cmd) [Open fourth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "5", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:3:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "6 (Cmd) [Open fifth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "6", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:4:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "7 (Cmd) [Open sixth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "7", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:5:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "8 (Cmd) [Open eighth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "8", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:6:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "9 (Cmd) [Open ninth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "9", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:7:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "/ (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "slash", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Space (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F1", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f1", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F3", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^io\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f3", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "g", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Alt) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + } + ] + }, + "devices": [], + "fn_function_keys": [ + { + "from": { + "key_code": "f1" + }, + "to": [ + { + "consumer_key_code": "display_brightness_decrement" + } + ] + }, + { + "from": { + "key_code": "f2" + }, + "to": [ + { + "consumer_key_code": "display_brightness_increment" + } + ] + }, + { + "from": { + "key_code": "f3" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "mission_control" + } + ] + }, + { + "from": { + "key_code": "f4" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "spotlight" + } + ] + }, + { + "from": { + "key_code": "f5" + }, + "to": [ + { + "consumer_key_code": "dictation" + } + ] + }, + { + "from": { + "key_code": "f6" + }, + "to": [ + { + "key_code": "f6" + } + ] + }, + { + "from": { + "key_code": "f7" + }, + "to": [ + { + "consumer_key_code": "rewind" + } + ] + }, + { + "from": { + "key_code": "f8" + }, + "to": [ + { + "consumer_key_code": "play_or_pause" + } + ] + }, + { + "from": { + "key_code": "f9" + }, + "to": [ + { + "consumer_key_code": "fast_forward" + } + ] + }, + { + "from": { + "key_code": "f10" + }, + "to": [ + { + "consumer_key_code": "mute" + } + ] + }, + { + "from": { + "key_code": "f11" + }, + "to": [ + { + "consumer_key_code": "volume_decrement" + } + ] + }, + { + "from": { + "key_code": "f12" + }, + "to": [ + { + "consumer_key_code": "volume_increment" + } + ] + } + ], + "name": "Default profile", + "parameters": { + "delay_milliseconds_before_open_device": 1000 + }, + "selected": true, + "simple_modifications": [], + "virtual_hid_keyboard": { + "country_code": 0, + "indicate_sticky_modifier_keys_state": true, + "mouse_key_xy_scale": 100 + } + } + ] +} \ No newline at end of file diff --git a/.config/karabiner/automatic_backups/karabiner_20231129.json b/.config/karabiner/automatic_backups/karabiner_20231129.json new file mode 100644 index 0000000..aafebe6 --- /dev/null +++ b/.config/karabiner/automatic_backups/karabiner_20231129.json @@ -0,0 +1,3126 @@ +{ + "global": { + "ask_for_confirmation_before_quitting": true, + "check_for_updates_on_startup": true, + "show_in_menu_bar": true, + "show_profile_name_in_menu_bar": false, + "unsafe_ui": false + }, + "profiles": [ + { + "complex_modifications": { + "parameters": { + "basic.simultaneous_threshold_milliseconds": 50, + "basic.to_delayed_action_delay_milliseconds": 500, + "basic.to_if_alone_timeout_milliseconds": 1000, + "basic.to_if_held_down_threshold_milliseconds": 500, + "mouse_motion_to_scroll.speed": 100 + }, + "rules": [ + { + "description": "Insert (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Backspace (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_or_backspace", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_or_backspace", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Delete (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_forward", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_forward", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "A (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "a", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "a", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "B (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "b", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "b", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Switch Channels [Slack]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.tinyspeck\\.slackmacgap$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "k", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "k", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Spotlight [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "I (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "i", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "i", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "N (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "n", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "n", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "O (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "o", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "o", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "P (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "p", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "p", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "R (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "r", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "r", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "S (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "s", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "s", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "T (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "t", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "t", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "U (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "u", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "u", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "W (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "w", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "X (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "x", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "x", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Y (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "y", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "y", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Z (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "z", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "1 (Cmd) [Open Finder]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b com.apple.finder" + } + ], + "type": "basic" + } + ] + }, + { + "description": "2 (Cmd) [Open first pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "2", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:0:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "3 (Cmd) [Open second pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:1:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "4 (Cmd) [Open third pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:2:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "5 (Cmd) [Open fourth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "5", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:3:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "6 (Cmd) [Open fifth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "6", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:4:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "7 (Cmd) [Open sixth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "7", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:5:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "8 (Cmd) [Open eighth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "8", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:6:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "9 (Cmd) [Open ninth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "9", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:7:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "/ (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "slash", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Space (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F1", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f1", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F3", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f3", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "g", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Alt) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + } + ] + }, + "devices": [ + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 0, + "vendor_id": 0 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 0, + "vendor_id": 0 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": true, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": true, + "product_id": 32774, + "vendor_id": 3141 + }, + "ignore": true, + "manipulate_caps_lock_led": true, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 32774, + "vendor_id": 3141 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [ + { + "from": { + "key_code": "left_command" + }, + "to": [ + { + "key_code": "left_option" + } + ] + }, + { + "from": { + "key_code": "left_option" + }, + "to": [ + { + "key_code": "left_command" + } + ] + } + ], + "treat_as_built_in_keyboard": false + } + ], + "fn_function_keys": [ + { + "from": { + "key_code": "f1" + }, + "to": [ + { + "consumer_key_code": "display_brightness_decrement" + } + ] + }, + { + "from": { + "key_code": "f2" + }, + "to": [ + { + "consumer_key_code": "display_brightness_increment" + } + ] + }, + { + "from": { + "key_code": "f3" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "mission_control" + } + ] + }, + { + "from": { + "key_code": "f4" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "spotlight" + } + ] + }, + { + "from": { + "key_code": "f5" + }, + "to": [ + { + "consumer_key_code": "dictation" + } + ] + }, + { + "from": { + "key_code": "f6" + }, + "to": [ + { + "key_code": "f6" + } + ] + }, + { + "from": { + "key_code": "f7" + }, + "to": [ + { + "consumer_key_code": "rewind" + } + ] + }, + { + "from": { + "key_code": "f8" + }, + "to": [ + { + "consumer_key_code": "play_or_pause" + } + ] + }, + { + "from": { + "key_code": "f9" + }, + "to": [ + { + "consumer_key_code": "fast_forward" + } + ] + }, + { + "from": { + "key_code": "f10" + }, + "to": [ + { + "consumer_key_code": "mute" + } + ] + }, + { + "from": { + "key_code": "f11" + }, + "to": [ + { + "consumer_key_code": "volume_decrement" + } + ] + }, + { + "from": { + "key_code": "f12" + }, + "to": [ + { + "consumer_key_code": "volume_increment" + } + ] + } + ], + "name": "Default profile", + "parameters": { + "delay_milliseconds_before_open_device": 1000 + }, + "selected": true, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": [ + { + "key_code": "left_control" + } + ] + } + ], + "virtual_hid_keyboard": { + "country_code": 0, + "indicate_sticky_modifier_keys_state": true, + "mouse_key_xy_scale": 100 + } + } + ] +} diff --git a/.config/karabiner/automatic_backups/karabiner_20231130.json b/.config/karabiner/automatic_backups/karabiner_20231130.json new file mode 100644 index 0000000..5e2c3d8 --- /dev/null +++ b/.config/karabiner/automatic_backups/karabiner_20231130.json @@ -0,0 +1,3126 @@ +{ + "global": { + "ask_for_confirmation_before_quitting": true, + "check_for_updates_on_startup": true, + "show_in_menu_bar": true, + "show_profile_name_in_menu_bar": false, + "unsafe_ui": false + }, + "profiles": [ + { + "complex_modifications": { + "parameters": { + "basic.simultaneous_threshold_milliseconds": 50, + "basic.to_delayed_action_delay_milliseconds": 500, + "basic.to_if_alone_timeout_milliseconds": 1000, + "basic.to_if_held_down_threshold_milliseconds": 500, + "mouse_motion_to_scroll.speed": 100 + }, + "rules": [ + { + "description": "Insert (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Backspace (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_or_backspace", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_or_backspace", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Delete (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_forward", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_forward", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "A (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "a", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "a", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "B (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "b", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "b", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Switch Channels [Slack]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.tinyspeck\\.slackmacgap$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "k", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "k", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Spotlight [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "I (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "i", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "i", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "N (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "n", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "n", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "O (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "o", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "o", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "P (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "p", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "p", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "R (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "r", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "r", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "S (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "s", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "s", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "T (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "t", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "t", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "U (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "u", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "u", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "W (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "w", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "X (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "x", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "x", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Y (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "y", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "y", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Z (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "z", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "1 (Cmd) [Open Finder]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b com.apple.finder" + } + ], + "type": "basic" + } + ] + }, + { + "description": "2 (Cmd) [Open first pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "2", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:0:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "3 (Cmd) [Open second pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:1:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "4 (Cmd) [Open third pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:2:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "5 (Cmd) [Open fourth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "5", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:3:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "6 (Cmd) [Open fifth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "6", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:4:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "7 (Cmd) [Open sixth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "7", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:5:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "8 (Cmd) [Open eighth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "8", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:6:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "9 (Cmd) [Open ninth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "9", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:7:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "/ (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "slash", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Space (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F1", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f1", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F3", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f3", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "g", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Alt) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + } + ] + }, + "devices": [ + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 0, + "vendor_id": 0 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 0, + "vendor_id": 0 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": true, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": true, + "product_id": 32774, + "vendor_id": 3141 + }, + "ignore": true, + "manipulate_caps_lock_led": true, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 32774, + "vendor_id": 3141 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [ + { + "from": { + "key_code": "left_command" + }, + "to": [ + { + "key_code": "left_option" + } + ] + }, + { + "from": { + "key_code": "left_option" + }, + "to": [ + { + "key_code": "left_command" + } + ] + } + ], + "treat_as_built_in_keyboard": false + } + ], + "fn_function_keys": [ + { + "from": { + "key_code": "f1" + }, + "to": [ + { + "consumer_key_code": "display_brightness_decrement" + } + ] + }, + { + "from": { + "key_code": "f2" + }, + "to": [ + { + "consumer_key_code": "display_brightness_increment" + } + ] + }, + { + "from": { + "key_code": "f3" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "mission_control" + } + ] + }, + { + "from": { + "key_code": "f4" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "spotlight" + } + ] + }, + { + "from": { + "key_code": "f5" + }, + "to": [ + { + "consumer_key_code": "dictation" + } + ] + }, + { + "from": { + "key_code": "f6" + }, + "to": [ + { + "key_code": "f6" + } + ] + }, + { + "from": { + "key_code": "f7" + }, + "to": [ + { + "consumer_key_code": "rewind" + } + ] + }, + { + "from": { + "key_code": "f8" + }, + "to": [ + { + "consumer_key_code": "play_or_pause" + } + ] + }, + { + "from": { + "key_code": "f9" + }, + "to": [ + { + "consumer_key_code": "fast_forward" + } + ] + }, + { + "from": { + "key_code": "f10" + }, + "to": [ + { + "consumer_key_code": "mute" + } + ] + }, + { + "from": { + "key_code": "f11" + }, + "to": [ + { + "consumer_key_code": "volume_decrement" + } + ] + }, + { + "from": { + "key_code": "f12" + }, + "to": [ + { + "consumer_key_code": "volume_increment" + } + ] + } + ], + "name": "Default profile", + "parameters": { + "delay_milliseconds_before_open_device": 1000 + }, + "selected": true, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": [ + { + "key_code": "left_control" + } + ] + } + ], + "virtual_hid_keyboard": { + "country_code": 0, + "indicate_sticky_modifier_keys_state": true, + "mouse_key_xy_scale": 100 + } + } + ] +} \ No newline at end of file diff --git a/.config/karabiner/automatic_backups/karabiner_20240108.json b/.config/karabiner/automatic_backups/karabiner_20240108.json new file mode 100644 index 0000000..b1eb810 --- /dev/null +++ b/.config/karabiner/automatic_backups/karabiner_20240108.json @@ -0,0 +1,3214 @@ +{ + "global": { + "ask_for_confirmation_before_quitting": true, + "check_for_updates_on_startup": true, + "show_in_menu_bar": true, + "show_profile_name_in_menu_bar": false, + "unsafe_ui": false + }, + "profiles": [ + { + "complex_modifications": { + "parameters": { + "basic.simultaneous_threshold_milliseconds": 50, + "basic.to_delayed_action_delay_milliseconds": 500, + "basic.to_if_alone_timeout_milliseconds": 1000, + "basic.to_if_held_down_threshold_milliseconds": 500, + "mouse_motion_to_scroll.speed": 100 + }, + "rules": [ + { + "description": "Insert (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Backspace (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_or_backspace", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_or_backspace", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Delete (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_forward", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_forward", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "A (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "a", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "a", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "B (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "b", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "b", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Switch Channels [Slack]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.tinyspeck\\.slackmacgap$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "k", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "k", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Spotlight [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "I (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "i", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "i", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "N (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "n", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "n", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "O (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "o", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "o", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "P (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "p", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "p", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "R (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "r", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "r", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "S (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "s", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "s", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "T (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "t", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "t", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "U (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "u", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "u", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "W (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "w", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "X (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "x", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "x", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Y (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "y", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "y", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Z (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "z", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "1 (Cmd) [Open Finder]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b com.apple.finder" + } + ], + "type": "basic" + } + ] + }, + { + "description": "2 (Cmd) [Open first pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "2", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:0:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "3 (Cmd) [Open second pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:1:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "4 (Cmd) [Open third pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:2:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "5 (Cmd) [Open fourth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "5", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:3:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "6 (Cmd) [Open fifth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "6", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:4:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "7 (Cmd) [Open sixth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "7", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:5:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "8 (Cmd) [Open eighth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "8", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:6:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "9 (Cmd) [Open ninth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "9", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:7:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "/ (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "slash", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Space (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F1", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f1", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F3", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f3", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "g", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Alt) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + } + ] + }, + "devices": [ + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 0, + "vendor_id": 0 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 0, + "vendor_id": 0 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": [ + { + "key_code": "left_command" + } + ] + } + ], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": true, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": true, + "product_id": 32774, + "vendor_id": 3141 + }, + "ignore": true, + "manipulate_caps_lock_led": true, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 32774, + "vendor_id": 3141 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [ + { + "from": { + "key_code": "left_command" + }, + "to": [ + { + "key_code": "left_option" + } + ] + }, + { + "from": { + "key_code": "left_option" + }, + "to": [ + { + "key_code": "left_command" + } + ] + } + ], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 29699, + "vendor_id": 3141 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [ + { + "from": { + "key_code": "left_option" + }, + "to": [ + { + "key_code": "left_command" + } + ] + }, + { + "from": { + "key_code": "left_command" + }, + "to": [ + { + "key_code": "left_option" + } + ] + } + ], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 29699, + "vendor_id": 3141 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 50504, + "vendor_id": 1133 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 50504, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + } + ], + "fn_function_keys": [ + { + "from": { + "key_code": "f1" + }, + "to": [ + { + "consumer_key_code": "display_brightness_decrement" + } + ] + }, + { + "from": { + "key_code": "f2" + }, + "to": [ + { + "consumer_key_code": "display_brightness_increment" + } + ] + }, + { + "from": { + "key_code": "f3" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "mission_control" + } + ] + }, + { + "from": { + "key_code": "f4" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "spotlight" + } + ] + }, + { + "from": { + "key_code": "f5" + }, + "to": [ + { + "consumer_key_code": "dictation" + } + ] + }, + { + "from": { + "key_code": "f6" + }, + "to": [ + { + "key_code": "f6" + } + ] + }, + { + "from": { + "key_code": "f7" + }, + "to": [ + { + "consumer_key_code": "rewind" + } + ] + }, + { + "from": { + "key_code": "f8" + }, + "to": [ + { + "consumer_key_code": "play_or_pause" + } + ] + }, + { + "from": { + "key_code": "f9" + }, + "to": [ + { + "consumer_key_code": "fast_forward" + } + ] + }, + { + "from": { + "key_code": "f10" + }, + "to": [ + { + "consumer_key_code": "mute" + } + ] + }, + { + "from": { + "key_code": "f11" + }, + "to": [ + { + "consumer_key_code": "volume_decrement" + } + ] + }, + { + "from": { + "key_code": "f12" + }, + "to": [ + { + "consumer_key_code": "volume_increment" + } + ] + } + ], + "name": "Default profile", + "parameters": { + "delay_milliseconds_before_open_device": 1000 + }, + "selected": true, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": [ + { + "key_code": "left_control" + } + ] + } + ], + "virtual_hid_keyboard": { + "country_code": 0, + "indicate_sticky_modifier_keys_state": true, + "mouse_key_xy_scale": 100 + } + } + ] +} \ No newline at end of file diff --git a/.config/karabiner/automatic_backups/karabiner_20240109.json b/.config/karabiner/automatic_backups/karabiner_20240109.json new file mode 100644 index 0000000..abace6a --- /dev/null +++ b/.config/karabiner/automatic_backups/karabiner_20240109.json @@ -0,0 +1,3461 @@ +{ + "global": { + "ask_for_confirmation_before_quitting": true, + "check_for_updates_on_startup": true, + "show_in_menu_bar": true, + "show_profile_name_in_menu_bar": false, + "unsafe_ui": false + }, + "profiles": [ + { + "complex_modifications": { + "parameters": { + "basic.simultaneous_threshold_milliseconds": 50, + "basic.to_delayed_action_delay_milliseconds": 500, + "basic.to_if_alone_timeout_milliseconds": 1000, + "basic.to_if_held_down_threshold_milliseconds": 500, + "mouse_motion_to_scroll.speed": 100 + }, + "rules": [ + { + "description": "G (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "g", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "g", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "f", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "4 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "4", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "3 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "3", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "2 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "2", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "2", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "1 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "1", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Backspace (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_or_backspace", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_or_backspace", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Delete (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_forward", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_forward", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "A (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "a", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "a", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "B (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "b", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "b", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Switch Channels [Slack]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.tinyspeck\\.slackmacgap$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "k", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "k", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Spotlight [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "I (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "i", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "i", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "N (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "n", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "n", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "O (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "o", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "o", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "P (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "p", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "p", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "R (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "r", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "r", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "S (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "s", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "s", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "T (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "t", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "t", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "U (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "u", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "u", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "W (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "w", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "X (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "x", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "x", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Y (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "y", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "y", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Z (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "z", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "1 (Cmd) [Open Finder]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b com.apple.finder" + } + ], + "type": "basic" + } + ] + }, + { + "description": "3 (Cmd) [Open second pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:1:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "4 (Cmd) [Open third pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:2:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "5 (Cmd) [Open fourth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "5", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:3:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "6 (Cmd) [Open fifth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "6", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:4:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "7 (Cmd) [Open sixth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "7", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:5:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "8 (Cmd) [Open eighth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "8", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:6:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "9 (Cmd) [Open ninth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "9", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:7:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "/ (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "slash", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Space (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F1", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f1", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F3", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f3", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "g", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Alt) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + } + ] + }, + "devices": [ + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 0, + "vendor_id": 0 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 0, + "vendor_id": 0 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": [ + { + "key_code": "left_command" + } + ] + } + ], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": true, + "product_id": 32774, + "vendor_id": 3141 + }, + "ignore": true, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 32774, + "vendor_id": 3141 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [ + { + "from": { + "key_code": "left_command" + }, + "to": [ + { + "key_code": "left_option" + } + ] + }, + { + "from": { + "key_code": "left_option" + }, + "to": [ + { + "key_code": "left_command" + } + ] + } + ], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 29699, + "vendor_id": 3141 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [ + { + "from": { + "key_code": "left_command" + }, + "to": [ + { + "key_code": "left_option" + } + ] + }, + { + "from": { + "key_code": "left_option" + }, + "to": [ + { + "key_code": "left_command" + } + ] + } + ], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 29699, + "vendor_id": 3141 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 50504, + "vendor_id": 1133 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 50504, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + } + ], + "fn_function_keys": [ + { + "from": { + "key_code": "f1" + }, + "to": [ + { + "consumer_key_code": "display_brightness_decrement" + } + ] + }, + { + "from": { + "key_code": "f2" + }, + "to": [ + { + "consumer_key_code": "display_brightness_increment" + } + ] + }, + { + "from": { + "key_code": "f3" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "mission_control" + } + ] + }, + { + "from": { + "key_code": "f4" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "spotlight" + } + ] + }, + { + "from": { + "key_code": "f5" + }, + "to": [ + { + "consumer_key_code": "dictation" + } + ] + }, + { + "from": { + "key_code": "f6" + }, + "to": [ + { + "key_code": "f6" + } + ] + }, + { + "from": { + "key_code": "f7" + }, + "to": [ + { + "consumer_key_code": "rewind" + } + ] + }, + { + "from": { + "key_code": "f8" + }, + "to": [ + { + "consumer_key_code": "play_or_pause" + } + ] + }, + { + "from": { + "key_code": "f9" + }, + "to": [ + { + "consumer_key_code": "fast_forward" + } + ] + }, + { + "from": { + "key_code": "f10" + }, + "to": [ + { + "consumer_key_code": "mute" + } + ] + }, + { + "from": { + "key_code": "f11" + }, + "to": [ + { + "consumer_key_code": "volume_decrement" + } + ] + }, + { + "from": { + "key_code": "f12" + }, + "to": [ + { + "consumer_key_code": "volume_increment" + } + ] + } + ], + "name": "Default profile", + "parameters": { + "delay_milliseconds_before_open_device": 1000 + }, + "selected": true, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": [ + { + "key_code": "left_control" + } + ] + } + ], + "virtual_hid_keyboard": { + "country_code": 0, + "indicate_sticky_modifier_keys_state": true, + "mouse_key_xy_scale": 100 + } + } + ] +} \ No newline at end of file diff --git a/.config/karabiner/karabiner.json b/.config/karabiner/karabiner.json new file mode 100644 index 0000000..8b34fbb --- /dev/null +++ b/.config/karabiner/karabiner.json @@ -0,0 +1,3557 @@ +{ + "global": { + "ask_for_confirmation_before_quitting": true, + "check_for_updates_on_startup": true, + "show_in_menu_bar": true, + "show_profile_name_in_menu_bar": false, + "unsafe_ui": false + }, + "profiles": [ + { + "complex_modifications": { + "parameters": { + "basic.simultaneous_threshold_milliseconds": 50, + "basic.to_delayed_action_delay_milliseconds": 500, + "basic.to_if_alone_timeout_milliseconds": 1000, + "basic.to_if_held_down_threshold_milliseconds": 500, + "mouse_motion_to_scroll.speed": 100 + }, + "rules": [ + { + "description": "L (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "l", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "New Alacritty", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "shift", + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -n /Applications/Alacritty.app" + } + ], + "type": "basic" + } + ] + }, + { + "description": "G (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "g", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "g", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "f", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "f", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "4 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "4", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "3 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "3", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "2 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "2", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "2", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "1 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.mozilla\\.firefox$", + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "1", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Insert (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Home (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "home", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "End (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "end", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Left Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "left_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Right Arrow (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "right_arrow", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "option", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Backspace (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_or_backspace", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_or_backspace", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Delete (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "delete_forward", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "delete_forward", + "modifiers": [ + "option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Enter (Ctrl+Shift)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "return_or_enter", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "A (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "a", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "a", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "B (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "b", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "b", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "left_control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "C (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Switch Channels [Slack]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.tinyspeck\\.slackmacgap$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "k", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "k", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Spotlight [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "I (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "i", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "i", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Win) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Login Window]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" + } + ], + "type": "basic" + } + ] + }, + { + "description": "L (Alt+Ctrl) [Lock Screen]", + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "control", + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "power", + "modifiers": [ + "control", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "N (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "n", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "n", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "O (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "o", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "o", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "P (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "p", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "p", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "R (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "r", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "r", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "S (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "s", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "s", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "T (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "t", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "t", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "U (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "u", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "u", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "V (Ctrl+Shift) [Only Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control", + "shift" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "W (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "w", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "X (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "x", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "x", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Y (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "y", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "y", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Z (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "z", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "1 (Cmd) [Open Finder]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b com.apple.finder" + } + ], + "type": "basic" + } + ] + }, + { + "description": "3 (Cmd) [Open second pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:1:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "4 (Cmd) [Open third pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:2:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "5 (Cmd) [Open fourth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "5", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:3:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "6 (Cmd) [Open fifth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "6", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:4:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "7 (Cmd) [Open sixth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "7", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:5:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "8 (Cmd) [Open eighth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "8", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:6:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "9 (Cmd) [Open ninth pinned Dock app]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "9", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "shell_command": "open -b $(/usr/libexec/PlistBuddy -c 'print :persistent-apps:7:tile-data:bundle-identifier' ~/Library/Preferences/com.apple.dock.plist)" + } + ], + "type": "basic" + } + ] + }, + { + "description": "/ (Ctrl) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "slash", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Space (Ctrl)", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "spacebar", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F1", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f1", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "command", + "shift" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F3", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$", + "^org\\.alacritty$", + "^co\\.zeit\\.hyper$", + "^com\\.googlecode\\.iterm2$", + "^com\\.apple\\.Terminal$", + "^com\\.github\\.wez\\.wezterm$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f3", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "g", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Alt) [+Terminal Emulators]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^org\\.virtualbox\\.app\\.VirtualBoxVM$", + "^com\\.parallels\\.desktop\\.console$", + "^org\\.vmware\\.fusion$", + "^org\\.gnu\\.emacs$", + "^com\\.jetbrains", + "^com\\.microsoft\\.VSCode$", + "^com\\.sublimetext\\.3$", + "^net\\.kovidgoyal\\.kitty$", + "^com\\.citrix\\.XenAppViewer$", + "^com\\.microsoft\\.rdc\\.macos$" + ], + "file_paths": [ + "Chrome Remote Desktop\\.app" + ], + "type": "frontmost_application_unless" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "F4 (Ctrl) [Only Chrome]", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.google\\.Chrome$" + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + } + ] + }, + "devices": [ + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 0, + "vendor_id": 0 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 0, + "vendor_id": 0 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": [ + { + "key_code": "left_command" + } + ] + } + ], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 50475, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": true, + "product_id": 32774, + "vendor_id": 3141 + }, + "ignore": true, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 32774, + "vendor_id": 3141 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [ + { + "from": { + "key_code": "left_command" + }, + "to": [ + { + "key_code": "left_option" + } + ] + }, + { + "from": { + "key_code": "left_option" + }, + "to": [ + { + "key_code": "left_command" + } + ] + } + ], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 29699, + "vendor_id": 3141 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [ + { + "from": { + "key_code": "left_command" + }, + "to": [ + { + "key_code": "left_option" + } + ] + }, + { + "from": { + "key_code": "left_option" + }, + "to": [ + { + "key_code": "left_command" + } + ] + } + ], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 29699, + "vendor_id": 3141 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 50504, + "vendor_id": 1133 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": false, + "is_pointing_device": true, + "product_id": 50504, + "vendor_id": 1133 + }, + "ignore": true, + "manipulate_caps_lock_led": false, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false + } + ], + "fn_function_keys": [ + { + "from": { + "key_code": "f1" + }, + "to": [ + { + "consumer_key_code": "display_brightness_decrement" + } + ] + }, + { + "from": { + "key_code": "f2" + }, + "to": [ + { + "consumer_key_code": "display_brightness_increment" + } + ] + }, + { + "from": { + "key_code": "f3" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "mission_control" + } + ] + }, + { + "from": { + "key_code": "f4" + }, + "to": [ + { + "apple_vendor_keyboard_key_code": "spotlight" + } + ] + }, + { + "from": { + "key_code": "f5" + }, + "to": [ + { + "consumer_key_code": "dictation" + } + ] + }, + { + "from": { + "key_code": "f6" + }, + "to": [ + { + "key_code": "f6" + } + ] + }, + { + "from": { + "key_code": "f7" + }, + "to": [ + { + "consumer_key_code": "rewind" + } + ] + }, + { + "from": { + "key_code": "f8" + }, + "to": [ + { + "consumer_key_code": "play_or_pause" + } + ] + }, + { + "from": { + "key_code": "f9" + }, + "to": [ + { + "consumer_key_code": "fast_forward" + } + ] + }, + { + "from": { + "key_code": "f10" + }, + "to": [ + { + "consumer_key_code": "mute" + } + ] + }, + { + "from": { + "key_code": "f11" + }, + "to": [ + { + "consumer_key_code": "volume_decrement" + } + ] + }, + { + "from": { + "key_code": "f12" + }, + "to": [ + { + "consumer_key_code": "volume_increment" + } + ] + } + ], + "name": "Default profile", + "parameters": { + "delay_milliseconds_before_open_device": 1000 + }, + "selected": true, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": [ + { + "key_code": "left_control" + } + ] + } + ], + "virtual_hid_keyboard": { + "country_code": 0, + "indicate_sticky_modifier_keys_state": true, + "mouse_key_xy_scale": 100 + } + } + ] +} \ No newline at end of file From b92370a8c09c6c141dd1ec79a64142d2df039886 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 27 Mar 2024 16:11:08 -0700 Subject: [PATCH 059/126] [vim] lir Return binding --- .gitconfig | 1 + .vim/lua/lir_setup.lua | 139 +++++++++++++++++++++++++------------------------ 2 files changed, 71 insertions(+), 69 deletions(-) diff --git a/.gitconfig b/.gitconfig index 4336734..5c45626 100644 --- a/.gitconfig +++ b/.gitconfig @@ -21,6 +21,7 @@ undo-last = reset HEAD^ unstage = restore --staged latest = branch --sort=committerdate + f = fetch origin main [diff] renamelimit = 0 diff --git a/.vim/lua/lir_setup.lua b/.vim/lua/lir_setup.lua index c1728bc..e559e37 100644 --- a/.vim/lua/lir_setup.lua +++ b/.vim/lua/lir_setup.lua @@ -3,85 +3,86 @@ local mark_actions = require 'lir.mark.actions' local clipboard_actions = require 'lir.clipboard.actions' require 'lir'.setup { - show_hidden_files = false, - ignore = { ".DS_Store" }, -- { ".DS_Store", "node_modules" } etc. - devicons = { - enable = true, - highlight_dirname = true - }, - mappings = { - ['l'] = actions.edit, - ['<C-s>'] = actions.split, - ['<C-v>'] = actions.vsplit, - ['<C-t>'] = actions.tabedit, + show_hidden_files = false, + ignore = { ".DS_Store" }, -- { ".DS_Store", "node_modules" } etc. + devicons = { + enable = true, + highlight_dirname = true + }, + mappings = { + ['l'] = actions.edit, + ['<CR>'] = actions.edit, + ['<C-s>'] = actions.split, + ['<C-v>'] = actions.vsplit, + ['<C-t>'] = actions.tabedit, - ['h'] = actions.up, - ['q'] = actions.quit, + ['h'] = actions.up, + ['q'] = actions.quit, - ['K'] = actions.mkdir, - ['N'] = actions.newfile, - ['R'] = actions.rename, - ['@'] = actions.cd, - ['Y'] = actions.yank_path, - ['.'] = actions.toggle_show_hidden, - ['D'] = actions.delete, + ['K'] = actions.mkdir, + ['N'] = actions.newfile, + ['R'] = actions.rename, + ['@'] = actions.cd, + ['Y'] = actions.yank_path, + ['.'] = actions.toggle_show_hidden, + ['D'] = actions.delete, - ['J'] = function() - mark_actions.toggle_mark() - vim.cmd('normal! j') - end, - ['C'] = clipboard_actions.copy, - ['X'] = clipboard_actions.cut, - ['P'] = clipboard_actions.paste, - }, - float = { - winblend = 0, - curdir_window = { - enable = false, - highlight_dirname = false - }, + ['J'] = function() + mark_actions.toggle_mark() + vim.cmd('normal! j') + end, + ['C'] = clipboard_actions.copy, + ['X'] = clipboard_actions.cut, + ['P'] = clipboard_actions.paste, + }, + float = { + winblend = 0, + curdir_window = { + enable = false, + highlight_dirname = false + }, - -- -- You can define a function that returns a table to be passed as the third - -- -- argument of nvim_open_win(). - -- win_opts = function() - -- local width = math.floor(vim.o.columns * 0.8) - -- local height = math.floor(vim.o.lines * 0.8) - -- return { - -- border = { - -- "+", "─", "+", "│", "+", "─", "+", "│", - -- }, - -- width = width, - -- height = height, - -- row = 1, - -- col = math.floor((vim.o.columns - width) / 2), - -- } - -- end, - }, - hide_cursor = true + -- -- You can define a function that returns a table to be passed as the third + -- -- argument of nvim_open_win(). + -- win_opts = function() + -- local width = math.floor(vim.o.columns * 0.8) + -- local height = math.floor(vim.o.lines * 0.8) + -- return { + -- border = { + -- "+", "─", "+", "│", "+", "─", "+", "│", + -- }, + -- width = width, + -- height = height, + -- row = 1, + -- col = math.floor((vim.o.columns - width) / 2), + -- } + -- end, + }, + hide_cursor = true } vim.api.nvim_create_autocmd({ 'FileType' }, { - pattern = { "lir" }, - callback = function() - -- use visual mode - vim.api.nvim_buf_set_keymap( - 0, - "x", - "J", - ':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>', - { noremap = true, silent = true } - ) + pattern = { "lir" }, + callback = function() + -- use visual mode + vim.api.nvim_buf_set_keymap( + 0, + "x", + "J", + ':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>', + { noremap = true, silent = true } + ) - -- echo cwd - -- vim.api.nvim_echo({ { vim.fn.expand("%:p"), "Normal" } }, false, {}) - end + -- echo cwd + -- vim.api.nvim_echo({ { vim.fn.expand("%:p"), "Normal" } }, false, {}) + end }) -- custom folder icon require 'nvim-web-devicons'.set_icon({ - lir_folder_icon = { - icon = "", - color = "#7ebae4", - name = "LirFolderNode" - } + lir_folder_icon = { + icon = "", + color = "#7ebae4", + name = "LirFolderNode" + } }) From 2d4d014056ebf84af0d05f541835de8b8d14c289 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 30 Mar 2024 17:41:16 -0700 Subject: [PATCH 060/126] [iosevka] update config and add gitignore for output --- .config/iosevka-build/.gitignore | 1 + .config/iosevka-build/private-build-plans.toml | 108 ++++++++++++++++++------- 2 files changed, 79 insertions(+), 30 deletions(-) create mode 100644 .config/iosevka-build/.gitignore diff --git a/.config/iosevka-build/.gitignore b/.config/iosevka-build/.gitignore new file mode 100644 index 0000000..849ddff --- /dev/null +++ b/.config/iosevka-build/.gitignore @@ -0,0 +1 @@ +dist/ diff --git a/.config/iosevka-build/private-build-plans.toml b/.config/iosevka-build/private-build-plans.toml index 067ace0..e65fe70 100644 --- a/.config/iosevka-build/private-build-plans.toml +++ b/.config/iosevka-build/private-build-plans.toml @@ -1,23 +1,22 @@ -# This is the build plan for my own custom fontface -# docker run -it -v $(pwd):/build avivace/iosevka-build contents::iosevka-berkeley - -[buildPlans.iosevka-berkeley] +[buildPlans.IosevkaBerkeley] family = "Iosevka Berkeley" -spacing = "fontconfig-mono" +spacing = "fixed" serifs = "sans" -no-cv-ss = true -no-ligation = true +noCvSs = true +exportGlyphNames = false -[buildPlans.iosevka-berkeley.variants.design] +[buildPlans.IosevkaBerkeley.variants.design] capital-g = "toothless-rounded-serifless-hooked" g = "double-storey" t = "flat-hook" -y = "straight-turn" -eszet = "sulzbacher-descending" -turn-v = "curly" -lower-lambda = "straight-turn" +y = "straight-turn-serifless" +eszet = "sulzbacher-descending-serifless" +capital-lambda = "curly-top-serifed" +lower-lambda = "tailed-turn" +lower-chi = "semi-chancery-straight" zero = "dotted" -four = "closed" +one = "no-base" +four = "closed-serifless" six = "open-contour" eight = "two-circles" asterisk = "hex-high" @@ -28,7 +27,7 @@ percent = "rings-continuous-slash" bar = "force-upright" question = "corner" -[buildPlans.iosevka-berkeley.variants.italic] +[buildPlans.IosevkaBerkeley.variants.italic] capital-a = "curly-serifless" capital-b = "standard-unilateral-serifed" capital-d = "standard-unilateral-serifed" @@ -36,38 +35,87 @@ capital-f = "top-left-serifed" capital-g = "toothed-serifless-hooked" capital-i = "short-serifed" capital-j = "serifed-both-sides" -capital-k = "curly-serifless" -capital-m = "flat-bottom" +capital-m = "flat-bottom-serifless" capital-p = "closed-motion-serifed" capital-q = "crossing-curly-tailed" -capital-r = "curly" +capital-r = "curly-serifless" capital-u = "tailed-motion-serifed" -capital-v = "curly" -capital-w = "curly" +capital-v = "curly-serifless" +capital-w = "curly-serifless" capital-x = "curly-serifless" capital-y = "curly-serifless" capital-z = "curly-serifless-with-horizontal-crossbar" a = "double-storey-tailed" d = "toothed-serifed" -f = "flat-hook" +f = "flat-hook-serifless" g = "single-storey-serifed" h = "straight-top-left-serifed" k = "curly-serifless" +m = "top-left-serifed" n = "straight-top-left-serifed" -p = "motion-serifed" -q = "straight-motion-serifed" -r = "top-serifed" +p = "eared-serifless" +q = "straight-serifless" u = "tailed-motion-serifed" -v = "curly" -w = "curly" +v = "curly-serifless" +w = "curly-serifless" x = "curly-serifless" -y = "cursive-motion-serifed" +y = "cursive-serifless" z = "curly-serifless-with-horizontal-crossbar" -one = "base-long-top-serif" -two = "straight-neck" -seven = "straight-crossbar" +one = "no-base-long-top-serif" +two = "straight-neck-serifless" +seven = "straight-serifless-crossbar" nine = "open-contour" paren = "normal" -[buildPlans.iosevka-berkeley.variants.oblique] +[buildPlans.IosevkaBerkeley.variants.oblique] paren = "normal" + +[buildPlans.IosevkaBerkeley.weights.ExtraLight] +shape = 200 +menu = 200 +css = 200 + +[buildPlans.IosevkaBerkeley.weights.Light] +shape = 300 +menu = 300 +css = 300 + +[buildPlans.IosevkaBerkeley.weights.Regular] +shape = 400 +menu = 400 +css = 400 + +[buildPlans.IosevkaBerkeley.weights.Medium] +shape = 500 +menu = 500 +css = 500 + +[buildPlans.IosevkaBerkeley.weights.SemiBold] +shape = 600 +menu = 600 +css = 600 + +[buildPlans.IosevkaBerkeley.weights.Bold] +shape = 700 +menu = 700 +css = 700 + +[buildPlans.IosevkaBerkeley.widths.Normal] +shape = 500 +menu = 5 +css = "normal" + +[buildPlans.IosevkaBerkeley.widths.Extended] +shape = 600 +menu = 7 +css = "expanded" + +[buildPlans.IosevkaBerkeley.widths.Condensed] +shape = 416 +menu = 3 +css = "condensed" + +[buildPlans.IosevkaBerkeley.widths.SemiCondensed] +shape = 456 +menu = 4 +css = "semi-condensed" From d498a4fd18a872f5f488fbb26787b0158543f361 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 2 Apr 2024 15:41:27 -0700 Subject: [PATCH 061/126] italic comments --- .vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.vimrc b/.vimrc index 7960ea1..b80a90d 100644 --- a/.vimrc +++ b/.vimrc @@ -375,6 +375,7 @@ syntax on "colorscheme baraknew "let g:codedark_conservative = 1 let g:codedark_null_background=1 +let g:codedark_italics=1 colorscheme codedark "colorscheme slate "colorscheme dante From 0984ac2838585ac357890f74d3ba26df209c358f Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 10 Apr 2024 18:00:44 -0700 Subject: [PATCH 062/126] [vim] lualine --- .vim/lua/lualine_setup.lua | 1 + .vim/nvim.lua | 31 +++++++++++++++++-------------- .vimrc | 5 +++-- .yarnrc | 2 +- 4 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 .vim/lua/lualine_setup.lua diff --git a/.vim/lua/lualine_setup.lua b/.vim/lua/lualine_setup.lua new file mode 100644 index 0000000..90e6db2 --- /dev/null +++ b/.vim/lua/lualine_setup.lua @@ -0,0 +1 @@ +require('lualine').setup() diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 0a15cfc..0dd841e 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -106,9 +106,11 @@ local function pyright_custom_diagnostic(a, params, client_id, c, config) vim.lsp.diagnostic.on_publish_diagnostics(a, params, client_id, c, config) end -nvim_lsp.pyright.setup({ on_attach = function(client, bufnr) - vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(pyright_custom_diagnostic, diagnostic_options) -end }) +nvim_lsp.pyright.setup({ + on_attach = function(client, bufnr) + vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(pyright_custom_diagnostic, diagnostic_options) + end +}) --nvim_lsp.pyright.setup({ on_attach = on_attach }) --nvim_lsp.pylsp.setup({ --on_attach = on_attach, @@ -387,17 +389,17 @@ require('trouble').setup { jump = { "o", "<tab>" }, -- jump to the diagnostic or open / close folds --open_split = { "<c-x>" }, -- open buffer in new split --open_vsplit = { "<c-v>" }, -- open buffer in new vsplit - open_tab = {}, -- open buffer in new tab - jump_close = { "<cr>" }, -- jump to the diagnostic and close the list - toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode - toggle_preview = "P", -- toggle auto_preview - hover = "K", -- opens a small popup with the full multiline message - preview = "p", -- preview the diagnostic location + open_tab = {}, -- open buffer in new tab + jump_close = { "<cr>" }, -- jump to the diagnostic and close the list + toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode + toggle_preview = "P", -- toggle auto_preview + hover = "K", -- opens a small popup with the full multiline message + preview = "p", -- preview the diagnostic location close_folds = { "zM", "zm" }, -- close all folds - open_folds = { "zR", "zr" }, -- open all folds + open_folds = { "zR", "zr" }, -- open all folds toggle_fold = { "zA", "za" }, -- toggle fold of current file - previous = "k", -- previous item - next = "j" -- next item + previous = "k", -- previous item + next = "j" -- next item }, } @@ -510,9 +512,9 @@ require 'nvim-treesitter.configs'.setup { "python", "query", "rust", - "svelte", "terraform", "toml", + "tsx", "typescript", "vim", "yaml", @@ -549,7 +551,7 @@ require 'nvim-treesitter.configs'.setup { playground = { enable = true, disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code persist_queries = false, -- Whether the query persists across vim sessions keybindings = { toggle_query_editor = 'o', @@ -668,3 +670,4 @@ end require("murdock") require("lir_setup") +require("lualine_setup") diff --git a/.vimrc b/.vimrc index b80a90d..52f07b8 100644 --- a/.vimrc +++ b/.vimrc @@ -143,8 +143,9 @@ Plug 'sjbach/lusty' "Plug 'w0rp/ale' "Plug 'airblade/vim-gitgutter' Plug 'mhinz/vim-signify' -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' +"Plug 'vim-airline/vim-airline' +"Plug 'vim-airline/vim-airline-themes' +Plug 'nvim-lualine/lualine.nvim' "Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } "Plug 'junegunn/fzf.vim' Plug 'airblade/vim-rooter' diff --git a/.yarnrc b/.yarnrc index c0c6531..ff3638e 100644 --- a/.yarnrc +++ b/.yarnrc @@ -2,5 +2,5 @@ # yarn lockfile v1 -lastUpdateCheck 1664156115452 +lastUpdateCheck 1711242871592 prefix "/home/barak/.yarn" From 508fd11964a0eb4fb1e0a1b849840bc5712d60f8 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Fri, 26 Apr 2024 17:58:55 -0700 Subject: [PATCH 063/126] [vim] lualine with lsp setup info --- .vim/lua/lualine_setup.lua | 26 +++++++++++++++++++++++++- .vimrc | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.vim/lua/lualine_setup.lua b/.vim/lua/lualine_setup.lua index 90e6db2..7f8b242 100644 --- a/.vim/lua/lualine_setup.lua +++ b/.vim/lua/lualine_setup.lua @@ -1 +1,25 @@ -require('lualine').setup() +require('lsp-progress').setup({ + +}) + +local config = { + sections = { + lualine_c = { + 'filename', + function() + return require('lsp-progress').progress() + end, + } + } +} + +--local function ins_left(component) +--table.insert(config.sections.lualine_c, component) +--end + +--ins_left({ +--'lsp_progress', +--display_components = { 'lsp_client_name', { 'percentage' } } +--}) + +require('lualine').setup(config) diff --git a/.vimrc b/.vimrc index 52f07b8..0d87859 100644 --- a/.vimrc +++ b/.vimrc @@ -146,6 +146,7 @@ Plug 'mhinz/vim-signify' "Plug 'vim-airline/vim-airline' "Plug 'vim-airline/vim-airline-themes' Plug 'nvim-lualine/lualine.nvim' +Plug 'linrongbin16/lsp-progress.nvim' "Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } "Plug 'junegunn/fzf.vim' Plug 'airblade/vim-rooter' From 6ff1cb0c04fe6420e5997ba49c6d951bcd50f7aa Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sun, 28 Apr 2024 11:46:33 -0700 Subject: [PATCH 064/126] [alacritty] semi-condensed --- .config/alacritty/alacritty.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index c228dcd..402633c 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -33,20 +33,20 @@ foreground = "#fffbf6" TERM = "xterm-256color" [font] -size = 19.0 +size = 20.0 [font.bold] -style = "Regular" +style = "Semi-Condensed" [font.bold_italic] -style = "Oblique" +style = "Semi-Condensed Italic" [font.italic] -style = "Light Oblique" +style = "Light Semi-Condensed Italic" [font.normal] family = "Iosevka Berkeley" -style = "Light" +style = "Light Semi-Condensed" [hints] alphabet = "jfkdls;ahgurieowpq" From 27cf792916e894d069fd9b75db376dc8f6c8e43f Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Tue, 14 May 2024 11:02:40 -0700 Subject: [PATCH 065/126] updates from oailaptop --- .gitignore | 1 + .vim/filetype.vim | 4 ++-- .vimrc | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b25c15b..93bfd12 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *~ +.DS_Store diff --git a/.vim/filetype.vim b/.vim/filetype.vim index f65b25b..48fb035 100644 --- a/.vim/filetype.vim +++ b/.vim/filetype.vim @@ -99,8 +99,8 @@ augroup go autocmd FileType go set softtabstop=2 autocmd FileType go set shiftwidth=2 autocmd FileType go set noexpandtab - autocmd FileType go imap <buffer> <silent> <Leader>ife <C-o>:GoIfErr<cr> - autocmd FileType go nmap <buffer> <silent> <Leader>ife :GoIfErr<cr> + autocmd FileType go imap <buffer> <silent> <Leader>rr <C-o>:GoIfErr<cr> + autocmd FileType go nmap <buffer> <silent> <Leader>rr :GoIfErr<cr> autocmd FileType go nnoremap <silent> <Leader>im <cmd>lua require('telescope').extensions.goimpl.goimpl{theme = "ivy", layout_config = {height = 10}}<cr> "autocmd FileType go nmap <Leader>gd <Plug>(go-doc) "autocmd FileType go nmap gd <Plug>(go-def) diff --git a/.vimrc b/.vimrc index 0d87859..3ba9369 100644 --- a/.vimrc +++ b/.vimrc @@ -124,6 +124,7 @@ Plug 'chrisbra/NrrwRgn' "Plug 'tpope/vim-fireplace', {'for': 'clojure'} ""Plug 'terryma/vim-multiple-cursors' "Plug 'ambv/black' +Plug 'kana/vim-textobj-user' " Plugins I wish I used more @@ -136,6 +137,7 @@ Plug 'tpope/vim-unimpaired' Plug 'b4winckler/vim-angry' Plug 'tpope/vim-surround' Plug 'junegunn/vim-easy-align' +Plug 'bps/vim-textobj-python' " Plugins I NEED Plug 'scrooloose/nerdcommenter' From 5e349c574c794a35be3aca7016a601f7c22982a3 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 15 May 2024 13:04:41 -0700 Subject: [PATCH 066/126] [tmux] catpuccin and status lines --- .config/alacritty/alacritty.toml | 11 +++-- .tmux.conf | 97 +++++++++++++++++++++++++++++++--------- .vim/lua/lualine_setup.lua | 3 ++ .vim/nvim.lua | 2 +- 4 files changed, 89 insertions(+), 24 deletions(-) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 402633c..e11bc79 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -33,20 +33,24 @@ foreground = "#fffbf6" TERM = "xterm-256color" [font] -size = 20.0 +size = 19.0 [font.bold] style = "Semi-Condensed" +#style = "Regular" [font.bold_italic] -style = "Semi-Condensed Italic" +style = "Semi-Condensed Oblique" +#style = "Italic" [font.italic] -style = "Light Semi-Condensed Italic" +style = "Light Semi-Condensed Oblique" +#style = "Light Italic" [font.normal] family = "Iosevka Berkeley" style = "Light Semi-Condensed" +#style = "Light" [hints] alphabet = "jfkdls;ahgurieowpq" @@ -112,6 +116,7 @@ multiplier = 3 [window] opacity = 0.88 startup_mode = "Windowed" +#decorations = "None" [window.dimensions] columns = 106 diff --git a/.tmux.conf b/.tmux.conf index 2b2a1ed..4d3f71c 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -37,37 +37,94 @@ bind -r L resize-pane -R 5 #bind | split-window -h #bind - split-window -v +bind-key h select-pane -L +bind-key k select-pane -U +bind-key j select-pane -D +bind-key l select-pane -R + +bind-key u break-pane +#bind-key sdf command-prompt -p "join pane from:" "join-pane -s '%%'" +bind-key y command-prompt -p "send pane to:" "join-pane -t :'%%' \; select-layout main-vertical" +bind-key Enter rotate-window + bind v split-window -h bind = select-layout even-horizontal bind | select-layout main-vertical bind-key C-t new-window "ttyd -R -d -t fontSize=18 tmux attach -t `tmux display -p '#S'`" # Status Bar -#set -g status-bg black +##set -g status-bg black set -g status-interval 1 -#set -g status-left '#[fg=green]#H#[default]' -#set -g status-right '#[fg=green]#(~/src/tpom/tpom) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]' -set -g status-justify centre # center align window list -set -g status-style fg=white,bg=default -set -g main-pane-width 68% +##set -g status-left '#[fg=green]#H#[default]' +##set -g status-right '#[fg=green]#(~/src/tpom/tpom) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]' +#set -g status-justify centre # center align window list +#set -g status-style fg=white,bg=default -# default window title colors -set-window-option -g window-status-style fg=white,bg=default,dim +## default window title colors +#set-window-option -g window-status-style fg=white,bg=default,dim -# active window title colors -set-window-option -g window-status-current-style fg=cyan,bg=default,bright +## active window title colors +#set -g main-pane-width 68% +#set-window-option -g window-status-current-style fg=cyan,bg=default,bright -set-window-option -g window-style fg=#aaaaaa,bg=terminal -set-window-option -g window-active-style fg=terminal,bg=terminal - -set -g status-left '#[fg=green][ #h ][' -set -g status-left-length 40 -set -g status-right '#[fg=green]][#(battery) #{pane_width}x#{pane_height} #[bright]#[fg=blue]%Y-%m-%d #[fg=white]%I:%M #[dim]#[fg=green]]' -set -g status-right-length 40 +#set-window-option -g window-style fg=#999999,bg=terminal +#set-window-option -g window-active-style fg=terminal,bg=terminal +#set -g status-left '#[fg=green][ #h ][' +#set -g status-left-length 40 +#set -g status-right '#[fg=green]][#(battery) #{pane_width}x#{pane_height} #[bright]#[fg=blue]%Y-%m-%d #[fg=white]%I:%M #[dim]#[fg=green]]' +#set -g status-right-length 40 +set-window-option -g window-status-activity-style none # Notifying if other windows has activities -setw -g monitor-activity on -set -g visual-activity on +set -g monitor-activity on +set -g visual-activity off +set -g visual-bell on +set -g bell-action none +set -g activity-action none # Highlighting the active window in status bar -setw -g window-status-current-style bg=red,bright +#setw -g window-status-current-style bg=red,bright +set -g @catppuccin_flavour 'mocha' # or frappe, macchiato, mocha + +set -g @catppuccin_window_status_enable "yes" +set -g @catppuccin_window_number_position "left" +set -g @catppuccin_window_left_separator "" +set -g @catppuccin_window_right_separator " " +set -g @catppuccin_window_middle_separator " " +set -g @catppuccin_window_connect_separator "yes" + +set -g @catppuccin_window_default_color "#{thm_gray}" +set -g @catppuccin_window_default_background "#{thm_green}" +set -g @catppuccin_window_default_fill "all" +set -g @catppuccin_window_default_text "#W" + +set -g @catppuccin_window_current_fill "all" +set -g @catppuccin_window_current_text "#W" +set -g @catppuccin_window_current_color "#{thm_blue}" +set -g @catppuccin_window_current_background "#{thm_bg}" + +set -g @catppuccin_icon_window_last "󰖰" +set -g @catppuccin_icon_window_current "󰫣" +set -g @catppuccin_icon_window_zoom "󰁌" +set -g @catppuccin_icon_window_mark "󰃀" +set -g @catppuccin_icon_window_silent "󰂛" +set -g @catppuccin_icon_window_activity "󱅫" +set -g @catppuccin_icon_window_bell "󰂞" + +set -g @catppuccin_status_modules_right "directory battery host date_time" +set -g @catppuccin_status_left_separator "" +set -g @catppuccin_status_right_separator "" +set -g @catppuccin_status_fill "icon" +set -g @catppuccin_status_connect_separator "yes" +set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M:%S" + +set -g @catppuccin_pane_status_enabled "yes" + + +set -g @catppuccin_directory_text "#{pane_current_path}" +set -g @plugin 'catppuccin/tmux' + + +set -g @plugin 'tmux-plugins/tmux-battery' +set -g @plugin 'tmux-plugins/tpm' +run -b '~/.tmux/plugins/tpm/tpm' diff --git a/.vim/lua/lualine_setup.lua b/.vim/lua/lualine_setup.lua index 7f8b242..b99cd3e 100644 --- a/.vim/lua/lualine_setup.lua +++ b/.vim/lua/lualine_setup.lua @@ -9,6 +9,9 @@ local config = { function() return require('lsp-progress').progress() end, + }, + lualine_x = { + 'filetype', } } } diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 0dd841e..e07e4e5 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -148,7 +148,7 @@ nvim_lsp.pyright.setup({ --} --}) ---nvim_lsp.clangd.setup({ on_attach = on_attach }) +nvim_lsp.clangd.setup({ on_attach = on_attach }) nvim_lsp.tsserver.setup { cmd = { "/home/barak/.yarn/bin/typescript-language-server", "--stdio" } } From d4f922dd95123667e53a3b9cde566e72b21e131e Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 15 May 2024 20:00:17 -0700 Subject: [PATCH 067/126] fix building tch-rs with rust-analyzer --- .vim/nvim.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index e07e4e5..272c22d 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -48,6 +48,11 @@ nvim_lsp.rust_analyzer.setup({ 'cargo', 'clippy', '--workspace', '--message-format=json', '--all-targets', '--all-features' } + }, + runnables = { + extraEnv = { + TORCH_CUDA_VERSION = "cu121", + } } } } From d4cfe9e64dd9be1f9ea5c4dd9c95ac476d185483 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 15 May 2024 20:01:50 -0700 Subject: [PATCH 068/126] add reminder --- .tmux.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/.tmux.conf b/.tmux.conf index 4d3f71c..7569c2e 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -128,3 +128,4 @@ set -g @plugin 'catppuccin/tmux' set -g @plugin 'tmux-plugins/tmux-battery' set -g @plugin 'tmux-plugins/tpm' run -b '~/.tmux/plugins/tpm/tpm' +# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm From 7aace26ee910f7e5d4def2d544aaddfd71372afb Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 15 May 2024 20:42:11 -0700 Subject: [PATCH 069/126] seconds and slower update --- .tmux.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 7569c2e..b3542e5 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -54,7 +54,7 @@ bind-key C-t new-window "ttyd -R -d -t fontSize=18 tmux attach -t `tmux display # Status Bar ##set -g status-bg black -set -g status-interval 1 +set -g status-interval 5 ##set -g status-left '#[fg=green]#H#[default]' ##set -g status-right '#[fg=green]#(~/src/tpom/tpom) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]' #set -g status-justify centre # center align window list @@ -116,7 +116,7 @@ set -g @catppuccin_status_left_separator "" set -g @catppuccin_status_right_separator "" set -g @catppuccin_status_fill "icon" set -g @catppuccin_status_connect_separator "yes" -set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M:%S" +set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M" set -g @catppuccin_pane_status_enabled "yes" From 99c753d335e4671cc40d9048f01ebacdace20bdb Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Wed, 15 May 2024 22:40:59 -0700 Subject: [PATCH 070/126] bake instructions in bin --- bin/rename_git_branch.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 bin/rename_git_branch.sh diff --git a/bin/rename_git_branch.sh b/bin/rename_git_branch.sh new file mode 100644 index 0000000..9eec62f --- /dev/null +++ b/bin/rename_git_branch.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +git checkout $1 +git branch -m $1 $2 +git fetch +git branch --unset-upstream +git branch -u origin/$2 From 9401989d52cc7a729d576e466742a5fdc778b1eb Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Fri, 17 May 2024 14:08:11 -0700 Subject: [PATCH 071/126] remove sym --- bin/obsidian | 1 - 1 file changed, 1 deletion(-) delete mode 120000 bin/obsidian diff --git a/bin/obsidian b/bin/obsidian deleted file mode 120000 index 6151d58..0000000 --- a/bin/obsidian +++ /dev/null @@ -1 +0,0 @@ -./appimage/obsidian.appimage \ No newline at end of file From b419ec8f9f6b3536576116c885cd48e954f60bbf Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 18 May 2024 18:18:40 -0700 Subject: [PATCH 072/126] converting to chezmoi --- bin/run_browser | 11 ----------- bin/run_jupyter.sh | 2 -- bin/run_terminal | 15 --------------- bin/run_zotero | 3 --- 4 files changed, 31 deletions(-) delete mode 100755 bin/run_browser delete mode 100755 bin/run_jupyter.sh delete mode 100755 bin/run_terminal delete mode 100755 bin/run_zotero diff --git a/bin/run_browser b/bin/run_browser deleted file mode 100755 index 15440ea..0000000 --- a/bin/run_browser +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -if [ -n "`which firefox`" ]; then - firefox -elif [ -n "`which iceweasel`" ]; then - iceweasel -elif [ -n "`which google-chrome`" ]; then - google-chrome -else - exit 1 -fi diff --git a/bin/run_jupyter.sh b/bin/run_jupyter.sh deleted file mode 100755 index d2adca5..0000000 --- a/bin/run_jupyter.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -docker run --rm -p 10000:8888 -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/home/jovyan jupyter/datascience-notebook diff --git a/bin/run_terminal b/bin/run_terminal deleted file mode 100755 index 94570a1..0000000 --- a/bin/run_terminal +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -if [ -n "`which alacritty`" ]; then - alacritty $@ -elif [ -n "`which terminator`" ]; then - terminator $@ -elif [ -n "`which gnome-terminal`" ]; then - gnome-terminal $@ -elif [ -n "`which xfce4-terminal`" ]; then - xfce4-terminal $@ -elif [ -n "`which urxvt`" ]; then - urxvt $@ -else - xterm $@ -fi diff --git a/bin/run_zotero b/bin/run_zotero deleted file mode 100755 index 55c0630..0000000 --- a/bin/run_zotero +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -tunnelwrap -i "$HOME/.ssh/id_ed25519" -p 2222 8082:docdav.dav.svc.k8s.barakmich.com:80 barak@barakmich.com "$HOME/local/Zotero_linux-x86_64/zotero" From e04f3e0fb85bb854664c54cb7cc87040ffa7396e Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 18 May 2024 18:26:23 -0700 Subject: [PATCH 073/126] chezmoi-ify --- bin/ack | 4985 ---------------------------------------------------- bin/average | 158 -- bin/battery | 132 -- bin/callout | 13 - bin/contract | 34 - bin/cronic | 48 - bin/gblame | 63 - bin/golintc | 22 - bin/orly | 119 -- bin/pk | 61 - bin/theyfightcrime | 35 - bin/vi | 8 - bin/xinput-toggle | 181 -- 13 files changed, 5859 deletions(-) delete mode 100755 bin/ack delete mode 100755 bin/average delete mode 100755 bin/battery delete mode 100755 bin/callout delete mode 100755 bin/contract delete mode 100755 bin/cronic delete mode 100755 bin/gblame delete mode 100755 bin/golintc delete mode 100755 bin/orly delete mode 100755 bin/pk delete mode 100755 bin/theyfightcrime delete mode 100755 bin/vi delete mode 100755 bin/xinput-toggle diff --git a/bin/ack b/bin/ack deleted file mode 100755 index 88faa74..0000000 --- a/bin/ack +++ /dev/null @@ -1,4985 +0,0 @@ -#!/usr/bin/env perl -# -# This file, ack, is generated code. -# Please DO NOT EDIT or send patches for it. -# -# Please take a look at the source from -# http://github.com/petdance/ack2 -# and submit patches against the individual files -# that build ack. -# - -package main; - -use strict; -use warnings; - -our $VERSION = '2.12'; # Check http://beyondgrep.com/ for updates - -use 5.008008; -use Getopt::Long 2.35 (); -use Carp 1.04 (); - - -# XXX Don't make this so brute force -# See also: https://github.com/petdance/ack2/issues/89 - -# These are all our globals. - -MAIN: { - $App::Ack::orig_program_name = $0; - $0 = join(' ', 'ack', $0); - if ( $App::Ack::VERSION ne $main::VERSION ) { - App::Ack::die( "Program/library version mismatch\n\t$0 is $main::VERSION\n\t$INC{'App/Ack.pm'} is $App::Ack::VERSION" ); - } - - # Do preliminary arg checking; - my $env_is_usable = 1; - for my $arg ( @ARGV ) { - last if ( $arg eq '--' ); - - # Get the --thpppt, --bar, --cathy checking out of the way. - $arg =~ /^--th[pt]+t+$/ and App::Ack::_thpppt($arg); - $arg eq '--bar' and App::Ack::_bar(); - $arg eq '--cathy' and App::Ack::_cathy(); - - # See if we want to ignore the environment. (Don't tell Al Gore.) - $arg eq '--env' and $env_is_usable = 1; - $arg eq '--noenv' and $env_is_usable = 0; - } - - if ( !$env_is_usable ) { - my @keys = ( 'ACKRC', grep { /^ACK_/ } keys %ENV ); - delete @ENV{@keys}; - } - load_colors(); - - Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); - Getopt::Long::Configure('pass_through', 'no_auto_abbrev'); - Getopt::Long::GetOptions( - 'help' => sub { App::Ack::show_help(); exit; }, - 'version' => sub { App::Ack::print_version_statement(); exit; }, - 'man' => sub { App::Ack::show_man(); exit; }, - ); - Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); - - if ( !@ARGV ) { - App::Ack::show_help(); - exit 1; - } - - main(); -} - -sub _compile_descend_filter { - my ( $opt ) = @_; - - my $idirs = $opt->{idirs}; - my $dont_ignore_dirs = $opt->{no_ignore_dirs}; - - # if we have one or more --noignore-dir directives, we can't ignore - # entire subdirectory hierarchies, so we return an "accept all" - # filter and scrutinize the files more in _compile_file_filter - return if $dont_ignore_dirs; - return unless $idirs && @{$idirs}; - - my %ignore_dirs; - - foreach my $idir (@{$idirs}) { - if ( $idir =~ /^(\w+):(.*)/ ) { - if ( $1 eq 'is') { - $ignore_dirs{$2} = 1; - } - else { - Carp::croak( 'Non-is filters are not yet supported for --ignore-dir' ); - } - } - else { - Carp::croak( qq{Invalid filter specification "$idir"} ); - } - } - - return sub { - return !exists $ignore_dirs{$_} && !exists $ignore_dirs{$File::Next::dir}; - }; -} - -sub _compile_file_filter { - my ( $opt, $start ) = @_; - - my $ifiles = $opt->{ifiles}; - $ifiles ||= []; - - my $ifiles_filters = App::Ack::Filter::Collection->new(); - - foreach my $filter_spec (@{$ifiles}) { - if ( $filter_spec =~ /^(\w+):(.+)/ ) { - my ($how,$what) = ($1,$2); - my $filter = App::Ack::Filter->create_filter($how, split(/,/, $what)); - $ifiles_filters->add($filter); - } - else { - Carp::croak( qq{Invalid filter specification "$filter_spec"} ); - } - } - - my $filters = $opt->{'filters'} || []; - my $direct_filters = App::Ack::Filter::Collection->new(); - my $inverse_filters = App::Ack::Filter::Collection->new(); - - foreach my $filter (@{$filters}) { - if ($filter->is_inverted()) { - # We want to check if files match the uninverted filters - $inverse_filters->add($filter->invert()); - } - else { - $direct_filters->add($filter); - } - } - - my %is_member_of_starting_set = map { (get_file_id($_) => 1) } @{$start}; - - my $ignore_dir_list = $opt->{idirs}; - my $dont_ignore_dir_list = $opt->{no_ignore_dirs}; - - my %ignore_dir_set; - my %dont_ignore_dir_set; - - foreach my $filter (@{ $ignore_dir_list }) { - if ( $filter =~ /^(\w+):(.*)/ ) { - if ( $1 eq 'is' ) { - $ignore_dir_set{ $2 } = 1; - } else { - Carp::croak( 'Non-is filters are not yet supported for --ignore-dir' ); - } - } else { - Carp::croak( qq{Invalid filter specification "$filter"} ); - } - } - foreach my $filter (@{ $dont_ignore_dir_list }) { - if ( $filter =~ /^(\w+):(.*)/ ) { - if ( $1 eq 'is' ) { - $dont_ignore_dir_set{ $2 } = 1; - } else { - Carp::croak( 'Non-is filters are not yet supported for --ignore-dir' ); - } - } else { - Carp::croak( qq{Invalid filter specification "$filter"} ); - } - } - - return sub { - # ack always selects files that are specified on the command - # line, regardless of filetype. If you want to ack a JPEG, - # and say "ack foo whatever.jpg" it will do it for you. - return 1 if $is_member_of_starting_set{ get_file_id($File::Next::name) }; - - if ( $dont_ignore_dir_list ) { - my ( undef, $dirname ) = File::Spec->splitpath($File::Next::name); - my @dirs = File::Spec->splitdir($dirname); - - my $is_ignoring = 0; - - foreach my $dir ( @dirs ) { - if ( $ignore_dir_set{ $dir } ) { - $is_ignoring = 1; - } - elsif ( $dont_ignore_dir_set{ $dir } ) { - $is_ignoring = 0; - } - } - if ( $is_ignoring ) { - return 0; - } - } - - # Ignore named pipes found in directory searching. Named - # pipes created by subprocesses get specified on the command - # line, so the rule of "always select whatever is on the - # command line" wins. - return 0 if -p $File::Next::name; - - # we can't handle unreadable filenames; report them - unless ( -r _ ) { - if ( $App::Ack::report_bad_filenames ) { - App::Ack::warn( "${File::Next::name}: cannot open file for reading" ); - } - return 0; - } - - my $resource = App::Ack::Resource::Basic->new($File::Next::name); - return 0 if ! $resource; - if ( $ifiles_filters->filter($resource) ) { - return 0; - } - - my $match_found = $direct_filters->filter($resource); - - # Don't bother invoking inverse filters unless we consider the current resource a match - if ( $match_found && $inverse_filters->filter( $resource ) ) { - $match_found = 0; - } - return $match_found; - }; -} - -sub show_types { - my $resource = shift; - my $ors = shift; - - my @types = filetypes( $resource ); - my $types = join( ',', @types ); - my $arrow = @types ? ' => ' : ' =>'; - App::Ack::print( $resource->name, $arrow, join( ',', @types ), $ors ); - - return; -} - -# Set default colors, load Term::ANSIColor -sub load_colors { - eval 'use Term::ANSIColor 1.10 ()'; - eval 'use Win32::Console::ANSI' if $App::Ack::is_windows; - - $ENV{ACK_COLOR_MATCH} ||= 'black on_yellow'; - $ENV{ACK_COLOR_FILENAME} ||= 'bold green'; - $ENV{ACK_COLOR_LINENO} ||= 'bold yellow'; - - return; -} - -sub filetypes { - my ( $resource ) = @_; - - my @matches; - - foreach my $k (keys %App::Ack::mappings) { - my $filters = $App::Ack::mappings{$k}; - - foreach my $filter (@{$filters}) { - # clone the resource - my $clone = $resource->clone; - if ( $filter->filter($clone) ) { - push @matches, $k; - last; - } - } - } - - # http://search.cpan.org/dist/Perl-Critic/lib/Perl/Critic/Policy/Subroutines/ProhibitReturnSort.pm - @matches = sort @matches; - return @matches; -} - -# Returns a (fairly) unique identifier for a file. -# Use this function to compare two files to see if they're -# equal (ie. the same file, but with a different path/links/etc). -sub get_file_id { - my ( $filename ) = @_; - - if ( $App::Ack::is_windows ) { - return File::Next::reslash( $filename ); - } - else { - # XXX is this the best method? it always hits the FS - if( my ( $dev, $inode ) = (stat($filename))[0, 1] ) { - return join(':', $dev, $inode); - } - else { - # XXX this could be better - return $filename; - } - } -} - -# Returns a regex object based on a string and command-line options. -# Dies when the regex $str is undefined (i.e. not given on command line). - -sub build_regex { - my $str = shift; - my $opt = shift; - - defined $str or App::Ack::die( 'No regular expression found.' ); - - $str = quotemeta( $str ) if $opt->{Q}; - if ( $opt->{w} ) { - $str = "\\b$str" if $str =~ /^\w/; - $str = "$str\\b" if $str =~ /\w$/; - } - - my $regex_is_lc = $str eq lc $str; - if ( $opt->{i} || ($opt->{smart_case} && $regex_is_lc) ) { - $str = "(?i)$str"; - } - - my $re = eval { qr/$str/ }; - if ( !$re ) { - die "Invalid regex '$str':\n $@"; - } - - return $re; - -} - -{ - -my @before_ctx_lines; -my @after_ctx_lines; -my $is_iterating; - -my $has_printed_something; - -BEGIN { - $has_printed_something = 0; -} - -sub print_matches_in_resource { - my ( $resource, $opt ) = @_; - - my $passthru = $opt->{passthru}; - my $max_count = $opt->{m} || -1; - my $nmatches = 0; - my $filename = $resource->name; - my $break = $opt->{break}; - my $heading = $opt->{heading}; - my $ors = $opt->{print0} ? "\0" : "\n"; - my $color = $opt->{color}; - my $print_filename = $opt->{show_filename}; - - my $has_printed_for_this_resource = 0; - - $is_iterating = 1; - - local $opt->{before_context} = $opt->{output} ? 0 : $opt->{before_context}; - local $opt->{after_context} = $opt->{output} ? 0 : $opt->{after_context}; - - my $n_before_ctx_lines = $opt->{before_context} || 0; - my $n_after_ctx_lines = $opt->{after_context} || 0; - - @after_ctx_lines = @before_ctx_lines = (); - - my $fh = $resource->open(); - if ( !$fh ) { - if ( $App::Ack::report_bad_filenames ) { - App::Ack::warn( "$filename: $!" ); - } - return 0; - } - - my $display_filename = $filename; - if ( $print_filename && $heading && $color ) { - $display_filename = Term::ANSIColor::colored($display_filename, $ENV{ACK_COLOR_FILENAME}); - } - - # check for context before the main loop, so we don't - # pay for it if we don't need it - if ( $n_before_ctx_lines || $n_after_ctx_lines ) { - my $current_line = <$fh>; # prime the first line of input - - while ( defined $current_line ) { - while ( (@after_ctx_lines < $n_after_ctx_lines) && defined($_ = <$fh>) ) { - push @after_ctx_lines, $_; - } - - local $_ = $current_line; - my $former_dot_period = $.; - $. -= @after_ctx_lines; - - if ( does_match($opt, $_) ) { - if ( !$has_printed_for_this_resource ) { - if ( $break && $has_printed_something ) { - App::Ack::print_blank_line(); - } - if ( $print_filename && $heading ) { - App::Ack::print_filename( $display_filename, $ors ); - } - } - print_line_with_context($opt, $filename, $_, $.); - $has_printed_for_this_resource = 1; - $nmatches++; - $max_count--; - } - elsif ( $passthru ) { - chomp; # XXX proper newline handling? - # XXX inline this call? - if ( $break && !$has_printed_for_this_resource && $has_printed_something ) { - App::Ack::print_blank_line(); - } - print_line_with_options($opt, $filename, $_, $., ':'); - $has_printed_for_this_resource = 1; - } - last unless $max_count != 0; - - # I tried doing this with local(), but for some reason, - # $. continued to have its new value after the exit of the - # enclosing block. I'm guessing that $. has some extra - # magic associated with it or something. If someone can - # tell me why this happened, I would love to know! - $. = $former_dot_period; # XXX this won't happen on an exception - - if ( $n_before_ctx_lines ) { - push @before_ctx_lines, $current_line; - shift @before_ctx_lines while @before_ctx_lines > $n_before_ctx_lines; - } - if ( $n_after_ctx_lines ) { - $current_line = shift @after_ctx_lines; - } - else { - $current_line = <$fh>; - } - } - } - else { - local $_; - - while ( <$fh> ) { - if ( does_match($opt, $_) ) { - if ( !$has_printed_for_this_resource ) { - if ( $break && $has_printed_something ) { - App::Ack::print_blank_line(); - } - if ( $print_filename && $heading ) { - App::Ack::print_filename( $display_filename, $ors ); - } - } - print_line_with_context($opt, $filename, $_, $.); - $has_printed_for_this_resource = 1; - $nmatches++; - $max_count--; - } - elsif ( $passthru ) { - chomp; # XXX proper newline handling? - if ( $break && !$has_printed_for_this_resource && $has_printed_something ) { - App::Ack::print_blank_line(); - } - print_line_with_options($opt, $filename, $_, $., ':'); - $has_printed_for_this_resource = 1; - } - last unless $max_count != 0; - } - } - - $is_iterating = 0; # XXX this won't happen on an exception - # then again, do we care? ack doesn't really - # handle exceptions anyway. - - return $nmatches; -} - -sub print_line_with_options { - my ( $opt, $filename, $line, $line_no, $separator ) = @_; - - $has_printed_something = 1; - - my $print_filename = $opt->{show_filename}; - my $print_column = $opt->{column}; - my $ors = $opt->{print0} ? "\0" : "\n"; - my $heading = $opt->{heading}; - my $output_expr = $opt->{output}; - my $color = $opt->{color}; - - my @line_parts; - - if( $color ) { - $filename = Term::ANSIColor::colored($filename, - $ENV{ACK_COLOR_FILENAME}); - $line_no = Term::ANSIColor::colored($line_no, - $ENV{ACK_COLOR_LINENO}); - } - - if($print_filename) { - if( $heading ) { - push @line_parts, $line_no; - } - else { - push @line_parts, $filename, $line_no; - } - - if( $print_column ) { - push @line_parts, get_match_column(); - } - } - if( $output_expr ) { - while ( $line =~ /$opt->{regex}/og ) { - my $output = eval $output_expr; - App::Ack::print( join( $separator, @line_parts, $output ), $ors ); - } - } - else { - if ( $color ) { - $line =~ /$opt->{regex}/o; # this match is redundant, but we need - # to perfom it in order to get if - # capture groups are set - - if ( @+ > 1 ) { # if we have captures - while ( $line =~ /$opt->{regex}/og ) { - my $offset = 0; # additional offset for when we add stuff - my $previous_match_end = 0; - - for ( my $i = 1; $i < @+; $i++ ) { - my ( $match_start, $match_end ) = ( $-[$i], $+[$i] ); - - next unless defined($match_start); - next if $match_start < $previous_match_end; - - my $substring = substr( $line, - $offset + $match_start, $match_end - $match_start ); - my $substitution = Term::ANSIColor::colored( $substring, - $ENV{ACK_COLOR_MATCH} ); - - substr( $line, $offset + $match_start, - $match_end - $match_start, $substitution ); - - $previous_match_end = $match_end; # offsets do not need to be applied - $offset += length( $substitution ) - length( $substring ); - } - - pos($line) = $+[0] + $offset; - } - } - else { - my $matched = 0; # flag; if matched, need to escape afterwards - - while ( $line =~ /$opt->{regex}/og ) { - - $matched = 1; - my ( $match_start, $match_end ) = ($-[0], $+[0]); - next unless defined($match_start); - - my $substring = substr( $line, $match_start, - $match_end - $match_start ); - my $substitution = Term::ANSIColor::colored( $substring, - $ENV{ACK_COLOR_MATCH} ); - - substr( $line, $match_start, $match_end - $match_start, - $substitution ); - - pos($line) = $match_end + - (length( $substitution ) - length( $substring )); - } - # XXX why do we do this? - $line .= "\033[0m\033[K" if $matched; - } - } - - push @line_parts, $line; - App::Ack::print( join( $separator, @line_parts ), $ors ); - } - - return; -} - -sub iterate { - my ( $resource, $opt, $cb ) = @_; - - $is_iterating = 1; - - local $opt->{before_context} = $opt->{output} ? 0 : $opt->{before_context}; - local $opt->{after_context} = $opt->{output} ? 0 : $opt->{after_context}; - - my $n_before_ctx_lines = $opt->{before_context} || 0; - my $n_after_ctx_lines = $opt->{after_context} || 0; - - @after_ctx_lines = @before_ctx_lines = (); - - my $fh = $resource->open(); - if ( !$fh ) { - if ( $App::Ack::report_bad_filenames ) { - # XXX direct access to filename - App::Ack::warn( "$resource->{filename}: $!" ); - } - return; - } - - # check for context before the main loop, so we don't - # pay for it if we don't need it - if ( $n_before_ctx_lines || $n_after_ctx_lines ) { - my $current_line = <$fh>; # prime the first line of input - - while ( defined $current_line ) { - while ( (@after_ctx_lines < $n_after_ctx_lines) && defined($_ = <$fh>) ) { - push @after_ctx_lines, $_; - } - - local $_ = $current_line; - my $former_dot_period = $.; - $. -= @after_ctx_lines; - - last unless $cb->(); - - # I tried doing this with local(), but for some reason, - # $. continued to have its new value after the exit of the - # enclosing block. I'm guessing that $. has some extra - # magic associated with it or something. If someone can - # tell me why this happened, I would love to know! - $. = $former_dot_period; # XXX this won't happen on an exception - - if ( $n_before_ctx_lines ) { - push @before_ctx_lines, $current_line; - shift @before_ctx_lines while @before_ctx_lines > $n_before_ctx_lines; - } - if ( $n_after_ctx_lines ) { - $current_line = shift @after_ctx_lines; - } - else { - $current_line = <$fh>; - } - } - } - else { - local $_; - - while ( <$fh> ) { - last unless $cb->(); - } - } - - $is_iterating = 0; # XXX this won't happen on an exception - # then again, do we care? ack doesn't really - # handle exceptions anyway. - - return; -} - -sub get_context { - if ( not $is_iterating ) { - Carp::croak( 'get_context() called outside of iterate()' ); - } - - return ( - scalar(@before_ctx_lines) ? \@before_ctx_lines : undef, - scalar(@after_ctx_lines) ? \@after_ctx_lines : undef, - ); -} - -} - -{ - -my $is_first_match; -my $previous_file_processed; -my $previous_line_printed; - -BEGIN { - $is_first_match = 1; - $previous_line_printed = -1; -} - -sub print_line_with_context { - my ( $opt, $filename, $matching_line, $line_no ) = @_; - - my $heading = $opt->{heading}; - - if( !defined($previous_file_processed) || - $previous_file_processed ne $filename ) { - $previous_file_processed = $filename; - $previous_line_printed = -1; - - if( $heading ) { - $is_first_match = 1; - } - } - - my $ors = $opt->{print0} ? "\0" : "\n"; - my $match_word = $opt->{w}; - my $is_tracking_context = $opt->{after_context} || $opt->{before_context}; - my $output_expr = $opt->{output}; - - $matching_line =~ s/[\r\n]+$//g; - - my ( $before_context, $after_context ) = get_context(); - - if ( $before_context ) { - my $first_line = $. - @{$before_context}; - - if ( $first_line <= $previous_line_printed ) { - splice @{$before_context}, 0, $previous_line_printed - $first_line + 1; - $first_line = $. - @{$before_context}; - } - if ( @{$before_context} ) { - my $offset = @{$before_context}; - - if( !$is_first_match && $previous_line_printed != $first_line - 1 ) { - App::Ack::print('--', $ors); - } - foreach my $line (@{$before_context}) { - my $context_line_no = $. - $offset; - if ( $context_line_no <= $previous_line_printed ) { - next; - } - - chomp $line; - local $opt->{column}; - - print_line_with_options($opt, $filename, $line, $context_line_no, '-'); - $previous_line_printed = $context_line_no; - $offset--; - } - } - } - - if ( $. > $previous_line_printed ) { - if( $is_tracking_context && !$is_first_match && $previous_line_printed != $. - 1 ) { - App::Ack::print('--', $ors); - } - - print_line_with_options($opt, $filename, $matching_line, $line_no, ':'); - $previous_line_printed = $.; - } - - if($after_context) { - my $offset = 1; - foreach my $line (@{$after_context}) { - # XXX improve this! - if ( $previous_line_printed >= $. + $offset ) { - $offset++; - next; - } - chomp $line; - - if ( $opt->{regex} && does_match( $opt, $line ) ) { - print_line_with_options($opt, $filename, $line, $. + $offset, ':'); - } - else { - local $opt->{column}; - print_line_with_options($opt, $filename, $line, $. + $offset, '-'); - } - $previous_line_printed = $. + $offset; - $offset++; - } - } - - $is_first_match = 0; - - return; -} - -} - -{ - -my $match_column_number; - -# does_match() MUST have an $opt->{regex} set. - -sub does_match { - my ( $opt, $line ) = @_; - - $match_column_number = undef; - - if ( $opt->{v} ) { - return ( $line !~ /$opt->{regex}/o ); - } - else { - if ( $line =~ /$opt->{regex}/o ) { - # @- = @LAST_MATCH_START - # @+ = @LAST_MATCH_END - $match_column_number = $-[0] + 1; - return 1; - } - else { - return; - } - } -} - -sub get_match_column { - return $match_column_number; -} - -} - -sub resource_has_match { - my ( $resource, $opt ) = @_; - - my $has_match = 0; - my $fh = $resource->open(); - if ( !$fh ) { - if ( $App::Ack::report_bad_filenames ) { - # XXX direct access to filename - App::Ack::warn( "$resource->{filename}: $!" ); - } - } - else { - my $opt_v = $opt->{v}; - my $re = $opt->{regex}; - while ( <$fh> ) { - if (/$re/o xor $opt_v) { - $has_match = 1; - last; - } - } - close $fh; - } - - return $has_match; -} - -sub count_matches_in_resource { - my ( $resource, $opt ) = @_; - - my $nmatches = 0; - my $fh = $resource->open(); - if ( !$fh ) { - if ( $App::Ack::report_bad_filenames ) { - # XXX direct access to filename - App::Ack::warn( "$resource->{filename}: $!" ); - } - } - else { - my $opt_v = $opt->{v}; - my $re = $opt->{regex}; - while ( <$fh> ) { - ++$nmatches if (/$re/o xor $opt_v); - } - close $fh; - } - - return $nmatches; -} - -sub main { - my @arg_sources = App::Ack::ConfigLoader::retrieve_arg_sources(); - - my $opt = App::Ack::ConfigLoader::process_args( @arg_sources ); - - $App::Ack::report_bad_filenames = !$opt->{dont_report_bad_filenames}; - - if ( $opt->{flush} ) { - $| = 1; - } - - if ( !defined($opt->{color}) && !$opt->{g} ) { - my $windows_color = 1; - if ( $App::Ack::is_windows ) { - $windows_color = eval { require Win32::Console::ANSI; } - } - $opt->{color} = !App::Ack::output_to_pipe() && $windows_color; - } - if ( not defined $opt->{heading} and not defined $opt->{break} ) { - $opt->{heading} = $opt->{break} = !App::Ack::output_to_pipe(); - } - - if ( defined($opt->{H}) || defined($opt->{h}) ) { - $opt->{show_filename}= $opt->{H} && !$opt->{h}; - } - - if ( my $output = $opt->{output} ) { - $output =~ s{\\}{\\\\}g; - $output =~ s{"}{\\"}g; - $opt->{output} = qq{"$output"}; - } - - my $resources; - if ( $App::Ack::is_filter_mode && !$opt->{files_from} ) { # probably -x - $resources = App::Ack::Resources->from_stdin( $opt ); - my $regex = $opt->{regex}; - $regex = shift @ARGV if not defined $regex; - $opt->{regex} = build_regex( $regex, $opt ); - } - else { - if ( $opt->{f} || $opt->{lines} ) { - if ( $opt->{regex} ) { - App::Ack::warn( "regex ($opt->{regex}) specified with -f or --lines" ); - App::Ack::exit_from_ack( 0 ); # XXX the 0 is misleading - } - } - else { - my $regex = $opt->{regex}; - $regex = shift @ARGV if not defined $regex; - $opt->{regex} = build_regex( $regex, $opt ); - } - my @start; - if ( not defined $opt->{files_from} ) { - @start = @ARGV; - } - if ( !exists($opt->{show_filename}) ) { - unless(@start == 1 && !(-d $start[0])) { - $opt->{show_filename} = 1; - } - } - - if ( defined $opt->{files_from} ) { - $resources = App::Ack::Resources->from_file( $opt, $opt->{files_from} ); - exit 1 unless $resources; - } - else { - @start = ('.') unless @start; - foreach my $target (@start) { - if ( !-e $target && $App::Ack::report_bad_filenames) { - App::Ack::warn( "$target: No such file or directory" ); - } - } - - $opt->{file_filter} = _compile_file_filter($opt, \@start); - $opt->{descend_filter} = _compile_descend_filter($opt); - - $resources = App::Ack::Resources->from_argv( $opt, \@start ); - } - } - App::Ack::set_up_pager( $opt->{pager} ) if defined $opt->{pager}; - - my $print_filenames = $opt->{show_filename}; - my $max_count = $opt->{m}; - my $ors = $opt->{print0} ? "\0" : "\n"; - my $only_first = $opt->{1}; - - my $nmatches = 0; - my $total_count = 0; -RESOURCES: - while ( my $resource = $resources->next ) { - # XXX this variable name combined with what we're trying - # to do makes no sense. - - # XXX Combine the -f and -g functions - if ( $opt->{f} ) { - # XXX printing should probably happen inside of App::Ack - if ( $opt->{show_types} ) { - show_types( $resource, $ors ); - } - else { - App::Ack::print( $resource->name, $ors ); - } - ++$nmatches; - last RESOURCES if defined($max_count) && $nmatches >= $max_count; - } - elsif ( $opt->{g} ) { - my $is_match = ( $resource->name =~ /$opt->{regex}/o ); - if ( $opt->{v} ? !$is_match : $is_match ) { - if ( $opt->{show_types} ) { - show_types( $resource, $ors ); - } - else { - local $opt->{show_filename} = 0; - - print_line_with_options($opt, '', $resource->name, 0, $ors); - } - ++$nmatches; - last RESOURCES if defined($max_count) && $nmatches >= $max_count; - } - } - elsif ( $opt->{lines} ) { - my $print_filename = $opt->{show_filename}; - my $passthru = $opt->{passthru}; - - my %line_numbers; - foreach my $line ( @{ $opt->{lines} } ) { - my @lines = split /,/, $line; - @lines = map { - /^(\d+)-(\d+)$/ - ? ( $1 .. $2 ) - : $_ - } @lines; - @line_numbers{@lines} = (1) x @lines; - } - - my $filename = $resource->name; - - local $opt->{color} = 0; - - iterate($resource, $opt, sub { - chomp; - - if ( $line_numbers{$.} ) { - print_line_with_context($opt, $filename, $_, $.); - } - elsif ( $passthru ) { - print_line_with_options($opt, $filename, $_, $., ':'); - } - return 1; - }); - } - elsif ( $opt->{count} ) { - my $matches_for_this_file = count_matches_in_resource( $resource, $opt ); - - unless ( $opt->{show_filename} ) { - $total_count += $matches_for_this_file; - next RESOURCES; - } - - if ( !$opt->{l} || $matches_for_this_file > 0) { - if ( $print_filenames ) { - App::Ack::print( $resource->name, ':', $matches_for_this_file, $ors ); - } - else { - App::Ack::print( $matches_for_this_file, $ors ); - } - } - } - elsif ( $opt->{l} || $opt->{L} ) { - my $is_match = resource_has_match( $resource, $opt ); - - if ( $opt->{L} ? !$is_match : $is_match ) { - App::Ack::print( $resource->name, $ors ); - ++$nmatches; - - last RESOURCES if $only_first; - last RESOURCES if defined($max_count) && $nmatches >= $max_count; - } - } - else { - $nmatches += print_matches_in_resource( $resource, $opt ); - if ( $nmatches && $only_first ) { - last RESOURCES; - } - } - } - - if ( $opt->{count} && !$opt->{show_filename} ) { - App::Ack::print( $total_count, "\n" ); - } - - close $App::Ack::fh; - App::Ack::exit_from_ack( $nmatches ); -} - - - -=head1 NAME - -ack - grep-like text finder - -=head1 SYNOPSIS - - ack [options] PATTERN [FILE...] - ack -f [options] [DIRECTORY...] - -=head1 DESCRIPTION - -Ack is designed as a replacement for 99% of the uses of F<grep>. - -Ack searches the named input FILEs (or standard input if no files -are named, or the file name - is given) for lines containing a match -to the given PATTERN. By default, ack prints the matching lines. - -PATTERN is a Perl regular expression. Perl regular expressions -are commonly found in other programming languages, but for the particulars -of their behavior, please consult -L<http://perldoc.perl.org/perlreref.html|perlreref>. If you don't know -how to use regular expression but are interested in learning, you may -consult L<http://perldoc.perl.org/perlretut.html|perlretut>. If you do not -need or want ack to use regular expressions, please see the -C<-Q>/C<--literal> option. - -Ack can also list files that would be searched, without actually -searching them, to let you take advantage of ack's file-type filtering -capabilities. - -=head1 FILE SELECTION - -If files are not specified for searching, either on the command -line or piped in with the C<-x> option, I<ack> delves into -subdirectories selecting files for searching. - -I<ack> is intelligent about the files it searches. It knows about -certain file types, based on both the extension on the file and, -in some cases, the contents of the file. These selections can be -made with the B<--type> option. - -With no file selection, I<ack> searches through regular files that -are not explicitly excluded by B<--ignore-dir> and B<--ignore-file> -options, either present in F<ackrc> files or on the command line. - -The default options for I<ack> ignore certain files and directories. These -include: - -=over 4 - -=item * Backup files: Files matching F<#*#> or ending with F<~>. - -=item * Coredumps: Files matching F<core.\d+> - -=item * Version control directories like F<.svn> and F<.git>. - -=back - -Run I<ack> with the C<--dump> option to see what settings are set. - -However, I<ack> always searches the files given on the command line, -no matter what type. If you tell I<ack> to search in a coredump, -it will search in a coredump. - -=head1 DIRECTORY SELECTION - -I<ack> descends through the directory tree of the starting directories -specified. If no directories are specified, the current working directory is -used. However, it will ignore the shadow directories used by -many version control systems, and the build directories used by the -Perl MakeMaker system. You may add or remove a directory from this -list with the B<--[no]ignore-dir> option. The option may be repeated -to add/remove multiple directories from the ignore list. - -For a complete list of directories that do not get searched, run -C<ack --dump>. - -=head1 WHEN TO USE GREP - -I<ack> trumps I<grep> as an everyday tool 99% of the time, but don't -throw I<grep> away, because there are times you'll still need it. - -E.g., searching through huge files looking for regexes that can be -expressed with I<grep> syntax should be quicker with I<grep>. - -If your script or parent program uses I<grep> C<--quiet> or C<--silent> -or needs exit 2 on IO error, use I<grep>. - -=head1 OPTIONS - -=over 4 - -=item B<--ackrc> - -Specifies an ackrc file to load after all others; see L</"ACKRC LOCATION SEMANTICS">. - -=item B<-A I<NUM>>, B<--after-context=I<NUM>> - -Print I<NUM> lines of trailing context after matching lines. - -=item B<-B I<NUM>>, B<--before-context=I<NUM>> - -Print I<NUM> lines of leading context before matching lines. - -=item B<--[no]break> - -Print a break between results from different files. On by default -when used interactively. - -=item B<-C [I<NUM>]>, B<--context[=I<NUM>]> - -Print I<NUM> lines (default 2) of context around matching lines. - -=item B<-c>, B<--count> - -Suppress normal output; instead print a count of matching lines for -each input file. If B<-l> is in effect, it will only show the -number of lines for each file that has lines matching. Without -B<-l>, some line counts may be zeroes. - -If combined with B<-h> (B<--no-filename>) ack outputs only one total -count. - -=item B<--[no]color>, B<--[no]colour> - -B<--color> highlights the matching text. B<--nocolor> suppresses -the color. This is on by default unless the output is redirected. - -On Windows, this option is off by default unless the -L<Win32::Console::ANSI> module is installed or the C<ACK_PAGER_COLOR> -environment variable is used. - -=item B<--color-filename=I<color>> - -Sets the color to be used for filenames. - -=item B<--color-match=I<color>> - -Sets the color to be used for matches. - -=item B<--color-lineno=I<color>> - -Sets the color to be used for line numbers. - -=item B<--[no]column> - -Show the column number of the first match. This is helpful for -editors that can place your cursor at a given position. - -=item B<--create-ackrc> - -Dumps the default ack options to standard output. This is useful for -when you want to customize the defaults. - -=item B<--dump> - -Writes the list of options loaded and where they came from to standard -output. Handy for debugging. - -=item B<--[no]env> - -B<--noenv> disables all environment processing. No F<.ackrc> is -read and all environment variables are ignored. By default, F<ack> -considers F<.ackrc> and settings in the environment. - -=item B<--flush> - -B<--flush> flushes output immediately. This is off by default -unless ack is running interactively (when output goes to a pipe or -file). - -=item B<-f> - -Only print the files that would be searched, without actually doing -any searching. PATTERN must not be specified, or it will be taken -as a path to search. - -=item B<--files-from=I<FILE>> - -The list of files to be searched is specified in I<FILE>. The list of -files are separated by newlines. If I<FILE> is C<->, the list is loaded -from standard input. - -=item B<--[no]filter> - -Forces ack to act as if it were receiving input via a pipe. - -=item B<--[no]follow> - -Follow or don't follow symlinks, other than whatever starting files -or directories were specified on the command line. - -This is off by default. - -=item B<-g I<PATTERN>> - -Print files where the relative path + filename matches I<PATTERN>. -This option can be combined with B<--color> to make it easier to spot -the match. - -=item B<--[no]group> - -B<--group> groups matches by file name. This is the default -when used interactively. - -B<--nogroup> prints one result per line, like grep. This is the -default when output is redirected. - -=item B<-H>, B<--with-filename> - -Print the filename for each match. This is the default unless searching -a single explicitly specified file. - -=item B<-h>, B<--no-filename> - -Suppress the prefixing of filenames on output when multiple files are -searched. - -=item B<--[no]heading> - -Print a filename heading above each file's results. This is the default -when used interactively. - -=item B<--help>, B<-?> - -Print a short help statement. - -=item B<--help-types>, B<--help=types> - -Print all known types. - -=item B<-i>, B<--ignore-case> - -Ignore case distinctions in PATTERN - -=item B<--ignore-ack-defaults> - -Tells ack to completely ignore the default definitions provided with ack. -This is useful in combination with B<--create-ackrc> if you I<really> want -to customize ack. - -=item B<--[no]ignore-dir=I<DIRNAME>>, B<--[no]ignore-directory=I<DIRNAME>> - -Ignore directory (as CVS, .svn, etc are ignored). May be used -multiple times to ignore multiple directories. For example, mason -users may wish to include B<--ignore-dir=data>. The B<--noignore-dir> -option allows users to search directories which would normally be -ignored (perhaps to research the contents of F<.svn/props> directories). - -The I<DIRNAME> must always be a simple directory name. Nested -directories like F<foo/bar> are NOT supported. You would need to -specify B<--ignore-dir=foo> and then no files from any foo directory -are taken into account by ack unless given explicitly on the command -line. - -=item B<--ignore-file=I<FILTERTYPE:FILTERARGS>> - -Ignore files matching I<FILTERTYPE:FILTERARGS>. The filters are specified -identically to file type filters as seen in L</"Defining your own types">. - -=item B<-k>, B<--known-types> - -Limit selected files to those with types that ack knows about. This is -equivalent to the default behavior found in ack 1. - -=item B<--lines=I<NUM>> - -Only print line I<NUM> of each file. Multiple lines can be given with multiple -B<--lines> options or as a comma separated list (B<--lines=3,5,7>). B<--lines=4-7> -also works. The lines are always output in ascending order, no matter the -order given on the command line. - -=item B<-l>, B<--files-with-matches> - -Only print the filenames of matching files, instead of the matching text. - -=item B<-L>, B<--files-without-matches> - -Only print the filenames of files that do I<NOT> match. - -=item B<--match I<PATTERN>> - -Specify the I<PATTERN> explicitly. This is helpful if you don't want to put the -regex as your first argument, e.g. when executing multiple searches over the -same set of files. - - # search for foo and bar in given files - ack file1 t/file* --match foo - ack file1 t/file* --match bar - -=item B<-m=I<NUM>>, B<--max-count=I<NUM>> - -Stop reading a file after I<NUM> matches. - -=item B<--man> - -Print this manual page. - -=item B<-n>, B<--no-recurse> - -No descending into subdirectories. - -=item B<-o> - -Show only the part of each line matching PATTERN (turns off text -highlighting) - -=item B<--output=I<expr>> - -Output the evaluation of I<expr> for each line (turns off text -highlighting) -If PATTERN matches more than once then a line is output for each non-overlapping match. -For more information please see the section L</"Examples of F<--output>">. - -=item B<--pager=I<program>>, B<--nopager> - -B<--pager> directs ack's output through I<program>. This can also be specified -via the C<ACK_PAGER> and C<ACK_PAGER_COLOR> environment variables. - -Using --pager does not suppress grouping and coloring like piping -output on the command-line does. - -B<--nopager> cancels any setting in ~/.ackrc, C<ACK_PAGER> or C<ACK_PAGER_COLOR>. -No output will be sent through a pager. - -=item B<--passthru> - -Prints all lines, whether or not they match the expression. Highlighting -will still work, though, so it can be used to highlight matches while -still seeing the entire file, as in: - - # Watch a log file, and highlight a certain IP address - $ tail -f ~/access.log | ack --passthru 123.45.67.89 - -=item B<--print0> - -Only works in conjunction with -f, -g, -l or -c (filename output). The filenames -are output separated with a null byte instead of the usual newline. This is -helpful when dealing with filenames that contain whitespace, e.g. - - # remove all files of type html - ack -f --html --print0 | xargs -0 rm -f - -=item B<-Q>, B<--literal> - -Quote all metacharacters in PATTERN, it is treated as a literal. - -=item B<-r>, B<-R>, B<--recurse> - -Recurse into sub-directories. This is the default and just here for -compatibility with grep. You can also use it for turning B<--no-recurse> off. - -=item B<-s> - -Suppress error messages about nonexistent or unreadable files. This is taken -from fgrep. - -=item B<--[no]smart-case>, B<--no-smart-case> - -Ignore case in the search strings if PATTERN contains no uppercase -characters. This is similar to C<smartcase> in vim. This option is -off by default, and ignored if C<-i> is specified. - -B<-i> always overrides this option. - -=item B<--sort-files> - -Sorts the found files lexicographically. Use this if you want your file -listings to be deterministic between runs of I<ack>. - -=item B<--show-types> - -Outputs the filetypes that ack associates with each file. - -Works with B<-f> and B<-g> options. - -=item B<--type=[no]TYPE> - -Specify the types of files to include or exclude from a search. -TYPE is a filetype, like I<perl> or I<xml>. B<--type=perl> can -also be specified as B<--perl>, and B<--type=noperl> can be done -as B<--noperl>. - -If a file is of both type "foo" and "bar", specifying --foo and ---nobar will exclude the file, because an exclusion takes precedence -over an inclusion. - -Type specifications can be repeated and are ORed together. - -See I<ack --help=types> for a list of valid types. - -=item B<--type-add I<TYPE>:I<FILTER>:I<FILTERARGS>> - -Files with the given FILTERARGS applied to the given FILTER -are recognized as being of (the existing) type TYPE. -See also L</"Defining your own types">. - - -=item B<--type-set I<TYPE>:I<FILTER>:I<FILTERARGS>> - -Files with the given FILTERARGS applied to the given FILTER are recognized as -being of type TYPE. This replaces an existing definition for type TYPE. See -also L</"Defining your own types">. - -=item B<--type-del I<TYPE>> - -The filters associated with TYPE are removed from Ack, and are no longer considered -for searches. - -=item B<-v>, B<--invert-match> - -Invert match: select non-matching lines - -=item B<--version> - -Display version and copyright information. - -=item B<-w>, B<--word-regexp> - -Force PATTERN to match only whole words. The PATTERN is wrapped with -C<\b> metacharacters. - -=item B<-x> - -An abbreviation for B<--files-from=->; the list of files to search are read -from standard input, with one line per file. - -=item B<-1> - -Stops after reporting first match of any kind. This is different -from B<--max-count=1> or B<-m1>, where only one match per file is -shown. Also, B<-1> works with B<-f> and B<-g>, where B<-m> does -not. - -=item B<--thpppt> - -Display the all-important Bill The Cat logo. Note that the exact -spelling of B<--thpppppt> is not important. It's checked against -a regular expression. - -=item B<--bar> - -Check with the admiral for traps. - -=item B<--cathy> - -Chocolate, Chocolate, Chocolate! - -=back - -=head1 THE .ackrc FILE - -The F<.ackrc> file contains command-line options that are prepended -to the command line before processing. Multiple options may live -on multiple lines. Lines beginning with a # are ignored. A F<.ackrc> -might look like this: - - # Always sort the files - --sort-files - - # Always color, even if piping to a another program - --color - - # Use "less -r" as my pager - --pager=less -r - -Note that arguments with spaces in them do not need to be quoted, -as they are not interpreted by the shell. Basically, each I<line> -in the F<.ackrc> file is interpreted as one element of C<@ARGV>. - -F<ack> looks in several locations for F<.ackrc> files; the searching -process is detailed in L</"ACKRC LOCATION SEMANTICS">. These -files are not considered if B<--noenv> is specified on the command line. - -=head1 Defining your own types - -ack allows you to define your own types in addition to the predefined -types. This is done with command line options that are best put into -an F<.ackrc> file - then you do not have to define your types over and -over again. In the following examples the options will always be shown -on one command line so that they can be easily copy & pasted. - -I<ack --perl foo> searches for foo in all perl files. I<ack --help=types> -tells you, that perl files are files ending -in .pl, .pm, .pod or .t. So what if you would like to include .xs -files as well when searching for --perl files? I<ack --type-add perl:ext:xs --perl foo> -does this for you. B<--type-add> appends -additional extensions to an existing type. - -If you want to define a new type, or completely redefine an existing -type, then use B<--type-set>. I<ack --type-set eiffel:ext:e,eiffel> defines -the type I<eiffel> to include files with -the extensions .e or .eiffel. So to search for all eiffel files -containing the word Bertrand use I<ack --type-set eiffel:ext:e,eiffel --eiffel Bertrand>. -As usual, you can also write B<--type=eiffel> -instead of B<--eiffel>. Negation also works, so B<--noeiffel> excludes -all eiffel files from a search. Redefining also works: I<ack --type-set cc:ext:c,h> -and I<.xs> files no longer belong to the type I<cc>. - -When defining your own types in the F<.ackrc> file you have to use -the following: - - --type-set=eiffel:ext:e,eiffel - -or writing on separate lines - - --type-set - eiffel:ext:e,eiffel - -The following does B<NOT> work in the F<.ackrc> file: - - --type-set eiffel:ext:e,eiffel - - -In order to see all currently defined types, use I<--help-types>, e.g. -I<ack --type-set backup:ext:bak --type-add perl:ext:perl --help-types> - -In addition to filtering based on extension (like ack 1.x allowed), ack 2 -offers additional filter types. The generic syntax is -I<--type-set TYPE:FILTER:FILTERARGS>; I<FILTERARGS> depends on the value -of I<FILTER>. - -=over 4 - -=item is:I<FILENAME> - -I<is> filters match the target filename exactly. It takes exactly one -argument, which is the name of the file to match. - -Example: - - --type-set make:is:Makefile - -=item ext:I<EXTENSION>[,I<EXTENSION2>[,...]] - -I<ext> filters match the extension of the target file against a list -of extensions. No leading dot is needed for the extensions. - -Example: - - --type-set perl:ext:pl,pm,t - -=item match:I<PATTERN> - -I<match> filters match the target filename against a regular expression. -The regular expression is made case insensitive for the search. - -Example: - - --type-set make:match:/(gnu)?makefile/ - -=item firstlinematch:I<PATTERN> - -I<firstlinematch> matches the first line of the target file against a -regular expression. Like I<match>, the regular expression is made -case insensitive. - -Example: - - --type-add perl:firstlinematch:/perl/ - -=back - -More filter types may be made available in the future. - -=head1 ENVIRONMENT VARIABLES - -For commonly-used ack options, environment variables can make life -much easier. These variables are ignored if B<--noenv> is specified -on the command line. - -=over 4 - -=item ACKRC - -Specifies the location of the user's F<.ackrc> file. If this file doesn't -exist, F<ack> looks in the default location. - -=item ACK_OPTIONS - -This variable specifies default options to be placed in front of -any explicit options on the command line. - -=item ACK_COLOR_FILENAME - -Specifies the color of the filename when it's printed in B<--group> -mode. By default, it's "bold green". - -The recognized attributes are clear, reset, dark, bold, underline, -underscore, blink, reverse, concealed black, red, green, yellow, -blue, magenta, on_black, on_red, on_green, on_yellow, on_blue, -on_magenta, on_cyan, and on_white. Case is not significant. -Underline and underscore are equivalent, as are clear and reset. -The color alone sets the foreground color, and on_color sets the -background color. - -This option can also be set with B<--color-filename>. - -=item ACK_COLOR_MATCH - -Specifies the color of the matching text when printed in B<--color> -mode. By default, it's "black on_yellow". - -This option can also be set with B<--color-match>. - -See B<ACK_COLOR_FILENAME> for the color specifications. - -=item ACK_COLOR_LINENO - -Specifies the color of the line number when printed in B<--color> -mode. By default, it's "bold yellow". - -This option can also be set with B<--color-lineno>. - -See B<ACK_COLOR_FILENAME> for the color specifications. - -=item ACK_PAGER - -Specifies a pager program, such as C<more>, C<less> or C<most>, to which -ack will send its output. - -Using C<ACK_PAGER> does not suppress grouping and coloring like -piping output on the command-line does, except that on Windows -ack will assume that C<ACK_PAGER> does not support color. - -C<ACK_PAGER_COLOR> overrides C<ACK_PAGER> if both are specified. - -=item ACK_PAGER_COLOR - -Specifies a pager program that understands ANSI color sequences. -Using C<ACK_PAGER_COLOR> does not suppress grouping and coloring -like piping output on the command-line does. - -If you are not on Windows, you never need to use C<ACK_PAGER_COLOR>. - -=back - -=head1 ACK & OTHER TOOLS - -=head2 Vim integration - -F<ack> integrates easily with the Vim text editor. Set this in your -F<.vimrc> to use F<ack> instead of F<grep>: - - set grepprg=ack\ -k - -That example uses C<-k> to search through only files of the types ack -knows about, but you may use other default flags. Now you can search -with F<ack> and easily step through the results in Vim: - - :grep Dumper perllib - -Miles Sterrett has written a Vim plugin for F<ack> which allows you to use -C<:Ack> instead of C<:grep>, as well as several other advanced features. - -L<https://github.com/mileszs/ack.vim> - -=head2 Emacs integration - -Phil Jackson put together an F<ack.el> extension that "provides a -simple compilation mode ... has the ability to guess what files you -want to search for based on the major-mode." - -L<http://www.shellarchive.co.uk/content/emacs.html> - -=head2 TextMate integration - -Pedro Melo is a TextMate user who writes "I spend my day mostly -inside TextMate, and the built-in find-in-project sucks with large -projects. So I hacked a TextMate command that was using find + -grep to use ack. The result is the Search in Project with ack, and -you can find it here: -L<http://www.simplicidade.org/notes/archives/2008/03/search_in_proje.html>" - -=head2 Shell and Return Code - -For greater compatibility with I<grep>, I<ack> in normal use returns -shell return or exit code of 0 only if something is found and 1 if -no match is found. - -(Shell exit code 1 is C<$?=256> in perl with C<system> or backticks.) - -The I<grep> code 2 for errors is not used. - -If C<-f> or C<-g> are specified, then 0 is returned if at least one -file is found. If no files are found, then 1 is returned. - -=cut - -=head1 DEBUGGING ACK PROBLEMS - -If ack gives you output you're not expecting, start with a few simple steps. - -=head2 Use B<--noenv> - -Your environment variables and F<.ackrc> may be doing things you're -not expecting, or forgotten you specified. Use B<--noenv> to ignore -your environment and F<.ackrc>. - -=head2 Use B<-f> to see what files have been selected - -Ack's B<-f> was originally added as a debugging tool. If ack is -not finding matches you think it should find, run F<ack -f> to see -what files have been selected. You can also add the C<--show-types> -options to show the type of each file selected. - -=head2 Use B<--dump> - -This lists the ackrc files that are loaded and the options loaded -from them. -So for example you can find a list of directories that do not get searched or where filetypes are defined. - -=head1 TIPS - -=head2 Use the F<.ackrc> file. - -The F<.ackrc> is the place to put all your options you use most of -the time but don't want to remember. Put all your --type-add and ---type-set definitions in it. If you like --smart-case, set it -there, too. I also set --sort-files there. - -=head2 Use F<-f> for working with big codesets - -Ack does more than search files. C<ack -f --perl> will create a -list of all the Perl files in a tree, ideal for sending into F<xargs>. -For example: - - # Change all "this" to "that" in all Perl files in a tree. - ack -f --perl | xargs perl -p -i -e's/this/that/g' - -or if you prefer: - - perl -p -i -e's/this/that/g' $(ack -f --perl) - -=head2 Use F<-Q> when in doubt about metacharacters - -If you're searching for something with a regular expression -metacharacter, most often a period in a filename or IP address, add -the -Q to avoid false positives without all the backslashing. See -the following example for more... - -=head2 Use ack to watch log files - -Here's one I used the other day to find trouble spots for a website -visitor. The user had a problem loading F<troublesome.gif>, so I -took the access log and scanned it with ack twice. - - ack -Q aa.bb.cc.dd /path/to/access.log | ack -Q -B5 troublesome.gif - -The first ack finds only the lines in the Apache log for the given -IP. The second finds the match on my troublesome GIF, and shows -the previous five lines from the log in each case. - -=head2 Examples of F<--output> - -Following variables are useful in the expansion string: - -=over 4 - -=item C<$&> - -The whole string matched by PATTERN. - -=item C<$1>, C<$2>, ... - -The contents of the 1st, 2nd ... bracketed group in PATTERN. - -=item C<$`> - -The string before the match. - -=item C<$'> - -The string after the match. - -=back - -For more details and other variables see -L<http://perldoc.perl.org/perlvar.html#Variables-related-to-regular-expressions|perlvar>. - -This example shows how to add text around a particular pattern -(in this case adding _ around word with "e") - - ack2.pl "\w*e\w*" quick.txt --output="$`_$&_$'" - _The_ quick brown fox jumps over the lazy dog - The quick brown fox jumps _over_ the lazy dog - The quick brown fox jumps over _the_ lazy dog - -This shows how to pick out particular parts of a match using ( ) within regular expression. - - ack '=head(\d+)\s+(.*)' --output=' $1 : $2' - input file contains "=head1 NAME" - output "1 : NAME" - -=head2 Share your knowledge - -Join the ack-users mailing list. Send me your tips and I may add -them here. - -=head1 FAQ - -=head2 Why isn't ack finding a match in (some file)? - -Probably because it's of a type that ack doesn't recognize. ack's -searching behavior is driven by filetype. B<If ack doesn't know -what kind of file it is, ack ignores the file.> - -Use the C<-f> switch to see a list of files that ack will search -for you. You can use the C<--show-types> switch to show which type -ack thinks each file is. - -=head2 Wouldn't it be great if F<ack> did search & replace? - -No, ack will always be read-only. Perl has a perfectly good way -to do search & replace in files, using the C<-i>, C<-p> and C<-n> -switches. - -You can certainly use ack to select your files to update. For -example, to change all "foo" to "bar" in all PHP files, you can do -this from the Unix shell: - - $ perl -i -p -e's/foo/bar/g' $(ack -f --php) - -=head2 Can I make ack recognize F<.xyz> files? - -Yes! Please see L</"Defining your own types">. If you think -that F<ack> should recognize a type by default, please see -L</"ENHANCEMENTS">. - -=head2 There's already a program/package called ack. - -Yes, I know. - -=head2 Why is it called ack if it's called ack-grep? - -The name of the program is "ack". Some packagers have called it -"ack-grep" when creating packages because there's already a package -out there called "ack" that has nothing to do with this ack. - -I suggest you make a symlink named F<ack> that points to F<ack-grep> -because one of the crucial benefits of ack is having a name that's -so short and simple to type. - -To do that, run this with F<sudo> or as root: - - ln -s /usr/bin/ack-grep /usr/bin/ack - -Alternatively, you could use a shell alias: - - # bash/zsh - alias ack=ack-grep - - # csh - alias ack ack-grep - -=head2 What does F<ack> mean? - -Nothing. I wanted a name that was easy to type and that you could -pronounce as a single syllable. - -=head2 Can I do multi-line regexes? - -No, ack does not support regexes that match multiple lines. Doing -so would require reading in the entire file at a time. - -If you want to see lines near your match, use the C<--A>, C<--B> -and C<--C> switches for displaying context. - -=head2 Why is ack telling me I have an invalid option when searching for C<+foo>? - -ack treats command line options beginning with C<+> or C<-> as options; if you -would like to search for these, you may prefix your search term with C<--> or -use the C<--match> option. (However, don't forget that C<+> is a regular -expression metacharacter!) - -=head2 Why does C<"ack '.{40000,}'"> fail? Isn't that a valid regex? - -The Perl language limits the repetition quanitifier to 32K. You -can search for C<.{32767}> but not C<.{32768}>. - -=head1 ACKRC LOCATION SEMANTICS - -Ack can load its configuration from many sources. This list -specifies the sources Ack looks for configuration; each one -that is found is loaded in the order specified here, and -each one overrides options set in any of the sources preceding -it. (For example, if I set --sort-files in my user ackrc, and ---nosort-files on the command line, the command line takes -precedence) - -=over 4 - -=item * - -Defaults are loaded from App::Ack::ConfigDefaults. This can be omitted -using C<--ignore-ack-defaults>. - -=item * Global ackrc - -Options are then loaded from the global ackrc. This is located at -C</etc/ackrc> on Unix-like systems, and -C<C:\Documents and Settings\All Users\Application Data\ackrc> on Windows. -This can be omitted using C<--noenv>. - -=item * User ackrc - -Options are then loaded from the user's ackrc. This is located at -C<$HOME/.ackrc> on Unix-like systems, and -C<C:\Documents and Settings\$USER\Application Data\ackrc>. If a different -ackrc is desired, it may be overridden with the C<$ACKRC> environment -variable. -This can be omitted using C<--noenv>. - -=item * Project ackrc - -Options are then loaded from the project ackrc. The project ackrc is -the first ackrc file with the name C<.ackrc> or C<_ackrc>, first searching -in the current directory, then the parent directory, then the grandparent -directory, etc. This can be omitted using C<--noenv>. - -=item * --ackrc - -The C<--ackrc> option may be included on the command line to specify an -ackrc file that can override all others. It is consulted even if C<--noenv> -is present. - -=item * ACK_OPTIONS - -Options are then loaded from the environment variable C<ACK_OPTIONS>. This can -be omitted using C<--noenv>. - -=item * Command line - -Options are then loaded from the command line. - -=back - -=head1 DIFFERENCES BETWEEN ACK 1.X AND ACK 2.X - -A lot of changes were made for ack 2; here is a list of them. - -=head2 GENERAL CHANGES - -=over 4 - -=item * - -When no selectors are specified, ack 1.x only searches through files that -it can map to a file type. ack 2.x, by contrast, will search through -every regular, non-binary file that is not explicitly ignored via -B<--ignore-file> or B<--ignore-dir>. This is similar to the behavior of the -B<-a/--all> option in ack 1.x. - -=item * - -A more flexible filter system has been added, so that more powerful file types -may be created by the user. For details, please consult -L</"Defining your own types">. - -=item * - -ack now loads multiple ackrc files; see L</"ACKRC LOCATION SEMANTICS"> for -details. - -=item * - -ack's default filter definitions aren't special; you may tell ack to -completely disregard them if you don't like them. - -=back - -=head2 REMOVED OPTIONS - -=over 4 - -=item * - -Because of the change in default search behavior, the B<-a/--all> and -B<-u/--unrestricted> options have been removed. In addition, the -B<-k/--known-types> option was added to cause ack to behave with -the default search behavior of ack 1.x. - -=item * - -The B<-G> option has been removed. Two regular expressions on the -command line was considered too confusing; to simulate B<-G>'s functionality, -you may use the new B<-x> option to pipe filenames from one invocation of -ack into another. - -=item * - -The B<--binary> option has been removed. - -=item * - -The B<--skipped> option has been removed. - -=item * - -The B<--text> option has been removed. - -=item * - -The B<--invert-file-match> option has been removed. Instead, you may -use B<-v> with B<-g>. - -=back - -=head2 CHANGED OPTIONS - -=over 4 - -=item * - -The options that modify the regular expression's behavior (B<-i>, B<-w>, -B<-Q>, and B<-v>) may now be used with B<-g>. - -=back - -=head2 ADDED OPTIONS - -=over 4 - -=item * - -B<--files-from> was added so that a user may submit a list of filenames as -a list of files to search. - -=item * - -B<-x> was added to tell ack to accept a list of filenames via standard input; -this list is the list of filenames that will be used for the search. - -=item * - -B<-s> was added to tell ack to suppress error messages about non-existent or -unreadable files. - -=item * - -B<--ignore-directory> and B<--noignore-directory> were added as aliases for -B<--ignore-dir> and B<--noignore-dir> respectively. - -=item * - -B<--ignore-file> was added so that users may specify patterns of files to -ignore (ex. /.*~$/). - -=item * - -B<--dump> was added to allow users to easily find out which options are -set where. - -=item * - -B<--create-ackrc> was added so that users may create custom ackrc files based -on the default settings loaded by ack, and so that users may easily view those -defaults. - -=item * - -B<--type-del> was added to selectively remove file type definitions. - -=item * - -B<--ignore-ack-defaults> was added so that users may ignore ack's default -options in favor of their own. - -=item * - -B<--bar> was added so ack users may consult Admiral Ackbar. - -=back - -=head1 AUTHOR - -Andy Lester, C<< <andy at petdance.com> >> - -=head1 BUGS - -Please report any bugs or feature requests to the issues list at -Github: L<https://github.com/petdance/ack2/issues> - -=head1 ENHANCEMENTS - -All enhancement requests MUST first be posted to the ack-users -mailing list at L<http://groups.google.com/group/ack-users>. I -will not consider a request without it first getting seen by other -ack users. This includes requests for new filetypes. - -There is a list of enhancements I want to make to F<ack> in the ack -issues list at Github: L<https://github.com/petdance/ack2/issues> - -Patches are always welcome, but patches with tests get the most -attention. - -=head1 SUPPORT - -Support for and information about F<ack> can be found at: - -=over 4 - -=item * The ack homepage - -L<http://beyondgrep.com/> - -=item * The ack-users mailing list - -L<http://groups.google.com/group/ack-users> - -=item * The ack issues list at Github - -L<https://github.com/petdance/ack2/issues> - -=item * AnnoCPAN: Annotated CPAN documentation - -L<http://annocpan.org/dist/ack> - -=item * CPAN Ratings - -L<http://cpanratings.perl.org/d/ack> - -=item * Search CPAN - -L<http://search.cpan.org/dist/ack> - -=item * Git source repository - -L<https://github.com/petdance/ack2> - -=back - -=head1 ACKNOWLEDGEMENTS - -How appropriate to have I<ack>nowledgements! - -Thanks to everyone who has contributed to ack in any way, including -Fraser Tweedale, -RaE<aacute>l GundE<aacute>n, -Steffen Jaeckel, -Stephan Hohe, -Michael Beijen, -Alexandr Ciornii, -Christian Walde, -Charles Lee, -Joe McMahon, -John Warwick, -David Steinbrunner, -Kara Martens, -Volodymyr Medvid, -Ron Savage, -Konrad Borowski, -Dale Sedivic, -Michael McClimon, -Andrew Black, -Ralph Bodenner, -Shaun Patterson, -Ryan Olson, -Shlomi Fish, -Karen Etheridge, -Olivier Mengue, -Matthew Wild, -Scott Kyle, -Nick Hooey, -Bo Borgerson, -Mark Szymanski, -Marq Schneider, -Packy Anderson, -JR Boyens, -Dan Sully, -Ryan Niebur, -Kent Fredric, -Mike Morearty, -Ingmar Vanhassel, -Eric Van Dewoestine, -Sitaram Chamarty, -Adam James, -Richard Carlsson, -Pedro Melo, -AJ Schuster, -Phil Jackson, -Michael Schwern, -Jan Dubois, -Christopher J. Madsen, -Matthew Wickline, -David Dyck, -Jason Porritt, -Jjgod Jiang, -Thomas Klausner, -Uri Guttman, -Peter Lewis, -Kevin Riggle, -Ori Avtalion, -Torsten Blix, -Nigel Metheringham, -GE<aacute>bor SzabE<oacute>, -Tod Hagan, -Michael Hendricks, -E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason, -Piers Cawley, -Stephen Steneker, -Elias Lutfallah, -Mark Leighton Fisher, -Matt Diephouse, -Christian Jaeger, -Bill Sully, -Bill Ricker, -David Golden, -Nilson Santos F. Jr, -Elliot Shank, -Merijn Broeren, -Uwe Voelker, -Rick Scott, -Ask BjE<oslash>rn Hansen, -Jerry Gay, -Will Coleda, -Mike O'Regan, -Slaven ReziE<0x107>, -Mark Stosberg, -David Alan Pisoni, -Adriano Ferreira, -James Keenan, -Leland Johnson, -Ricardo Signes, -Pete Krawczyk and -Rob Hoelz. - -=head1 COPYRIGHT & LICENSE - -Copyright 2005-2013 Andy Lester. - -This program is free software; you can redistribute it and/or modify -it under the terms of the Artistic License v2.0. - -See http://www.perlfoundation.org/artistic_license_2_0 or the LICENSE.md -file that comes with the ack distribution. - -=cut -package App::Ack; - -use warnings; -use strict; - - -our $VERSION; -our $COPYRIGHT; -BEGIN { - $VERSION = '2.12'; - $COPYRIGHT = 'Copyright 2005-2013 Andy Lester.'; -} - -our $fh; - -BEGIN { - $fh = *STDOUT; -} - - -our %types; -our %type_wanted; -our %mappings; -our %ignore_dirs; - -our $is_filter_mode; -our $output_to_pipe; - -our $dir_sep_chars; -our $is_cygwin; -our $is_windows; - -use File::Spec 1.00015 (); - -BEGIN { - # These have to be checked before any filehandle diddling. - $output_to_pipe = not -t *STDOUT; - $is_filter_mode = -p STDIN; - - $is_cygwin = ($^O eq 'cygwin'); - $is_windows = ($^O eq 'MSWin32'); - $dir_sep_chars = $is_windows ? quotemeta( '\\/' ) : quotemeta( File::Spec->catfile( '', '' ) ); -} - - - -sub remove_dir_sep { - my $path = shift; - $path =~ s/[$dir_sep_chars]$//; - - return $path; -} - - - -sub warn { - return CORE::warn( _my_program(), ': ', @_, "\n" ); -} - - -sub die { - return CORE::die( _my_program(), ': ', @_, "\n" ); -} - -sub _my_program { - require File::Basename; - return File::Basename::basename( $0 ); -} - - - -sub filetypes_supported { - return keys %mappings; -} - -sub _get_thpppt { - my $y = q{_ /|,\\'!.x',=(www)=, U }; - $y =~ tr/,x!w/\nOo_/; - return $y; -} - -sub _thpppt { - my $y = _get_thpppt(); - App::Ack::print( "$y ack $_[0]!\n" ); - exit 0; -} - -sub _bar { - my $x; - $x = <<'_BAR'; - 6?!I'7!I"?%+! - 3~!I#7#I"7#I!?!+!="+"="+!:! - 2?#I!7!I!?#I!7!I"+"=%+"=# - 1?"+!?*+!=#~"=!+#?"="+! - 0?"+!?"I"?&+!="~!=!~"=!+%="+" - /I!+!?)+!?!+!=$~!=!~!="+!="+"?!="?! - .?%I"?%+%='?!=#~$=" - ,,!?%I"?(+$=$~!=#:"~$:!~! - ,I!?!I!?"I"?!+#?"+!?!+#="~$:!~!:!~!:!,!:!,":#~! - +I!?&+!="+!?#+$=!~":!~!:!~!:!,!:#,!:!,%:" - *+!I!?!+$=!+!=!+!?$+#=!~":!~":#,$:",#:!,!:! - *I!?"+!?!+!=$+!?#+#=#~":$,!:",!:!,&:" - )I!?$=!~!=#+"?!+!=!+!=!~!="~!:!~":!,'.!,%:!~! - (=!?"+!?!=!~$?"+!?!+!=#~"=",!="~$,$.",#.!:!=! - (I"+"="~"=!+&=!~"=!~!,!~!+!=!?!+!?!=!I!?!+"=!.",!.!,":! - %I$?!+!?!=%+!~!+#~!=!~#:#=!~!+!~!=#:!,%.!,!.!:" - $I!?!=!?!I!+!?"+!=!~!=!~!?!I!?!=!+!=!~#:",!~"=!~!:"~!=!:",&:" '-/ - $?!+!I!?"+"=!+"~!,!:"+#~#:#,"=!~"=!,!~!,!.",!:".!:! */! !I!t!'!s! !a! !g!r!e!p!!! !/! - $+"=!+!?!+"~!=!:!~!:"I!+!,!~!=!:!~!,!:!,$:!~".&:"~!,# (-/ - %~!=!~!=!:!.!+"~!:!,!.!,!~!=!:$.!,":!,!.!:!~!,!:!=!.#="~!,!:" ./! - %=!~!?!+"?"+!=!~",!.!:!?!~!.!:!,!:!,#.!,!:","~!:!=!~!=!:",!~! ./! - %+"~":!~!=#~!:!~!,!.!~!:",!~!=!~!.!:!,!.",!:!,":!=":!.!,!:!7! -/! - %~",!:".#:!=!:!,!:"+!:!~!:!.!,!~!,!.#,!.!,$:"~!,":"~!=! */! - &=!~!=#+!=!~",!.!:",#:#,!.",+:!,!.",!=!+!?! - &~!=!~!=!~!:"~#:",!.!,#~!:!.!+!,!.",$.",$.#,!+!I!?! - &~!="~!:!~":!~",!~!=!~":!,!:!~!,!:!,&.$,#."+!?!I!?!I! - &~!=!~!=!+!,!:!~!:!=!,!:!~&:$,!.!,".!,".!,#."~!+!?$I! - &~!=!~!="~!=!:!~":!,!~%:#,!:",!.!,#.",#I!7"I!?!+!?"I" - &+!I!7!:#~"=!~!:!,!:"~$.!=!.!,!~!,$.#,!~!7!I#?!+!?"I"7! - %7#?!+!~!:!=!~!=!~":!,!:"~":#.!,)7#I"?"I!7& - %7#I!=":!=!~!:"~$:"~!:#,!:!,!:!~!:#,!7#I!?#7) - $7$+!,!~!=#~!:!~!:!~$:#,!.!~!:!=!,":!7#I"?#7+=!?! - $7#I!~!,!~#=!~!:"~!:!,!:!,#:!=!~",":!7$I!?#I!7*+!=!+" - "I!7$I!,":!,!.!=":$,!:!,$:$7$I!+!?"I!7+?"I!7!I!7!,! - !,!7%I!:",!."~":!,&.!,!:!~!I!7$I!+!?"I!7,?!I!7',! - !7(,!.#~":!,%.!,!7%I!7!?#I"7,+!?!7* -7+:!,!~#,"=!7'I!?#I"7/+!7+ -77I!+!7!?!7!I"71+!7, -_BAR - - App::Ack::__pic($x); -} - -sub _cathy { - my $x = <<'CATHY'; - 0+!--+! - 0|! "C!H!O!C!O!L!A!T!E!!! !|! - 0|! "C!H!O!C!O!L!A!T!E!!! !|! - 0|! "C!H!O!C!O!L!A!T!E!!! !|! - 0|! $A"C!K!!! $|! - 0+!--+! - 6\! 1:!,!.! ! - 7\! /.!M!~!Z!M!~! - 8\! /~!D! "M! ! - 4.! $\! /M!~!.!8! +.!M# 4 - 0,!.! (\! .~!M!N! ,+!I!.!M!.! 3 - /?!O!.!M!:! '\! .O!.! +~!Z!=!N!.! 4 - ..! !D!Z!.!Z!.! '\! 9=!M".! 6 - /.! !.!~!M".! '\! 8~! 9 - 4M!.! /.!7!N!M!.! F - 4.! &:!M! !N"M# !M"N!M! #D!M&=! = - :M!7!M#:! !~!M!7!,!$!M!:! #.! !O!N!.!M!:!M# ; - 8Z!M"~!N!$!D!.!N!?! !I!N!.! (?!M! !M!,!D!M".! 9 - (?!Z!M!N!:! )=!M!O!8!.!M!+!M! !M!,! !O!M! +,!M!.!M!~!Z!N!M!:! &:!~! 0 - &8!7!.!~!M"D!M!,! &M!?!=!8! !M!,!O! !M!+! !+!O!.!M! $M#~! !.!8!M!Z!.!M! !O!M"Z! %:!~!M!Z!M!Z!.! + - &:!M!7!,! *M!.!Z!M! !8"M!.!M!~! !.!M!.!=! #~!8!.!M! !7!M! "N!Z#I! !D!M!,!M!.! $."M!,! !M!.! * - 2$!O! "N! !.!M!I! !7" "M! "+!O! !~!M! !d!O!.!7!I!M!.! !.!O!=!M!.! !M",!M!.! %.!$!O!D! + - 1~!O! "M!+! !8!$! "M! "?!O! %Z!8!D!M!?!8!I!O!7!M! #M!.!M! "M",!M! 4 - 07!~! ".!8! !.!M! "I!+! !.!M! &Z!D!.!7!=!M! !:!.!M! #:!8"+! !.!+!8! !8! 3 - /~!M! #N! !~!M!$! !.!M! !.!M" &~!M! "~!M!O! "D! $M! !8! "M!,!M!+!D!.! 1 - #.! #?!M!N!.! #~!O! $M!.!7!$! "?" !?!~!M! '7!8!?!M!.!+!M"O! $?"$!D! !.!O! !$!7!I!.! 0 - $,!M!:!O!?! ".! !?!=! $=!:!O! !M! "M! !M! !+!$! (.! +.!M! !M!.! !8! !+"Z!~! $:!M!$! !.! ' - #.!8!.!I!$! $7!I! %M" !=!M! !~!M!D! "7!I! .I!O! %?!=!,!D! !,!M! !D!~!8!~! %D!M! ( - #.!M"?! $=!O! %=!N! "8!.! !Z!M! #M!~! (M!:! #.!M" &O! !M!.! !?!,! !8!.!N!~! $8!N!M!,!.! % - *$!O! &M!,! "O! !.!M!.! #M! (~!M( &O!.! !7! "M! !.!M!.!M!,! #.!M! !M! & - )=!8!.! $.!M!O!.! "$!.!I!N! !I!M# (7!M(I! %D"Z!M! "=!I! "M! !M!:! #~!D! ' - )D! &8!N!:! ".!O! !M!="M! "M! (7!M) %." !M!D!."M!.! !$!=! !M!,! + - (M! &+!.!M! #Z!7!O!M!.!~!8! +,!M#D!?!M#D! #.!Z!M#,!Z!?! !~!N! "N!.! !M! + - 'D!:! %$!D! !?! #M!Z! !8!.! !M"?!7!?!7! '+!I!D! !?!O!:!M!:! ":!M!:! !M!7".!M! "8!+! !:!D! !.!M! * - %.!O!:! $.!O!+! !D!.! #M! "M!.!+!N!I!Z! "7!M!N!M!N!?!I!7!Z!=!M'D"~! #M!.!8!$! !:! !.!M! "N!?! !,!O! ) - !.!?!M!:!M!I! %8!,! "M!.! #M! "N! !M!.! !M!.! !+!~! !.!M!.! ':!M! $M! $M!Z!$! !M!.! "D! "M! "?!M! ( - !7!8! !+!I! ".! "$!=! ":!$! "+! !M!.! !O! !M!I!M".! !=!~! ",!O! '=!M! $$!,! #N!:! ":!8!.! !D!~! !,!M!.! !:!M!.! & - !:!,!.! &Z" #D! !.!8!."M!.! !8!?!Z!M!.!M! #Z!~! !?!M!Z!.! %~!O!.!8!$!N!8!O!I!:!~! !+! #M!.! !.!M!.! !+!M! ".!~!M!+! $ - !.! 'D!I! #?!M!.!M!,! !.!Z! !.!8! #M&O!I!?! (~!I!M"." !M!Z!.! !M!N!.! "+!$!.! "M!.! !M!?!.! "8!M! $ - (O!8! $M! !M!.! ".!:! !+!=! #M! #.!M! !+" *$!M":!.! !M!~! "M!7! #M! #7!Z! "M"$!M!.! !.! # - '$!Z! #.!7!+!M! $.!,! !+!:! #N! #.!M!.!+!M! +D!M! #=!N! ":!O! #=!M! #Z!D! $M!I! % - $,! ".! $.!M" %$!.! !?!~! "+!7!." !.!M!,! !M! *,!N!M!.$M!?! "D!,! #M!.! #N! + - ,M!Z! &M! "I!,! "M! %I!M! !?!=!.! (Z!8!M! $:!M!.! !,!M! $D! #.!M!.! ) - +8!O! &.!8! "I!,! !~!M! &N!M! !M!D! '?!N!O!." $?!7! "?!~! #M!.! #I!D!.! ( - 3M!,! "N!.! !D" &.!+!M!.! !M":!.":!M!7!M!D! 'M!.! "M!.! "M!,! $I! ) - 3I! #M! "M!,! !:! &.!M" ".!,! !.!$!M!I! #.! !:! !.!M!?! "N!+! ".! / - 1M!,! #.!M!8!M!=!.! +~!N"O!Z"~! *+!M!.! "M! 2 - 0.!M! &M!.! 8:! %.!M!Z! "M!=! *O!,! % - 0?!$! &N! )." .,! %."M! ":!M!.! 0 - 0N!:! %?!O! #.! ..! &,! &.!D!,! "N!I! 0 -CATHY - App::Ack::__pic($x); -} - -sub __pic { - my($compressed) = @_; - $compressed =~ s/(.)(.)/$1x(ord($2)-32)/eg; - App::Ack::print( $compressed ); - exit 0; -} - - -sub show_help { - my $help_arg = shift || 0; - - return show_help_types() if $help_arg =~ /^types?/; - - App::Ack::print( <<"END_OF_HELP" ); -Usage: ack [OPTION]... PATTERN [FILES OR DIRECTORIES] - -Search for PATTERN in each source file in the tree from the current -directory on down. If any files or directories are specified, then -only those files and directories are checked. ack may also search -STDIN, but only if no file or directory arguments are specified, -or if one of them is "-". - -Default switches may be specified in ACK_OPTIONS environment variable or -an .ackrc file. If you want no dependency on the environment, turn it -off with --noenv. - -Example: ack -i select - -Searching: - -i, --ignore-case Ignore case distinctions in PATTERN - --[no]smart-case Ignore case distinctions in PATTERN, - only if PATTERN contains no upper case. - Ignored if -i is specified - -v, --invert-match Invert match: select non-matching lines - -w, --word-regexp Force PATTERN to match only whole words - -Q, --literal Quote all metacharacters; PATTERN is literal - -Search output: - --lines=NUM Only print line(s) NUM of each file - -l, --files-with-matches Only print filenames containing matches - -L, --files-without-matches Only print filenames with no matches - --output=expr Output the evaluation of expr for each line - (turns off text highlighting) - -o Show only the part of a line matching PATTERN - Same as --output='\$&' - --passthru Print all lines, whether matching or not - --match PATTERN Specify PATTERN explicitly. - -m, --max-count=NUM Stop searching in each file after NUM matches - -1 Stop searching after one match of any kind - -H, --with-filename Print the filename for each match (default: - on unless explicitly searching a single file) - -h, --no-filename Suppress the prefixing filename on output - -c, --count Show number of lines matching per file - --[no]column Show the column number of the first match - - -A NUM, --after-context=NUM Print NUM lines of trailing context after - matching lines. - -B NUM, --before-context=NUM Print NUM lines of leading context before - matching lines. - -C [NUM], --context[=NUM] Print NUM lines (default 2) of output context. - - --print0 Print null byte as separator between filenames, - only works with -f, -g, -l, -L or -c. - - -s Suppress error messages about nonexistent or - unreadable files. - - -File presentation: - --pager=COMMAND Pipes all ack output through COMMAND. For - example, --pager="less -R". Ignored if output - is redirected. - --nopager Do not send output through a pager. Cancels - any setting in ~/.ackrc, ACK_PAGER or - ACK_PAGER_COLOR. - --[no]heading Print a filename heading above each file's - results. (default: on when used interactively) - --[no]break Print a break between results from different - files. (default: on when used interactively) - --group Same as --heading --break - --nogroup Same as --noheading --nobreak - --[no]color Highlight the matching text (default: on unless - output is redirected, or on Windows) - --[no]colour Same as --[no]color - --color-filename=COLOR - --color-match=COLOR - --color-lineno=COLOR Set the color for filenames, matches, and line - numbers. - --flush Flush output immediately, even when ack is used - non-interactively (when output goes to a pipe or - file). - - -File finding: - -f Only print the files selected, without - searching. The PATTERN must not be specified. - -g Same as -f, but only select files matching - PATTERN. - --sort-files Sort the found files lexically. - --show-types Show which types each file has. - --files-from=FILE Read the list of files to search from FILE. - -x Read the list of files to search from STDIN. - -File inclusion/exclusion: - --[no]ignore-dir=name Add/remove directory from list of ignored dirs - --[no]ignore-directory=name Synonym for ignore-dir - --ignore-file=filter Add filter for ignoring files - -r, -R, --recurse Recurse into subdirectories (default: on) - -n, --no-recurse No descending into subdirectories - --[no]follow Follow symlinks. Default is off. - -k, --known-types Include only files of types that ack recognizes. - - --type=X Include only X files, where X is a recognized - filetype. - --type=noX Exclude X files. - See "ack --help-types" for supported filetypes. - -File type specification: - --type-set TYPE:FILTER:FILTERARGS - Files with the given FILTERARGS applied to the - given FILTER are recognized as being of type - TYPE. This replaces an existing definition for - type TYPE. - --type-add TYPE:FILTER:FILTERARGS - Files with the given FILTERARGS applied to the - given FILTER are recognized as being type TYPE. - --type-del TYPE Removes all filters associated with TYPE. - - -Miscellaneous: - --[no]env Ignore environment variables and global ackrc - files. --env is legal but redundant. - --ackrc=filename Specify an ackrc file to use - --ignore-ack-defaults Ignore default definitions included with ack. - --create-ackrc Outputs a default ackrc for your customization - to standard output. - --help, -? This help - --help-types Display all known types - --dump Dump information on which options are loaded - from which RC files - --[no]filter Force ack to treat standard input as a pipe - (--filter) or tty (--nofilter) - --man Man page - --version Display version & copyright - --thpppt Bill the Cat - --bar The warning admiral - --cathy Chocolate! Chocolate! Chocolate! - -Exit status is 0 if match, 1 if no match. - -This is version $VERSION of ack. -END_OF_HELP - - return; - } - - - -sub show_help_types { - App::Ack::print( <<'END_OF_HELP' ); -Usage: ack [OPTION]... PATTERN [FILES OR DIRECTORIES] - -The following is the list of filetypes supported by ack. You can -specify a file type with the --type=TYPE format, or the --TYPE -format. For example, both --type=perl and --perl work. - -Note that some extensions may appear in multiple types. For example, -.pod files are both Perl and Parrot. - -END_OF_HELP - - my @types = filetypes_supported(); - my $maxlen = 0; - for ( @types ) { - $maxlen = length if $maxlen < length; - } - for my $type ( sort @types ) { - next if $type =~ /^-/; # Stuff to not show - my $ext_list = $mappings{$type}; - - if ( ref $ext_list ) { - $ext_list = join( '; ', map { $_->to_string } @{$ext_list} ); - } - App::Ack::print( sprintf( " --[no]%-*.*s %s\n", $maxlen, $maxlen, $type, $ext_list ) ); - } - - return; -} - -sub show_man { - require Pod::Usage; - - Pod::Usage::pod2usage({ - -input => $App::Ack::orig_program_name, - -verbose => 2, - -exitval => 0, - }); - - return; -} - - -sub get_version_statement { - require Config; - - my $copyright = get_copyright(); - my $this_perl = $Config::Config{perlpath}; - if ($^O ne 'VMS') { - my $ext = $Config::Config{_exe}; - $this_perl .= $ext unless $this_perl =~ m/$ext$/i; - } - my $ver = sprintf( '%vd', $^V ); - - return <<"END_OF_VERSION"; -ack ${VERSION} -Running under Perl $ver at $this_perl - -$copyright - -This program is free software. You may modify or distribute it -under the terms of the Artistic License v2.0. -END_OF_VERSION -} - - -sub print_version_statement { - App::Ack::print( get_version_statement() ); - - return; -} - - -sub get_copyright { - return $COPYRIGHT; -} - - -# print subs added in order to make it easy for a third party -# module (such as App::Wack) to redefine the display methods -# and show the results in a different way. -sub print { print {$fh} @_; return; } -sub print_first_filename { App::Ack::print( $_[0], "\n" ); return; } -sub print_blank_line { App::Ack::print( "\n" ); return; } -sub print_separator { App::Ack::print( "--\n" ); return; } -sub print_filename { App::Ack::print( $_[0], $_[1] ); return; } -sub print_line_no { App::Ack::print( $_[0], $_[1] ); return; } -sub print_column_no { App::Ack::print( $_[0], $_[1] ); return; } -sub print_count { - my $filename = shift; - my $nmatches = shift; - my $ors = shift; - my $count = shift; - my $show_filename = shift; - - if ($show_filename) { - App::Ack::print( $filename ); - App::Ack::print( ':', $nmatches ) if $count; - } - else { - App::Ack::print( $nmatches ) if $count; - } - App::Ack::print( $ors ); - - return; -} - -sub print_count0 { - my $filename = shift; - my $ors = shift; - my $show_filename = shift; - - if ($show_filename) { - App::Ack::print( $filename, ':0', $ors ); - } - else { - App::Ack::print( '0', $ors ); - } - - return; -} - -sub set_up_pager { - my $command = shift; - - return if App::Ack::output_to_pipe(); - - my $pager; - if ( not open( $pager, '|-', $command ) ) { - App::Ack::die( qq{Unable to pipe to pager "$command": $!} ); - } - $fh = $pager; - - return; -} - - -sub output_to_pipe { - return $output_to_pipe; -} - - -sub exit_from_ack { - my $nmatches = shift; - - my $rc = $nmatches ? 0 : 1; - exit $rc; -} - - - -1; # End of App::Ack -package App::Ack::Resource; - - -use warnings; -use strict; -use overload - '""' => 'name'; - -sub FAIL { - require Carp; - Carp::confess( 'Must be overloaded' ); -} - - -sub new { - return FAIL(); -} - - -sub name { - return FAIL(); -} - - -sub is_binary { - return FAIL(); -} - - -sub open { - return FAIL(); -} - - -sub needs_line_scan { - return FAIL(); -} - - -sub reset { - return FAIL(); -} - - -sub close { - return FAIL(); -} - - -sub clone { - return FAIL(); -} - - -sub firstliney { - return FAIL(); -} - -1; -package App::Ack::Resources; - - - -use warnings; -use strict; - - -sub from_argv { - my $class = shift; - my $opt = shift; - my $start = shift; - - my $self = bless {}, $class; - - my $file_filter = undef; - my $descend_filter = $opt->{descend_filter}; - - if( $opt->{n} ) { - $descend_filter = sub { - return 0; - }; - } - - $self->{iter} = - File::Next::files( { - file_filter => $opt->{file_filter}, - descend_filter => $descend_filter, - error_handler => sub { my $msg = shift; App::Ack::warn( $msg ) }, - sort_files => $opt->{sort_files}, - follow_symlinks => $opt->{follow}, - }, @{$start} ); - - return $self; -} - - -sub from_file { - my $class = shift; - my $opt = shift; - my $file = shift; - - my $iter = - File::Next::from_file( { - error_handler => sub { my $msg = shift; App::Ack::warn( $msg ) }, - warning_handler => sub { my $msg = shift; App::Ack::warn( $msg ) }, - sort_files => $opt->{sort_files}, - }, $file ) or return undef; - - return bless { - iter => $iter, - }, $class; -} - -# This is for reading input lines from STDIN, not the list of files from STDIN -sub from_stdin { - my $class = shift; - my $opt = shift; - - my $self = bless {}, $class; - - my $has_been_called = 0; - - $self->{iter} = sub { - if ( !$has_been_called ) { - $has_been_called = 1; - return '-'; - } - return; - }; - - return $self; -} - -sub next { - my $self = shift; - - my $file = $self->{iter}->() or return; - - return App::Ack::Resource::Basic->new( $file ); -} - -1; -package App::Ack::Resource::Basic; - - -use warnings; -use strict; - -use Fcntl (); - -BEGIN { - our @ISA = 'App::Ack::Resource'; -} - - -sub new { - my $class = shift; - my $filename = shift; - - my $self = bless { - filename => $filename, - fh => undef, - opened => 0, - }, $class; - - if ( $self->{filename} eq '-' ) { - $self->{fh} = *STDIN; - $self->{opened} = 1; - } - - return $self; -} - - -sub name { - return $_[0]->{filename}; -} - - - -sub needs_line_scan { - my $self = shift; - my $opt = shift; - - return 1 if $opt->{v}; - - my $size = -s $self->{fh}; - if ( $size == 0 ) { - return 0; - } - elsif ( $size > 100_000 ) { - return 1; - } - - my $buffer; - my $rc = sysread( $self->{fh}, $buffer, $size ); - if ( !defined($rc) && $App::Ack::report_bad_filenames ) { - App::Ack::warn( "$self->{filename}: $!" ); - return 1; - } - return 0 unless $rc && ( $rc == $size ); - - my $regex = $opt->{regex}; - return $buffer =~ /$regex/m; -} - - -sub reset { - my $self = shift; - - # return if we haven't opened the file yet - if ( !defined($self->{fh}) ) { - return; - } - - if( !seek( $self->{fh}, 0, 0 ) && $App::Ack::report_bad_filenames ) { - App::Ack::warn( "$self->{filename}: $!" ); - } - - return; -} - - -sub close { - my $self = shift; - - # return if we haven't opened the file yet - if ( !defined($self->{fh}) ) { - return; - } - - if ( !close($self->{fh}) && $App::Ack::report_bad_filenames ) { - App::Ack::warn( $self->name() . ": $!" ); - } - - $self->{opened} = 0; - - return; -} - - -sub clone { - my ( $self ) = @_; - - return __PACKAGE__->new($self->name); -} - -sub firstliney { - my ( $self ) = @_; - - my $fh = $self->open(); - - unless(exists $self->{firstliney}) { - my $buffer = ''; - my $rc = sysread( $fh, $buffer, 250 ); - unless($rc) { # XXX handle this better? - $buffer = ''; - } - $buffer =~ s/[\r\n].*//s; - $self->{firstliney} = $buffer; - $self->reset; - } - - $self->close; - - return $self->{firstliney}; -} - -sub open { - my ( $self ) = @_; - - return $self->{fh} if $self->{opened}; - - unless ( open $self->{fh}, '<', $self->{filename} ) { - return; - } - - $self->{opened} = 1; - - return $self->{fh}; -} - -1; -package App::Ack::ConfigDefault; - -use warnings; -use strict; - -sub options { - my @options = split( /\n/, _options_block() ); - @options = grep { /./ && !/^#/ } @options; - - return @options; -} - -sub _options_block { - return <<'HERE'; -# This is the default ackrc for ack 2.0 - -# There are four different ways to match -# -# is: Match the filename exactly -# -# ext: Match the extension of the filename exactly -# -# match: Match the filename against a Perl regular expression -# -# firstlinematch: Match the first 250 characters of the first line -# of text against a Perl regular expression. This is only for -# the --type-add option. - - -### Directories to ignore - -# Bazaar ---ignore-directory=is:.bzr - -# Codeville ---ignore-directory=is:.cdv - -# Interface Builder ---ignore-directory=is:~.dep ---ignore-directory=is:~.dot ---ignore-directory=is:~.nib ---ignore-directory=is:~.plst - -# Git ---ignore-directory=is:.git - -# Mercurial ---ignore-directory=is:.hg - -# quilt ---ignore-directory=is:.pc - -# Subversion ---ignore-directory=is:.svn - -# Monotone ---ignore-directory=is:_MTN - -# CVS ---ignore-directory=is:CVS - -# RCS ---ignore-directory=is:RCS - -# SCCS ---ignore-directory=is:SCCS - -# darcs ---ignore-directory=is:_darcs - -# Vault/Fortress ---ignore-directory=is:_sgbak - -# autoconf ---ignore-directory=is:autom4te.cache - -# Perl module building ---ignore-directory=is:blib ---ignore-directory=is:_build - -# Perl Devel::Cover module's output directory ---ignore-directory=is:cover_db - -# Node modules created by npm ---ignore-directory=is:node_modules - -# CMake cache ---ignore-directory=is:CMakeFiles - -# Eclipse workspace folder ---ignore-directory=is:.metadata - -### Files to ignore - -# Backup files ---ignore-file=ext:bak ---ignore-file=match:/~$/ - -# Emacs swap files ---ignore-file=match:/^#.+#$/ - -# vi/vim swap files ---ignore-file=match:/[._].*\.swp$/ - -# core dumps ---ignore-file=match:/core\.\d+$/ - -# minified Javascript ---ignore-file=match:/[.-]min[.]js$/ ---ignore-file=match:/[.]js[.]min$/ - -# minified CSS ---ignore-file=match:/[.]min[.]css$/ ---ignore-file=match:/[.]css[.]min$/ - -# PDFs, because they pass Perl's -T detection ---ignore-file=ext:pdf - -# Common graphics, just as an optimization ---ignore-file=ext:gif,jpg,jpeg,png - - -### Filetypes defined - -# Perl http://perl.org/ ---type-add=perl:ext:pl,pm,pod,t,psgi ---type-add=perl:firstlinematch:/^#!.*\bperl/ - -# Perl tests ---type-add=perltest:ext:t - -# Makefiles http://www.gnu.org/s/make/ ---type-add=make:ext:mk ---type-add=make:ext:mak ---type-add=make:is:makefile ---type-add=make:is:Makefile ---type-add=make:is:GNUmakefile - -# Rakefiles http://rake.rubyforge.org/ ---type-add=rake:is:Rakefile - -# CMake http://www.cmake.org/ ---type-add=cmake:is:CMakeLists.txt ---type-add=cmake:ext:cmake - -# Actionscript ---type-add=actionscript:ext:as,mxml - -# Ada http://www.adaic.org/ ---type-add=ada:ext:ada,adb,ads - -# ASP http://msdn.microsoft.com/en-us/library/aa286483.aspx ---type-add=asp:ext:asp - -# ASP.Net http://www.asp.net/ ---type-add=aspx:ext:master,ascx,asmx,aspx,svc - -# Assembly ---type-add=asm:ext:asm,s - -# Batch ---type-add=batch:ext:bat,cmd - -# ColdFusion http://en.wikipedia.org/wiki/ColdFusion ---type-add=cfmx:ext:cfc,cfm,cfml - -# Clojure http://clojure.org/ ---type-add=clojure:ext:clj - -# C -# .xs are Perl C files ---type-add=cc:ext:c,h,xs - -# C header files ---type-add=hh:ext:h - -# CoffeeScript http://coffeescript.org/ ---type-add=coffeescript:ext:coffee - -# C++ ---type-add=cpp:ext:cpp,cc,cxx,m,hpp,hh,h,hxx - -# C# ---type-add=csharp:ext:cs - -# CSS http://www.w3.org/Style/CSS/ ---type-add=css:ext:css - -# Dart http://www.dartlang.org/ ---type-add=dart:ext:dart - -# Delphi http://en.wikipedia.org/wiki/Embarcadero_Delphi ---type-add=delphi:ext:pas,int,dfm,nfm,dof,dpk,dproj,groupproj,bdsgroup,bdsproj - -# Elixir http://elixir-lang.org/ ---type-add=elixir:ext:ex,exs - -# Emacs Lisp http://www.gnu.org/software/emacs ---type-add=elisp:ext:el - -# Erlang http://www.erlang.org/ ---type-add=erlang:ext:erl,hrl - -# Fortran http://en.wikipedia.org/wiki/Fortran ---type-add=fortran:ext:f,f77,f90,f95,f03,for,ftn,fpp - -# Google Go http://golang.org/ ---type-add=go:ext:go - -# Groovy http://groovy.codehaus.org/ ---type-add=groovy:ext:groovy,gtmpl,gpp,grunit,gradle - -# Haskell http://www.haskell.org/ ---type-add=haskell:ext:hs,lhs - -# HTML ---type-add=html:ext:htm,html - -# Java http://www.oracle.com/technetwork/java/index.html ---type-add=java:ext:java,properties - -# JavaScript ---type-add=js:ext:js - -# JSP http://www.oracle.com/technetwork/java/javaee/jsp/index.html ---type-add=jsp:ext:jsp,jspx,jhtm,jhtml - -# JSON http://www.json.org/ ---type-add=json:ext:json - -# Less http://www.lesscss.org/ ---type-add=less:ext:less - -# Common Lisp http://common-lisp.net/ ---type-add=lisp:ext:lisp,lsp - -# Lua http://www.lua.org/ ---type-add=lua:ext:lua ---type-add=lua:firstlinematch:/^#!.*\blua(jit)?/ - -# Objective-C ---type-add=objc:ext:m,h - -# Objective-C++ ---type-add=objcpp:ext:mm,h - -# OCaml http://caml.inria.fr/ ---type-add=ocaml:ext:ml,mli - -# Matlab http://en.wikipedia.org/wiki/MATLAB ---type-add=matlab:ext:m - -# Parrot http://www.parrot.org/ ---type-add=parrot:ext:pir,pasm,pmc,ops,pod,pg,tg - -# PHP http://www.php.net/ ---type-add=php:ext:php,phpt,php3,php4,php5,phtml ---type-add=php:firstlinematch:/^#!.*\bphp/ - -# Plone http://plone.org/ ---type-add=plone:ext:pt,cpt,metadata,cpy,py - -# Python http://www.python.org/ ---type-add=python:ext:py ---type-add=python:firstlinematch:/^#!.*\bpython/ - -# R http://www.r-project.org/ ---type-add=rr:ext:R - -# Ruby http://www.ruby-lang.org/ ---type-add=ruby:ext:rb,rhtml,rjs,rxml,erb,rake,spec ---type-add=ruby:is:Rakefile ---type-add=ruby:firstlinematch:/^#!.*\bruby/ - -# Rust http://www.rust-lang.org/ ---type-add=rust:ext:rs - -# Sass http://sass-lang.com ---type-add=sass:ext:sass,scss - -# Scala http://www.scala-lang.org/ ---type-add=scala:ext:scala - -# Scheme http://groups.csail.mit.edu/mac/projects/scheme/ ---type-add=scheme:ext:scm,ss - -# Shell ---type-add=shell:ext:sh,bash,csh,tcsh,ksh,zsh,fish ---type-add=shell:firstlinematch:/^#!.*\b(?:ba|t?c|k|z|fi)?sh\b/ - -# Smalltalk http://www.smalltalk.org/ ---type-add=smalltalk:ext:st - -# SQL http://www.iso.org/iso/catalogue_detail.htm?csnumber=45498 ---type-add=sql:ext:sql,ctl - -# Tcl http://www.tcl.tk/ ---type-add=tcl:ext:tcl,itcl,itk - -# LaTeX http://www.latex-project.org/ ---type-add=tex:ext:tex,cls,sty - -# Template Toolkit http://template-toolkit.org/ ---type-add=tt:ext:tt,tt2,ttml - -# Visual Basic ---type-add=vb:ext:bas,cls,frm,ctl,vb,resx - -# Verilog ---type-add=verilog:ext:v,vh,sv - -# VHDL http://www.eda.org/twiki/bin/view.cgi/P1076/WebHome ---type-add=vhdl:ext:vhd,vhdl - -# Vim http://www.vim.org/ ---type-add=vim:ext:vim - -# XML http://www.w3.org/TR/REC-xml/ ---type-add=xml:ext:xml,dtd,xsl,xslt,ent ---type-add=xml:firstlinematch:/<[?]xml/ - -# YAML http://yaml.org/ ---type-add=yaml:ext:yaml,yml -HERE -} - -1; -package App::Ack::ConfigFinder; - - -use strict; -use warnings; - -use Cwd 3.00 (); -use File::Spec 3.00; - -use if ($^O eq 'MSWin32'), 'Win32'; - - -sub new { - my ( $class ) = @_; - - return bless {}, $class; -} - -sub _remove_redundancies { - my ( @configs ) = @_; - - if ( $App::Ack::is_windows ) { - # inode stat always returns 0 on windows, so just check filenames. - my (%seen, @uniq); - - foreach my $path (map { $_->{path} } @configs) { - push @uniq, $path unless $seen{$path}; - $seen{$path} = 1; - } - - return @uniq; - } - - else { - - my %dev_and_inode_seen; - - foreach my $config ( @configs ) { - my $path = $config->{path}; - my ( $dev, $inode ) = (stat $path)[0, 1]; - - if( defined($dev) ) { - if( $dev_and_inode_seen{"$dev:$inode"} ) { - undef $config; - } - else { - $dev_and_inode_seen{"$dev:$inode"} = 1; - } - } - } - - return grep { defined() } @configs; - - } -} - -sub _check_for_ackrc { - return unless defined $_[0]; - - my @files = grep { -f } - map { File::Spec->catfile(@_, $_) } - qw(.ackrc _ackrc); - - die File::Spec->catdir(@_) . " contains both .ackrc and _ackrc.\n" . - "Please remove one of those files.\n" - if @files > 1; - - return wantarray ? @files : $files[0]; -} # end _check_for_ackrc - - -sub find_config_files { - my @config_files; - - if ( $App::Ack::is_windows ) { - push @config_files, map { +{ path => File::Spec->catfile($_, 'ackrc') } } ( - Win32::GetFolderPath(Win32::CSIDL_COMMON_APPDATA()), - Win32::GetFolderPath(Win32::CSIDL_APPDATA()), - ); - } - else { - push @config_files, { path => '/etc/ackrc' }; - } - - - if ( $ENV{'ACKRC'} && -f $ENV{'ACKRC'} ) { - push @config_files, { path => $ENV{'ACKRC'} }; - } - else { - push @config_files, map { +{ path => $_ } } _check_for_ackrc($ENV{'HOME'}); - } - - my @dirs = File::Spec->splitdir(Cwd::getcwd()); - while(@dirs) { - my $ackrc = _check_for_ackrc(@dirs); - if(defined $ackrc) { - push @config_files, { project => 1, path => $ackrc }; - last; - } - pop @dirs; - } - - # XXX we only test for existence here, so if the file is - # deleted out from under us, this will fail later. =( - return _remove_redundancies( @config_files ); -} - - -sub read_rcfile { - my $file = shift; - - return unless defined $file && -e $file; - - my @lines; - - open( my $fh, '<', $file ) or App::Ack::die( "Unable to read $file: $!" ); - while ( my $line = <$fh> ) { - chomp $line; - $line =~ s/^\s+//; - $line =~ s/\s+$//; - - next if $line eq ''; - next if $line =~ /^#/; - - push( @lines, $line ); - } - close $fh; - - return @lines; -} - -1; -package App::Ack::ConfigLoader; - -use strict; -use warnings; - -use Carp 1.04 (); -use Getopt::Long 2.35 (); -use Text::ParseWords 3.1 (); - - -my @INVALID_COMBINATIONS; - -BEGIN { - my @context = qw( -A -B -C --after-context --before-context --context ); - my @pretty = qw( --heading --group --break ); - my @filename = qw( -h -H --with-filename --no-filename ); - - @INVALID_COMBINATIONS = ( - # XXX normalize - [qw(-l)] => [@context, @pretty, @filename, qw(-L -o --passthru --output --max-count --column -f -g --show-types)], - [qw(-L)] => [@context, @pretty, @filename, qw(-l -o --passthru --output --max-count --column -f -g --show-types -c --count)], - [qw(--line)] => [@context, @pretty, @filename, qw(-l --files-with-matches --files-without-matches -L -o --passthru --match -m --max-count -1 -c --count --column --print0 -f -g --show-types)], - [qw(-o)] => [@context, qw(--output -c --count --column --column -f --show-types)], - [qw(--passthru)] => [@context, qw(--output --column -m --max-count -1 -c --count -f -g)], - [qw(--output)] => [@context, qw(-c --count -f -g)], - [qw(--match)] => [qw(-f -g)], - [qw(-m --max-count)] => [qw(-1 -f -g -c --count)], - [qw(-h --no-filename)] => [qw(-H --with-filename -f -g --group --heading)], - [qw(-H --with-filename)] => [qw(-h --no-filename -f -g)], - [qw(-c --count)] => [@context, @pretty, qw(--column -f -g)], - [qw(--column)] => [qw(-f -g)], - [@context] => [qw(-f -g)], - [qw(-f)] => [qw(-g), @pretty], - [qw(-g)] => [qw(-f), @pretty], - ); -} - -sub process_filter_spec { - my ( $spec ) = @_; - - if ( $spec =~ /^(\w+):(\w+):(.*)/ ) { - my ( $type_name, $ext_type, $arguments ) = ( $1, $2, $3 ); - - return ( $type_name, - App::Ack::Filter->create_filter($ext_type, split(/,/, $arguments)) ); - } - elsif ( $spec =~ /^(\w+)=(.*)/ ) { # Check to see if we have ack1-style argument specification. - my ( $type_name, $extensions ) = ( $1, $2 ); - - my @extensions = split(/,/, $extensions); - foreach my $extension ( @extensions ) { - $extension =~ s/^[.]//; - } - - return ( $type_name, App::Ack::Filter->create_filter('ext', @extensions) ); - } - else { - Carp::croak "invalid filter specification '$spec'"; - } -} - -sub uninvert_filter { - my ( $opt, @filters ) = @_; - - return unless defined $opt->{filters} && @filters; - - # Loop through all the registered filters. If we hit one that - # matches this extension and it's inverted, we need to delete it from - # the options. - for ( my $i = 0; $i < @{ $opt->{filters} }; $i++ ) { - my $opt_filter = @{ $opt->{filters} }[$i]; - - # XXX Do a real list comparison? This just checks string equivalence. - if ( $opt_filter->is_inverted() && "$opt_filter->{filter}" eq "@filters" ) { - splice @{ $opt->{filters} }, $i, 1; - $i--; - } - } -} - -sub process_filetypes { - my ( $opt, $arg_sources ) = @_; - - Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); # start with default options, minus some annoying ones - Getopt::Long::Configure( - 'no_ignore_case', - 'no_auto_abbrev', - 'pass_through', - ); - my %additional_specs; - - my $add_spec = sub { - my ( undef, $spec ) = @_; - - my ( $name, $filter ) = process_filter_spec($spec); - - push @{ $App::Ack::mappings{$name} }, $filter; - - $additional_specs{$name . '!'} = sub { - my ( undef, $value ) = @_; - - my @filters = @{ $App::Ack::mappings{$name} }; - if ( not $value ) { - @filters = map { $_->invert() } @filters; - } - else { - uninvert_filter( $opt, @filters ); - } - - push @{ $opt->{'filters'} }, @filters; - }; - }; - - my $set_spec = sub { - my ( undef, $spec ) = @_; - - my ( $name, $filter ) = process_filter_spec($spec); - - $App::Ack::mappings{$name} = [ $filter ]; - - $additional_specs{$name . '!'} = sub { - my ( undef, $value ) = @_; - - my @filters = @{ $App::Ack::mappings{$name} }; - if ( not $value ) { - @filters = map { $_->invert() } @filters; - } - - push @{ $opt->{'filters'} }, @filters; - }; - }; - - my $delete_spec = sub { - my ( undef, $name ) = @_; - - delete $App::Ack::mappings{$name}; - delete $additional_specs{$name . '!'}; - }; - - my %type_arg_specs = ( - 'type-add=s' => $add_spec, - 'type-set=s' => $set_spec, - 'type-del=s' => $delete_spec, - ); - - foreach my $source (@{$arg_sources}) { - my ( $source_name, $args ) = @{$source}{qw/name contents/}; - - if ( ref($args) ) { - # $args are modified in place, so no need to munge $arg_sources - local @ARGV = @{$args}; - Getopt::Long::GetOptions(%type_arg_specs); - @{$args} = @ARGV; - } - else { - ( undef, $source->{contents} ) = - Getopt::Long::GetOptionsFromString($args, %type_arg_specs); - } - } - - $additional_specs{'k|known-types'} = sub { - my ( undef, $value ) = @_; - - my @filters = map { @{$_} } values(%App::Ack::mappings); - - push @{ $opt->{'filters'} }, @filters; - }; - - return \%additional_specs; -} - -sub removed_option { - my ( $option, $explanation ) = @_; - - $explanation ||= ''; - return sub { - warn "Option '$option' is not valid in ack 2\n$explanation"; - exit 1; - }; -} - -sub get_arg_spec { - my ( $opt, $extra_specs ) = @_; - - my $dash_a_explanation = <<EOT; -This is because we now have -k/--known-types which makes it only select files -of known types, rather than any text file (which is the behavior of ack 1.x). -You may have options in a .ackrc, or in the ACKRC_OPTIONS environment variable. -Try using the --dump flag. -EOT - - return { - 1 => sub { $opt->{1} = $opt->{m} = 1 }, - 'A|after-context=i' => \$opt->{after_context}, - 'B|before-context=i' - => \$opt->{before_context}, - 'C|context:i' => sub { shift; my $val = shift; $opt->{before_context} = $opt->{after_context} = ($val || 2) }, - 'a' => removed_option('-a', $dash_a_explanation), - 'all' => removed_option('--all', $dash_a_explanation), - 'break!' => \$opt->{break}, - c => \$opt->{count}, - 'color|colour!' => \$opt->{color}, - 'color-match=s' => \$ENV{ACK_COLOR_MATCH}, - 'color-filename=s' => \$ENV{ACK_COLOR_FILENAME}, - 'color-lineno=s' => \$ENV{ACK_COLOR_LINENO}, - 'column!' => \$opt->{column}, - count => \$opt->{count}, - 'create-ackrc' => sub { print "$_\n" for ( '--ignore-ack-defaults', App::Ack::ConfigDefault::options() ); exit; }, - 'env!' => sub { - my ( undef, $value ) = @_; - - if ( !$value ) { - $opt->{noenv_seen} = 1; - } - }, - f => \$opt->{f}, - 'files-from=s' => \$opt->{files_from}, - 'filter!' => \$App::Ack::is_filter_mode, - flush => \$opt->{flush}, - 'follow!' => \$opt->{follow}, - g => \$opt->{g}, - G => removed_option('-G'), - 'group!' => sub { shift; $opt->{heading} = $opt->{break} = shift }, - 'heading!' => \$opt->{heading}, - 'h|no-filename' => \$opt->{h}, - 'H|with-filename' => \$opt->{H}, - 'i|ignore-case' => \$opt->{i}, - 'ignore-directory|ignore-dir=s' # XXX Combine this version with the negated version below - => sub { - my ( undef, $dir ) = @_; - - $dir = App::Ack::remove_dir_sep( $dir ); - if ( $dir !~ /^(?:is|match):/ ) { - $dir = 'is:' . $dir; - } - push @{ $opt->{idirs} }, $dir; - }, - 'ignore-file=s' => sub { - my ( undef, $file ) = @_; - push @{ $opt->{ifiles} }, $file; - }, - 'lines=s' => sub { shift; my $val = shift; push @{$opt->{lines}}, $val }, - 'l|files-with-matches' - => \$opt->{l}, - 'L|files-without-matches' - => \$opt->{L}, - 'm|max-count=i' => \$opt->{m}, - 'match=s' => \$opt->{regex}, - 'n|no-recurse' => \$opt->{n}, - o => sub { $opt->{output} = '$&' }, - 'output=s' => \$opt->{output}, - 'pager:s' => sub { - my ( undef, $value ) = @_; - - $opt->{pager} = $value || $ENV{PAGER}; - }, - 'noignore-directory|noignore-dir=s' - => sub { - my ( undef, $dir ) = @_; - - # XXX can you do --noignore-dir=match,...? - $dir = App::Ack::remove_dir_sep( $dir ); - if ( $dir !~ /^(?:is|match):/ ) { - $dir = 'is:' . $dir; - } - if ( $dir !~ /^(?:is|match):/ ) { - Carp::croak("invalid noignore-directory argument: '$dir'"); - } - - @{ $opt->{idirs} } = grep { - $_ ne $dir - } @{ $opt->{idirs} }; - - push @{ $opt->{no_ignore_dirs} }, $dir; - }, - 'nopager' => sub { $opt->{pager} = undef }, - 'passthru' => \$opt->{passthru}, - 'print0' => \$opt->{print0}, - 'Q|literal' => \$opt->{Q}, - 'r|R|recurse' => sub { $opt->{n} = 0 }, - 's' => \$opt->{dont_report_bad_filenames}, - 'show-types' => \$opt->{show_types}, - 'smart-case!' => \$opt->{smart_case}, - 'sort-files' => \$opt->{sort_files}, - 'type=s' => sub { - my ( $getopt, $value ) = @_; - - my $cb_value = 1; - if ( $value =~ s/^no// ) { - $cb_value = 0; - } - - my $callback = $extra_specs->{ $value . '!' }; - - if ( $callback ) { - $callback->( $getopt, $cb_value ); - } - else { - Carp::croak( "Unknown type '$value'" ); - } - }, - 'u' => removed_option('-u'), - 'unrestricted' => removed_option('--unrestricted'), - 'v|invert-match' => \$opt->{v}, - 'w|word-regexp' => \$opt->{w}, - 'x' => sub { $opt->{files_from} = '-' }, - - 'version' => sub { App::Ack::print_version_statement(); exit; }, - 'help|?:s' => sub { shift; App::Ack::show_help(@_); exit; }, - 'help-types' => sub { App::Ack::show_help_types(); exit; }, - 'man' => sub { App::Ack::show_man(); exit; }, - $extra_specs ? %{$extra_specs} : (), - }; # arg_specs -} - -sub process_other { - my ( $opt, $extra_specs, $arg_sources ) = @_; - - Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); # start with default options, minus some annoying ones - Getopt::Long::Configure( - 'bundling', - 'no_ignore_case', - ); - - my $argv_source; - my $is_help_types_active; - - foreach my $source (@{$arg_sources}) { - my ( $source_name, $args ) = @{$source}{qw/name contents/}; - - if ( $source_name eq 'ARGV' ) { - $argv_source = $args; - last; - } - } - - if ( $argv_source ) { # This *should* always be true, but you never know... - my @copy = @{$argv_source}; - local @ARGV = @copy; - - Getopt::Long::Configure('pass_through'); - - Getopt::Long::GetOptions( - 'help-types' => \$is_help_types_active, - ); - - Getopt::Long::Configure('no_pass_through'); - } - - my $arg_specs = get_arg_spec($opt, $extra_specs); - - foreach my $source (@{$arg_sources}) { - my ( $source_name, $args ) = @{$source}{qw/name contents/}; - - my $args_for_source = $arg_specs; - - if ( $source->{project} ) { - my $illegal = sub { - my ( $option ) = @_; - - return sub { - die "Option $option is illegal in project ackrcs"; - }; - }; - - $args_for_source = { %$args_for_source, - 'output=s'=> $illegal->('--output'), - 'pager:s' => $illegal->('--pager'), - 'match=s' => $illegal->('--match'), - }; - } - - my $ret; - if ( ref($args) ) { - local @ARGV = @{$args}; - $ret = Getopt::Long::GetOptions( %{$args_for_source} ); - @{$args} = @ARGV; - } - else { - ( $ret, $source->{contents} ) = - Getopt::Long::GetOptionsFromString( $args, %{$args_for_source} ); - } - if ( !$ret ) { - if ( !$is_help_types_active ) { - my $where = $source_name eq 'ARGV' ? 'on command line' : "in $source_name"; - App::Ack::die( "Invalid option $where" ); - } - } - if ( $opt->{noenv_seen} ) { - App::Ack::die( "--noenv found in $source_name" ); - } - } - - # XXX We need to check on a -- in the middle of a non-ARGV source - - return; -} - -sub should_dump_options { - my ( $sources ) = @_; - - - foreach my $source (@{$sources}) { - my ( $name, $options ) = @{$source}{qw/name contents/}; - - if($name eq 'ARGV') { - my $dump; - local @ARGV = @{$options}; - Getopt::Long::Configure('default', 'pass_through', 'no_auto_help', 'no_auto_version'); - Getopt::Long::GetOptions( - 'dump' => \$dump, - ); - @{$options} = @ARGV; - return $dump; - } - } - return; -} - -sub explode_sources { - my ( $sources ) = @_; - - my @new_sources; - - Getopt::Long::Configure('default', 'pass_through', 'no_auto_help', 'no_auto_version'); - - my %opt; - my $arg_spec = get_arg_spec(\%opt); - - my $add_type = sub { - my ( undef, $arg ) = @_; - - # XXX refactor? - if ( $arg =~ /(\w+)=/) { - $arg_spec->{$1} = sub {}; - } - else { - ( $arg ) = split /:/, $arg; - $arg_spec->{$arg} = sub {}; - } - }; - - my $del_type = sub { - my ( undef, $arg ) = @_; - - delete $arg_spec->{$arg}; - }; - - foreach my $source (@{$sources}) { - my ( $name, $options ) = @{$source}{qw/name contents/}; - if ( ref($options) ne 'ARRAY' ) { - $source->{contents} = $options = - [ Text::ParseWords::shellwords($options) ]; - } - for ( my $j = 0; $j < @{$options}; $j++ ) { - next unless $options->[$j] =~ /^-/; - my @chunk = ( $options->[$j] ); - push @chunk, $options->[$j] while ++$j < @{$options} && $options->[$j] !~ /^-/; - $j--; - - my @copy = @chunk; - local @ARGV = @chunk; - Getopt::Long::GetOptions( - 'type-add=s' => $add_type, - 'type-set=s' => $add_type, - 'type-del=s' => $del_type, - ); - Getopt::Long::GetOptions( %{$arg_spec} ); - - push @new_sources, { - name => $name, - contents => \@copy, - }; - } - } - - return \@new_sources; -} - -sub compare_opts { - my ( $a, $b ) = @_; - - my $first_a = $a->[0]; - my $first_b = $b->[0]; - - $first_a =~ s/^--?//; - $first_b =~ s/^--?//; - - return $first_a cmp $first_b; -} - -sub dump_options { - my ( $sources ) = @_; - - $sources = explode_sources($sources); - - my %opts_by_source; - my @source_names; - - foreach my $source (@{$sources}) { - my ( $name, $contents ) = @{$source}{qw/name contents/}; - if ( not $opts_by_source{$name} ) { - $opts_by_source{$name} = []; - push @source_names, $name; - } - push @{$opts_by_source{$name}}, $contents; - } - - foreach my $name (@source_names) { - my $contents = $opts_by_source{$name}; - - print $name, "\n"; - print '=' x length($name), "\n"; - print ' ', join(' ', @{$_}), "\n" foreach sort { compare_opts($a, $b) } @{$contents}; - } - - return; -} - -sub remove_default_options_if_needed { - my ( $sources ) = @_; - - my $default_index; - - foreach my $index ( 0 .. $#$sources ) { - if ( $sources->[$index]{'name'} eq 'Defaults' ) { - $default_index = $index; - last; - } - } - - return $sources unless defined $default_index; - - my $should_remove = 0; - - # Start with default options, minus some annoying ones. - Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); - Getopt::Long::Configure( - 'no_ignore_case', - 'no_auto_abbrev', - 'pass_through', - ); - - foreach my $index ( $default_index + 1 .. $#$sources ) { - my ( $name, $args ) = @{$sources->[$index]}{qw/name contents/}; - - if (ref($args)) { - local @ARGV = @{$args}; - Getopt::Long::GetOptions( - 'ignore-ack-defaults' => \$should_remove, - ); - @{$args} = @ARGV; - } - else { - ( undef, $sources->[$index]{contents} ) = Getopt::Long::GetOptionsFromString($args, - 'ignore-ack-defaults' => \$should_remove, - ); - } - } - - Getopt::Long::Configure('default'); - Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); - - return $sources unless $should_remove; - - my @copy = @{$sources}; - splice @copy, $default_index, 1; - return \@copy; -} - -sub check_for_mutually_exclusive_options { - my ( $arg_sources ) = @_; - - my %mutually_exclusive_with; - my @copy = @{$arg_sources}; - - for(my $i = 0; $i < @INVALID_COMBINATIONS; $i += 2) { - my ( $lhs, $rhs ) = @INVALID_COMBINATIONS[ $i, $i + 1 ]; - - foreach my $l_opt ( @{$lhs} ) { - foreach my $r_opt ( @{$rhs} ) { - push @{ $mutually_exclusive_with{ $l_opt } }, $r_opt; - push @{ $mutually_exclusive_with{ $r_opt } }, $l_opt; - } - } - } - - while( @copy ) { - my %set_opts; - - my $source = shift @copy; - my ( $source_name, $args ) = @{$source}{qw/name contents/}; - $args = ref($args) ? [ @{$args} ] : [ Text::ParseWords::shellwords($args) ]; - - foreach my $opt ( @{$args} ) { - next unless $opt =~ /^[-+]/; - last if $opt eq '--'; - - if( $opt =~ /^(.*)=/ ) { - $opt = $1; - } - elsif ( $opt =~ /^(-[^-]).+/ ) { - $opt = $1; - } - - $set_opts{ $opt } = 1; - - my $mutex_opts = $mutually_exclusive_with{ $opt }; - - next unless $mutex_opts; - - foreach my $mutex_opt ( @{$mutex_opts} ) { - if($set_opts{ $mutex_opt }) { - die "Options '$mutex_opt' and '$opt' are mutually exclusive\n"; - } - } - } - } -} - -sub process_args { - my $arg_sources = \@_; - - my %opt = ( - pager => $ENV{ACK_PAGER_COLOR} || $ENV{ACK_PAGER}, - ); - - check_for_mutually_exclusive_options($arg_sources); - - $arg_sources = remove_default_options_if_needed($arg_sources); - - if ( should_dump_options($arg_sources) ) { - dump_options($arg_sources); - exit(0); - } - - my $type_specs = process_filetypes(\%opt, $arg_sources); - process_other(\%opt, $type_specs, $arg_sources); - while ( @{$arg_sources} ) { - my $source = shift @{$arg_sources}; - my ( $source_name, $args ) = @{$source}{qw/name contents/}; - - # All of our sources should be transformed into an array ref - if ( ref($args) ) { - if ( $source_name eq 'ARGV' ) { - @ARGV = @{$args}; - } - elsif (@{$args}) { - Carp::croak "source '$source_name' has extra arguments!"; - } - } - else { - Carp::croak 'The impossible has occurred!'; - } - } - my $filters = ($opt{filters} ||= []); - - # Throw the default filter in if no others are selected. - if ( not grep { !$_->is_inverted() } @{$filters} ) { - push @{$filters}, App::Ack::Filter::Default->new(); - } - return \%opt; -} - - -sub retrieve_arg_sources { - my @arg_sources; - - my $noenv; - my $ackrc; - - Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); - Getopt::Long::Configure('pass_through'); - Getopt::Long::Configure('no_auto_abbrev'); - - Getopt::Long::GetOptions( - 'noenv' => \$noenv, - 'ackrc=s' => \$ackrc, - ); - - Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); - - my @files; - - if ( !$noenv ) { - my $finder = App::Ack::ConfigFinder->new; - @files = $finder->find_config_files; - } - if ( $ackrc ) { - # We explicitly use open so we get a nice error message. - # XXX This is a potential race condition!. - if(open my $fh, '<', $ackrc) { - close $fh; - } - else { - die "Unable to load ackrc '$ackrc': $!" - } - push( @files, { path => $ackrc } ); - } - - push @arg_sources, { - name => 'Defaults', - contents => [ App::Ack::ConfigDefault::options() ], - }; - - foreach my $file ( @files) { - my @lines = App::Ack::ConfigFinder::read_rcfile($file->{path}); - - if(@lines) { - push @arg_sources, { - name => $file->{path}, - contents => \@lines, - project => $file->{project}, - }; - } - } - - if ( $ENV{ACK_OPTIONS} && !$noenv ) { - push @arg_sources, { - name => 'ACK_OPTIONS', - contents => $ENV{ACK_OPTIONS}, - }; - } - - push @arg_sources, { - name => 'ARGV', - contents => [ @ARGV ], - }; - - return @arg_sources; -} - -1; # End of App::Ack::ConfigLoader -package App::Ack::Filter; - -use strict; -use warnings; -use overload - '""' => 'to_string'; - -use Carp 1.04 (); - -my %filter_types; - - -sub create_filter { - my ( undef, $type, @args ) = @_; - - if ( my $package = $filter_types{$type} ) { - return $package->new(@args); - } - Carp::croak "Unknown filter type '$type'"; -} - - -sub register_filter { - my ( undef, $type, $package ) = @_; - - $filter_types{$type} = $package; - - return; -} - - -sub invert { - my ( $self ) = @_; - - return App::Ack::Filter::Inverse->new( $self ); -} - - -sub is_inverted { - return 0; -} - - -sub to_string { - my ( $self ) = @_; - - return '(unimplemented to_string)'; -} - - -sub inspect { - my ( $self ) = @_; - - return ref($self); -} - -1; -package App::Ack::Filter::Extension; - -use strict; -use warnings; -BEGIN { - our @ISA = 'App::Ack::Filter'; -} - - -sub new { - my ( $class, @extensions ) = @_; - - my $exts = join('|', map { "\Q$_\E"} @extensions); - my $re = qr/[.](?:$exts)$/i; - - return bless { - extensions => \@extensions, - regex => $re, - groupname => 'ExtensionGroup', - }, $class; -} - -sub create_group { - return App::Ack::Filter::ExtensionGroup->new(); -} - -sub filter { - my ( $self, $resource ) = @_; - - my $re = $self->{'regex'}; - - return $resource->name =~ /$re/; -} - -sub inspect { - my ( $self ) = @_; - - my $re = $self->{'regex'}; - - return ref($self) . " - $re"; -} - -sub to_string { - my ( $self ) = @_; - - my $exts = $self->{'extensions'}; - - return join(' ', map { ".$_" } @{$exts}); -} - -BEGIN { - App::Ack::Filter->register_filter(ext => __PACKAGE__); -} - -1; -package App::Ack::Filter::FirstLineMatch; - -use strict; -use warnings; -BEGIN { - our @ISA = 'App::Ack::Filter'; -} - -sub new { - my ( $class, $re ) = @_; - - $re =~ s{^/|/$}{}g; # XXX validate? - $re = qr{$re}i; - - return bless { - regex => $re, - }, $class; -} - -# This test reads the first 250 characters of a file, then just uses the -# first line found in that. This prevents reading something like an entire -# .min.js file (which might be only one "line" long) into memory. - -sub filter { - my ( $self, $resource ) = @_; - - my $re = $self->{'regex'}; - - my $line = $resource->firstliney; - - return $line =~ /$re/; -} - -sub inspect { - my ( $self ) = @_; - - my $re = $self->{'regex'}; - - return ref($self) . " - $re"; -} - -sub to_string { - my ( $self ) = @_; - - (my $re = $self->{regex}) =~ s{\([^:]*:(.*)\)$}{$1}; - - return "first line matches /$re/"; -} - -BEGIN { - App::Ack::Filter->register_filter(firstlinematch => __PACKAGE__); -} - -1; -package App::Ack::Filter::Is; - -use strict; -use warnings; -BEGIN { - our @ISA = 'App::Ack::Filter'; -} - -use File::Spec 3.00 (); - -sub new { - my ( $class, $filename ) = @_; - - return bless { - filename => $filename, - groupname => 'IsGroup', - }, $class; -} - -sub create_group { - return App::Ack::Filter::IsGroup->new(); -} - -sub filter { - my ( $self, $resource ) = @_; - - my $filename = $self->{'filename'}; - my $base = (File::Spec->splitpath($resource->name))[2]; - - return $base eq $filename; -} - -sub inspect { - my ( $self ) = @_; - - my $filename = $self->{'filename'}; - - return ref($self) . " - $filename"; -} - -sub to_string { - my ( $self ) = @_; - - my $filename = $self->{'filename'}; - - return $filename; -} - -BEGIN { - App::Ack::Filter->register_filter(is => __PACKAGE__); -} - -1; -package App::Ack::Filter::Match; - -use strict; -use warnings; -BEGIN { - our @ISA = 'App::Ack::Filter'; -} - -use File::Spec 3.00; - -sub new { - my ( $class, $re ) = @_; - - $re =~ s{^/|/$}{}g; # XXX validate? - $re = qr/$re/i; - - return bless { - regex => $re, - }, $class; -} - -sub filter { - my ( $self, $resource ) = @_; - - my $re = $self->{'regex'}; - my $base = (File::Spec->splitpath($resource->name))[2]; - - return $base =~ /$re/; -} - -sub inspect { - my ( $self ) = @_; - - my $re = $self->{'regex'}; - - print ref($self) . " - $re"; -} - -sub to_string { - my ( $self ) = @_; - - my $re = $self->{'regex'}; - - return "filename matches $re"; -} - -BEGIN { - App::Ack::Filter->register_filter(match => __PACKAGE__); -} - -1; -package App::Ack::Filter::Default; - -use strict; -use warnings; -BEGIN { - our @ISA = 'App::Ack::Filter'; -} - -sub new { - my ( $class ) = @_; - - return bless {}, $class; -} - -sub filter { - my ( $self, $resource ) = @_; - - return -T $resource->name; -} - -1; -package App::Ack::Filter::Inverse; - -use strict; -use warnings; -BEGIN { - our @ISA = 'App::Ack::Filter'; -} - -sub new { - my ( $class, $filter ) = @_; - - return bless { - filter => $filter, - }, $class; -} - -sub filter { - my ( $self, $resource ) = @_; - - my $filter = $self->{'filter'}; - return !$filter->filter( $resource ); -} - -sub invert { - my $self = shift; - - return $self->{'filter'}; -} - -sub is_inverted { - return 1; -} - -sub inspect { - my ( $self ) = @_; - - my $filter = $self->{'filter'}; - - return "!$filter"; -} - -1; -package App::Ack::Filter::Collection; - -use strict; -use warnings; -BEGIN { - our @ISA = 'App::Ack::Filter'; -} - -use File::Spec 3.00 (); - -sub new { - my ( $class ) = @_; - - return bless { - groups => {}, - ungrouped => [], - }, $class; -} - -sub filter { - my ( $self, $resource ) = @_; - - for my $group (values %{$self->{'groups'}}) { - if ($group->filter($resource)) { - return 1; - } - } - - for my $filter (@{$self->{'ungrouped'}}) { - if ($filter->filter($resource)) { - return 1; - } - } - - return 0; -} - -sub add { - my ( $self, $filter ) = @_; - - if (exists $filter->{'groupname'}) { - my $groups = $self->{'groups'}; - my $group_name = $filter->{'groupname'}; - - my $group; - if (exists $groups->{$group_name}) { - $group = $groups->{$group_name}; - } - else { - $group = $groups->{$group_name} = $filter->create_group(); - } - - $group->add($filter); - } - else { - push @{$self->{'ungrouped'}}, $filter; - } - - return; -} - -sub inspect { - my ( $self ) = @_; - - return ref($self) . " - $self"; -} - -sub to_string { - my ( $self ) = @_; - - my $ungrouped = $self->{'ungrouped'}; - - return join(', ', map { "($_)" } @{$ungrouped}); -} - -1; -package App::Ack::Filter::IsGroup; - -use strict; -use warnings; -BEGIN { - our @ISA = 'App::Ack::Filter'; -} - -use File::Spec 3.00 (); - -sub new { - my ( $class ) = @_; - - return bless { - data => {}, - }, $class; -} - -sub add { - my ( $self, $filter ) = @_; - - $self->{data}->{ $filter->{filename} } = 1; -} - -sub filter { - my ( $self, $resource ) = @_; - - my $data = $self->{'data'}; - my $base = (File::Spec->splitpath($resource->name))[2]; - - return exists $data->{$base}; -} - -sub inspect { - my ( $self ) = @_; - - return ref($self) . " - $self"; -} - -sub to_string { - my ( $self ) = @_; - - return join(' ', keys %{$self->{data}}); -} - -1; -package App::Ack::Filter::ExtensionGroup; - -use strict; -use warnings; -BEGIN { - our @ISA = 'App::Ack::Filter'; -} - -use File::Spec 3.00 (); - -sub new { - my ( $class ) = @_; - - return bless { - data => {}, - }, $class; -} - -sub add { - my ( $self, $filter ) = @_; - - my $data = $self->{'data'}; - my $extensions = $filter->{'extensions'}; - - foreach my $ext (@{$extensions}) { - $data->{lc $ext} = 1; - } -} - -sub filter { - my ( $self, $resource ) = @_; - - if ($resource->name =~ /[.]([^.]*)$/) { - return exists $self->{'data'}->{lc $1}; - } - - return 0; -} - -sub inspect { - my ( $self ) = @_; - - return ref($self) . " - $self"; -} - -sub to_string { - my ( $self ) = @_; - - my $data = $self->{'data'}; - - return join(' ', map { ".$_" } (keys %$data)); -} - -1; -package File::Next; - -use strict; -use warnings; - - -our $VERSION = '1.12'; - - - -use File::Spec (); - -our $name; # name of the current file -our $dir; # dir of the current file - -our %files_defaults; -our %skip_dirs; - -BEGIN { - %files_defaults = ( - file_filter => undef, - descend_filter => undef, - error_handler => sub { CORE::die @_ }, - warning_handler => sub { CORE::warn @_ }, - sort_files => undef, - follow_symlinks => 1, - nul_separated => 0, - ); - %skip_dirs = map {($_,1)} (File::Spec->curdir, File::Spec->updir); -} - - -sub files { - die _bad_invocation() if @_ && defined($_[0]) && ($_[0] eq __PACKAGE__); - - my ($parms,@queue) = _setup( \%files_defaults, @_ ); - my $filter = $parms->{file_filter}; - - return sub { - while (@queue) { - my ($dirname,$file,$fullpath) = splice( @queue, 0, 3 ); - if ( -f $fullpath || -p $fullpath || $fullpath =~ m{^/dev/fd} ) { - if ( $filter ) { - local $_ = $file; - local $File::Next::dir = $dirname; - local $File::Next::name = $fullpath; - next if not $filter->(); - } - return wantarray ? ($dirname,$file,$fullpath) : $fullpath; - } - elsif ( -d _ ) { - unshift( @queue, _candidate_files( $parms, $fullpath ) ); - } - } # while - - return; - }; # iterator -} - - - - - - -sub from_file { - die _bad_invocation() if @_ && defined($_[0]) && ($_[0] eq __PACKAGE__); - - my ($parms,@queue) = _setup( \%files_defaults, @_ ); - my $err = $parms->{error_handler}; - my $warn = $parms->{error_handler}; - - my $filename = $queue[1]; - - if ( !defined($filename) ) { - $err->( 'Must pass a filename to from_file()' ); - return undef; - } - - my $fh; - if ( $filename eq '-' ) { - $fh = \*STDIN; - } - else { - if ( !open( $fh, '<', $filename ) ) { - $err->( "Unable to open $filename: $!" ); - return undef; - } - } - my $filter = $parms->{file_filter}; - - return sub { - local $/ = $parms->{nul_separated} ? "\x00" : $/; - while ( my $fullpath = <$fh> ) { - chomp $fullpath; - next unless $fullpath =~ /./; - if ( not ( -f $fullpath || -p _ ) ) { - $warn->( "$fullpath: No such file" ); - next; - } - - my ($volume,$dirname,$file) = File::Spec->splitpath( $fullpath ); - if ( $filter ) { - local $_ = $file; - local $File::Next::dir = $dirname; - local $File::Next::name = $fullpath; - next if not $filter->(); - } - return wantarray ? ($dirname,$file,$fullpath) : $fullpath; - } # while - close $fh; - - return; - }; # iterator -} - -sub _bad_invocation { - my $good = (caller(1))[3]; - my $bad = $good; - $bad =~ s/(.+)::/$1->/; - return "$good must not be invoked as $bad"; -} - -sub sort_standard($$) { return $_[0]->[1] cmp $_[1]->[1] } -sub sort_reverse($$) { return $_[1]->[1] cmp $_[0]->[1] } - -sub reslash { - my $path = shift; - - my @parts = split( /\//, $path ); - - return $path if @parts < 2; - - return File::Spec->catfile( @parts ); -} - - - -sub _setup { - my $defaults = shift; - my $passed_parms = ref $_[0] eq 'HASH' ? {%{+shift}} : {}; # copy parm hash - - my %passed_parms = %{$passed_parms}; - - my $parms = {}; - for my $key ( keys %{$defaults} ) { - $parms->{$key} = - exists $passed_parms{$key} - ? delete $passed_parms{$key} - : $defaults->{$key}; - } - - # Any leftover keys are bogus - for my $badkey ( keys %passed_parms ) { - my $sub = (caller(1))[3]; - $parms->{error_handler}->( "Invalid option passed to $sub(): $badkey" ); - } - - # If it's not a code ref, assume standard sort - if ( $parms->{sort_files} && ( ref($parms->{sort_files}) ne 'CODE' ) ) { - $parms->{sort_files} = \&sort_standard; - } - my @queue; - - for ( @_ ) { - my $start = reslash( $_ ); - if (-d $start) { - push @queue, ($start,undef,$start); - } - else { - push @queue, (undef,$start,$start); - } - } - - return ($parms,@queue); -} - - -sub _candidate_files { - my $parms = shift; - my $dirname = shift; - - my $dh; - if ( !opendir $dh, $dirname ) { - $parms->{error_handler}->( "$dirname: $!" ); - return; - } - - my @newfiles; - my $descend_filter = $parms->{descend_filter}; - my $follow_symlinks = $parms->{follow_symlinks}; - my $sort_sub = $parms->{sort_files}; - - for my $file ( grep { !exists $skip_dirs{$_} } readdir $dh ) { - my $has_stat; - - # Only do directory checking if we have a descend_filter - my $fullpath = File::Spec->catdir( $dirname, $file ); - if ( !$follow_symlinks ) { - next if -l $fullpath; - $has_stat = 1; - } - - if ( $descend_filter ) { - if ( $has_stat ? (-d _) : (-d $fullpath) ) { - local $File::Next::dir = $fullpath; - local $_ = $file; - next if not $descend_filter->(); - } - } - if ( $sort_sub ) { - push( @newfiles, [ $dirname, $file, $fullpath ] ); - } - else { - push( @newfiles, $dirname, $file, $fullpath ); - } - } - closedir $dh; - - if ( $sort_sub ) { - return map { @{$_} } sort $sort_sub @newfiles; - } - - return @newfiles; -} - - -1; # End of File::Next diff --git a/bin/average b/bin/average deleted file mode 100755 index 3a7988f..0000000 --- a/bin/average +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/bin/env perl - -# Copyright J.M.P. Alves 2008-2011 (jmalves@vcu.edu) -# This software is licensed under the GNU General Public License v. 3 -# Please see http://www.fsf.org/licensing/licenses/gpl.html for details - -# first version 0.2, 2008-03-24, by J. -# Last update 0.7 2011-07-29, by J. - -use strict; -use warnings; -use Getopt::Long; -Getopt::Long::Configure ("bundling"); - -my($A,$s,$t,$l,$m,$h,$v,$d,$x,$n,$E,$c); - -GetOptions ('a' => \$A, 's' => \$s, 't' => \$t, 'l' => \$l, 'x' => \$x, 'e' => \$E, - 'n' => \$n, 'm' => \$m, 'h' => \$h, 'v' => \$v, 'd=i' => \$d, 'c=i' => \$c); - -my @vals; -my $version = "0.7.1"; -if($h) { print "Version: $version\n\n"; Help(); } -if($v) { print "$version\n"; exit; } -my $type = $E ? "E" : "f"; -$c = $c ? $c - 1 : 0; -unless(defined $d) { $d = "2$type"; } else { $d .= "$type"; } - -while(<>) { - next if $_ =~ /^\s*$/; - chomp; - $_ =~ s/^\s*//; - my @tmp = split(/\s+|\t+/, $_); - unless($tmp[$c] =~ /^\s*[+\-\d\.]+\s*$/ || $tmp[$c] =~ /^\s*[+\-\d\.e]+\s*$/i) { next; } - my $flag = 0; - local $SIG{__WARN__} = sub { - print "WARNING: Possible non-numeric value found, ignored: $_\n"; - $flag = 1; - }; - my $test = $tmp[$c] + 1; - unless($flag) { push @vals, $tmp[$c]; } -} - -unless(scalar(@vals)) { print STDERR "ERROR: No numerical values found. I quit.\n"; exit; } -if(scalar(@vals) == 1) { print STDERR "ERROR: Only one numerical value (@vals) found. Nothing to do, so I quit.\n"; exit; } - -my($sum, $av, $sd, $median, $min, $max); - -($sum, $av) = avrg(@vals); -$sd = stddev($av, @vals); -($median,$min,$max) = median(@vals); - -if($l || !($A || $s || $t || $m || $x || $n)) { - printf "%.$d +/- %.$d, total %.$d, median %.$d, minimum %.$d, maximum %.$d, n = %d\n", $av, $sd, $sum, $median, $min, $max, scalar(@vals); - exit; -} -if($A && !$s) { printf "%.$d\n", $av; exit; } -if($s) { printf "%.$d\t%.$d\n", $av, $sd; exit; } -if($t) { printf "%.$d\n", $sum; exit; } -if($m) { printf "%.$d\n", $median; exit; } -if($n) { printf "%.$d\n", $min; exit; } -if($x) { printf "%.$d\n", $max; exit; } - -exit; - -############################## - -sub avrg { - my $size = scalar(@_); - my($sum,$med); - for my $Valor (@_) { $sum += $Valor; } - if ($size) { $med = $sum/$size; } - else { $med = 0; } - return $sum, $med; -} - -############################## - -sub stddev { - my($media) = shift(@_); - my(@Lista) = @_; - my $nonzero = 0; - my($sum,$sd); - for ($a=0; $a < scalar(@Lista); $a++) { - $nonzero++; - $sum += (($Lista[$a] - $media) ** 2); - } - if ($nonzero) { $sd = sqrt($sum/($nonzero-1)); } - else { $sd = 0; } - return $sd; -} - -############################## - -sub median { - my @list = sort {$a<=>$b} @_; - if(scalar(@list) % 2 != 0) { - my $ind = int(scalar(@list)/2); - return $list[$ind], $list[0], $list[$#list]; - } - else { - my $ind = scalar(@list)/2 -1; - my(undef, $median) = avrg($list[$ind],$list[$ind+1]); - return $median, $list[0], $list[$#list]; - } -} - -############################## - -sub Help { - my (@stuff) = <DATA>; - print @stuff; - exit; -} - -############################## - -__DATA__ -average -------- - -Usage: - average [options] - -Synopsis: - Takes a series of numbers and calculates simple statistics: average (arithmetic - mean), standard deviation, median, total sum, and minimum and maximum values - present. For version 0.6 and later, also works with scientific notation numbers. - - Numbers can be in a file or presented from standard input (press control-d - to end number input after last number). Output is to standard output. - - Input can also have more than one column, in which case the column to use - in calculations can be determined using the -c option. Otherwise, the first - column is used (leading spaces are ignored; repeated whitespace is considered - as one). - -Options: - -d Number of decimal places to show (default: 2); - -c Column to use for calculations (default: 1); - -e Output in scientific notation (e.g. 1E12); - -a Shows only the arithmetic mean; - -s Shows arithmetic mean and the standard deviation; - -t Shows only the total sum of the numbers; - -m Shows only the median; - -n Shows only the minimum value; - -x Shows only the maximum value; - -l Long format, presenting all of the above (default); - -v Prints program version and exits; - -h Prints this help message and exits. - - * Options listed first have precedence over the ones below; e.g. if the user - uses both -t and -n, only -t will have an effect (total sum only will be shown). - * If average is used without any options, all statistics are shown (same as -l). - -Copyright J.M.P. Alves 2008-2011 (jmalves@vcu.edu) -This software is licensed under the GNU General Public License v. 3. -Please see http://www.fsf.org/licensing/licenses/gpl.html for details. - diff --git a/bin/battery b/bin/battery deleted file mode 100755 index 03ce28b..0000000 --- a/bin/battery +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/sh - -HEART_FULL=♥ -HEART_EMPTY=♡ -[ -z "$NUM_HEARTS" ] && - NUM_HEARTS=5 - -cutinate() -{ - perc=$1 - inc=$(( 100 / $NUM_HEARTS)) - - - for i in `seq $NUM_HEARTS`; do - if [ $perc -lt 100 ]; then - echo $HEART_EMPTY - else - echo $HEART_FULL - fi - perc=$(( $perc + $inc )) - done -} - -linux_get_bat () -{ - echo $(( $BAT_TOTAL / $BAT_COUNT )) -} - - -openbsd_get_bat () -{ - bf=$(sysctl -n hw.sensors.acpibat0.amphour0 | cut -d ' ' -f 1) - bn=$(sysctl -n hw.sensors.acpibat0.amphour3 | cut -d ' ' -f 1) - echo "(($bn * 100) / $bf)" | bc -l | awk -F '.' '{ print $1 }'; -} - -freebsd_get_bat () -{ - sysctl -n hw.acpi.battery.life -} - -battery_status() -{ -case $(uname -s) in - "Linux") - BATTERIES=$(ls /sys/class/power_supply | grep BAT) - BAT_COUNT=$(ls /sys/class/power_supply | grep BAT | wc -l) - [ $BAT_COUNT -eq 0 ] && return - for BATTERY in $BATTERIES; do - BAT_PATH=/sys/class/power_supply/$BATTERY - STATUS=$BAT_PATH/status - [ "$1" = `cat $STATUS` ] || [ "$1" = "" ] || return 0 - if [ -f "$BAT_PATH/energy_full" ]; then - naming="energy" - elif [ -f "$BAT_PATH/charge_full" ]; then - naming="charge" - elif [ -f "$BAT_PATH/capacity" ]; then - cat "$BAT_PATH/capacity" - return 0 - fi - BAT_PERCENT=$(( 100 * $(cat $BAT_PATH/${naming}_now) / $(cat $BAT_PATH/${naming}_full) )) - BAT_TOTAL=$(( ${BAT_TOTAL-0} + $BAT_PERCENT )) - done - linux_get_bat - ;; - "FreeBSD") - STATUS=`sysctl -n hw.acpi.battery.state` - case $1 in - "Discharging") - if [ $STATUS -eq 1 ]; then - freebsd_get_bat - fi - ;; - "Charging") - if [ $STATUS -eq 2 ]; then - freebsd_get_bat - fi - ;; - "") - freebsd_get_bat - ;; - esac - ;; - "OpenBSD") - openbsd_get_bat - ;; - "Darwin") - case $1 in - "Discharging") - ext="No";; - "Charging") - ext="Yes";; - esac - - ioreg -c AppleSmartBattery -w0 | \ - grep -o '"[^"]*" = [^ ]*' | \ - sed -e 's/= //g' -e 's/"//g' | \ - sort | \ - while read key value; do - case $key in - "MaxCapacity") - export maxcap=$value;; - "CurrentCapacity") - export curcap=$value;; - "ExternalConnected") - if [ -n "$ext" ] && [ "$ext" != "$value" ]; then - exit - fi - ;; - "FullyCharged") - if [ "$value" = "Yes" ]; then - exit - fi - ;; - esac - if [[ -n "$maxcap" && -n $curcap ]]; then - echo $(( 100 * $curcap / $maxcap )) - break - fi - done -esac -} - -BATTERY_STATUS=`battery_status $1` -[ -z "$BATTERY_STATUS" ] && exit - -if [ -n "$CUTE_BATTERY_INDICATOR" ]; then - cutinate $BATTERY_STATUS -else - echo ${BATTERY_STATUS}% -fi - diff --git a/bin/callout b/bin/callout deleted file mode 100755 index 5664189..0000000 --- a/bin/callout +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/ruby - -x = readline() -x = x.strip -(x.length() + 4).times {print "*"} -print "\n" -print "* " -print x -print " *\n" - -(x.length() + 4).times {print "*"} -print "\n" - diff --git a/bin/contract b/bin/contract deleted file mode 100755 index f7bbeeb..0000000 --- a/bin/contract +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python2 - -import sys - -loadfile = sys.stdin - -if len(sys.argv) == 1: - print("No command to run") - sys.exit(1) - -if len(sys.argv) == 3: - if sys.argv[2] != "-": - loadfile = open(sys.argv[2]) - -def add(x, y): - return x + y - -def sub(x, y): - return x - y - -def mult(x, y): - return x * y - -def div(x,y): - return x / y; - -lis = [] -for line in loadfile: - if line.strip() is not "": - x = float(line) - lis.append(x) - -print reduce(eval(sys.argv[1]), lis) - diff --git a/bin/cronic b/bin/cronic deleted file mode 100755 index 8536f29..0000000 --- a/bin/cronic +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# Cronic v2 - cron job report wrapper -# Copyright 2007 Chuck Houpt. No rights reserved, whatsoever. -# Public Domain CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -set -eu - -OUT=/tmp/cronic.out.$$ -ERR=/tmp/cronic.err.$$ -TRACE=/tmp/cronic.trace.$$ - -set +e -"$@" >$OUT 2>$TRACE -RESULT=$? -set -e - -PATTERN="^${PS4:0:1}\\+${PS4:1}" -if grep -aq "$PATTERN" $TRACE -then - ! grep -av "$PATTERN" $TRACE > $ERR -else - ERR=$TRACE -fi - -if [ $RESULT -ne 0 -o -s "$ERR" ] - then - echo "Cronic detected failure or error output for the command:" - echo "$@" - echo - echo "RESULT CODE: $RESULT" - echo - echo "ERROR OUTPUT:" - cat "$ERR" - echo - echo "STANDARD OUTPUT:" - cat "$OUT" - if [ $TRACE != $ERR ] - then - echo - echo "TRACE-ERROR OUTPUT:" - cat "$TRACE" - fi -fi - -rm -f "$OUT" -rm -f "$ERR" -rm -f "$TRACE" diff --git a/bin/gblame b/bin/gblame deleted file mode 100755 index be49356..0000000 --- a/bin/gblame +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python3 - -import subprocess -import sys -import os - -from typing import List, Dict, Any - -DataLine = Dict[Any, Any] - - -def grab_blame_data() -> List[DataLine]: - p = subprocess.check_output( - ["git", "blame", "--line-porcelain"] + sys.argv[1:], - encoding='utf-8', - ) - data = [] - cur = {} - p = str(p) - in_segment = False - for line in p.splitlines(): - l = line.rstrip() - if len(l) == 0: - continue - if l[0] == '\t': - cur["data"] = l[1:] - data.append(cur) - cur = {} - in_segment = False - continue - d = l.split() - if not in_segment: - cur["sha"] = d[0] - cur["sha8"] = d[0][:8] - in_segment = True - else: - cur[d[0]] = " ".join(d[1:]) - - assert in_segment is False - return data - - -FIELDS = ["sha8", "author", "summary", "data"] - - -def main() -> None: - d = grab_blame_data() - lens = {} - for f in FIELDS: - maxn = 0 - for x in d: - if len(x[f]) > maxn: - maxn = len(x[f]) - lens[f] = maxn - for x in d: - s = "" - for f in FIELDS: - s = s + x[f].ljust(lens[f]) + ' ' - print(s) - - -if __name__ == "__main__": - main() diff --git a/bin/golintc b/bin/golintc deleted file mode 100755 index 90b9c78..0000000 --- a/bin/golintc +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; - -my $a = join(" ", @ARGV); -my $cmd = "golint " . $a; -open(my $fh, '-|', $cmd) - or die "Could not run golint"; - -my $cnt = 0; -while (my $row = <$fh>) { - chomp $row; - if ($row !~ /should have comment or be unexported/) { - print "$row\n"; - $cnt++; - } -} - -if ($cnt > 0) { - exit 1; -} -exit 0; diff --git a/bin/orly b/bin/orly deleted file mode 100755 index 68f664e..0000000 --- a/bin/orly +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/perl - -# -# Globals -# -use vars qw/$deftext %opt /; - -# -# Command line options processing -# -sub init() -{ - use Getopt::Std; - my $opt_string = 'hdoynsi'; - getopts( "$opt_string", \%opt ) or usage(); - usage() if $opt{h}; -} - -# -# Message about this program and how to use it -# -sub usage() -{ - print STDERR << "EOF"; - -orly -- Print an O RLY owl - -usage: $0 [-hdoyn] [<MESSAGE>] - - -h : this (help) message - -o, -d : print the "O RLY" owl - -y : print the "YA RLY" owl - -n : print the "NO WAI!" owl - -s : Print "SRSLY" as a question, statement or - exclamation, respectively for the above. - -i : take MESSAGE from STDIN - -EOF - exit; -} - -sub printorly() { - $deftext = "O RLY?"; - print << "EOO" - ___ -{o,o} -|)__) --"-"- -EOO -} - -sub printyarly() { - $deftext = "YA RLY"; - print << "EOO" - ___ -{o.o} -|)_(| --"-"- -EOO -} - -sub printnowai() { - $deftext = "NO WAI!"; - print << "EOO" - ___ - {o,o} - (__(| - -"-"- -EOO -} - -$givenstatement = ""; -for ($i=0; $i<($#ARGV + 1); $i++) -{ - if (substr($ARGV[$i],0,1) ne "-") - { - $up = uc($ARGV[$i]); - $givenstatement = "$givenstatement$up "; - } -} - -init(); - -if ($opt{i}) { - while (<STDIN>) { - $givenstatement = $givenstatement.uc($_); - } - chomp($givenstatement); -} -if ($opt{y}) { - printyarly(); - $deftext = "SRSLY" if ($opt{s}); -} -elsif ($opt{n}) { - printnowai(); - $deftext = "SRSLY!" if ($opt{s}); -} -elsif ($opt{d} || $opt {o}) { - printorly(); - $deftext = "SRSLY?" if ($opt{s}); -} -elsif ($opt{s}) { - printyarly(); - $deftext = "SRSLY"; -} -else { - printorly(); -} - -if ($givenstatement) -{ - print "$givenstatement\n"; -} -else -{ - print "$deftext\n"; -} - -exit; diff --git a/bin/pk b/bin/pk deleted file mode 100755 index a7edbdf..0000000 --- a/bin/pk +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -search () { - shift - if command -v pacman &> /dev/null; then - pacman -Ss $1 || yay -Ss $1 - elif command -v dnf &> /dev/null; then - dnf search $1 - elif command -v port &> /dev/null; then - port search $1 - elif command -v portmaster &> /dev/null; then - cd /usr/ports - make search name=$1 | grep "^\(Port\|Path\|Info\|Moved\|$\)" - elif command -v aptitude &> /dev/null; then - aptitude search $1 - elif command -v apt-cache &> /dev/null; then - apt-cache search $1 - fi -} - -update () { - shift - if command -v pacman &> /dev/null; then - sudo pacman -Sy - elif command -v dnf &> /dev/null; then - sudo dnf update - elif command -v port &> /dev/null; then - sudo port selfupdate - elif command -v portsnap &> /dev/null; then - sudo portsnap fetch && sudo portsnap upgrade - elif command -v apt-get &> /dev/null; then - sudo apt-get update - fi -} - -install () { - shift - if command -v pacman &> /dev/null; then - sudo pacman -S $* || yay -S $* - elif command -v dnf &> /dev/null; then - sudo dnf install $* - elif command -v port &> /dev/null; then - sudo port install $* - elif command -v portmaster &> /dev/null; then - sudo portmaster $* - elif command -v apt-get &> /dev/null; then - sudo apt-get install $* - fi -} - -case $1 -in - "i" | "install") - install $*;; - - "s" | "search") - search $*;; - - "u" | "update") - update $*;; -esac - diff --git a/bin/theyfightcrime b/bin/theyfightcrime deleted file mode 100755 index d04e18b..0000000 --- a/bin/theyfightcrime +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python2 -# -# They Fight Crime! -# -# taken from the Javascript at -# http://home.epix.net/~mhryvnak/theyfightcrime.html -# and translated into python by B. Michener -# - -import random - -#init a; -a = [0, 1, 2, 3, 4, 5, 6, 7] -for i in range(0,8): - a[i] = random.randint(0,39) - -he1 = ["a superhumanly strong","an underprivileged","a globe-trotting","an impetuous","a shy","a suave","a notorious","a one-legged","an all-American","a short-sighted","an otherworldly","a hate-fuelled","a scrappy","an unconventional","a jaded","a leather-clad","a fiendish","a Nobel prize-winning","a suicidal","a maverick","a bookish","an old-fashioned","a witless","a lounge-singing","a war-weary","a scarfaced","a gun-slinging","an obese","a time-tossed","a benighted","an uncontrollable","an immortal","an oversexed","a world-famous","an ungodly","a fast talking","a deeply religious","a lonely","a sword-wielding","a genetically engineered"] - -he2 = ["white trash","zombie","shark-wrestling","playboy","guitar-strumming","Jewish","sweet-toothed","bohemian","crooked","chivalrous","moralistic","amnesiac","devious","drug-addicted","voodoo","Catholic","overambitious","coffee-fuelled","pirate","misogynist","skateboarding","arachnophobic","Amish","small-town","Republican","one-eyed","gay","guerilla","vegetarian","dishevelled","alcoholic","flyboy","ninja","albino","hunchbacked","neurotic","umbrella-wielding","native American","soccer-playing","day-dreaming"] - -he3 = ["grifter","stage actor","paramedic","gentleman spy","jungle king","hairdresser","photographer","ex-con","vagrant","filmmaker","werewolf","senator","romance novelist","shaman","cop","rock star","farmboy","cat burglar","cowboy","cyborg","inventor","assassin","boxer","dog-catcher","master criminal","gangster","firefighter","househusband","dwarf","librarian","paranormal investigator","Green Beret","waffle chef","vampire hunter","messiah","astronaut","sorceror","card sharp","matador","barbarian"] - -he4 = ["with a robot buddy named Sparky.","whom everyone believes is mad.","gone bad.","with a mysterious suitcase handcuffed to his arm.","living undercover at Ringling Bros. Circus.","searching for his wife's true killer.","who dotes on his loving old ma.","looking for 'the Big One.'","who knows the secret of the alien invasion.","on the edge.","on a mission from God.","with a secret.","in drag.","","plagued by the memory of his family's brutal murder.","looking for a cure to the poison coursing through his veins.","moving from town to town, helping folk in trouble.","who must take medication to keep him sane.","who hangs with the wrong crowd.","possessed of the uncanny powers of an insect.","with a winning smile and a way with the ladies.","fleeing from a secret government programme.","from the 'hood.","haunted by an iconic dead American confidante","with a passion for fast cars.","trapped in a world he never made.","in a wheelchair.","on the hunt for the last specimen of a great and near-mythical creature.","on the run.","for the 21st century.","who hides his scarred face behind a mask.","on the wrong side of the law.","with no name.","from the Mississippi delta.","with acid for blood.","with nothing left to lose.","haunted by memories of 'Nam.","on a search for his missing sister.","on his last day in the job.","from a doomed world.","who believes he can never love again."] - -she1 = ["a radical","a green-fingered","a tortured","a time-travelling","a vivacious","a scantily clad","a mistrustful","a violent","a transdimensional","a strong-willed","a ditzy","a man-hating","a high-kicking","a blind","an elegant","a supernatural","a foxy","a bloodthirsty","a cynical","a beautiful","a plucky","a sarcastic","a psychotic","a hard-bitten","a manipulative","an orphaned","a cosmopolitan","a chain-smoking","a cold-hearted","a warm-hearted","a sharp-shooting","an enchanted","a wealthy","a pregnant","a mentally unstable","a virginal","a brilliant","a disco-crazy","a provocative","an artistic"] - -she2 = ["tempestuous","Buddhist","foul-mouthed","nymphomaniac","green-skinned","impetuous","African-American","punk","hypochondriac","junkie","blonde","goth","insomniac","gypsy","mutant","renegade","tomboy","French-Canadian","motormouth","belly-dancing","communist","hip-hop","thirtysomething","cigar-chomping","extravagent","out-of-work","Bolivian","mute","cat-loving","snooty","wisecracking","red-headed","winged","kleptomaniac","antique-collecting","psychic","gold-digging","bisexual","paranoid","streetsmart"] - -she3 = ["archaeologist","pearl diver","mechanic","detective","hooker","femme fatale","former first lady","barmaid","fairy princess","magician's assistant","schoolgirl","college professor","angel","bounty hunter","opera singer","cab driver","soap star","doctor","politician","lawyer","nun","snake charmer","journalist","bodyguard","vampire","stripper","Valkyrie","wrestler","mermaid","single mother","safe cracker","traffic cop","research scientist","queen of the dead","Hell's Angel","museum curator","advertising executive","widow","mercenary","socialite"] - -she4 = ["on her way to prison for a murder she didn't commit.","trying to make a difference in a man's world.","with the soul of a mighty warrior.","looking for love in all the wrong places.","with an MBA from Harvard.","who hides her beauty behind a pair of thick-framed spectacles.","with the power to see death.","descended from a line of powerful witches.","from a family of eight older brothers.","with a flame-thrower.","with her own daytime radio talk show.","living on borrowed time.","who can talk to animals.","prone to fits of savage, blood-crazed rage.","who don't take no shit from nobody.","with a knack for trouble.","who believes she is the reincarnation of an ancient Egyptian queen.","fleeing from a Satanic cult.","on the trail of a serial killer.","with a birthmark shaped like Liberty's torch.","in the witness protection scheme.","from out of town.","from aristocratic European stock.","living homeless in New York's sewers.","with only herself to blame.","from beyond the grave","married to the Mob.","from the wrong side of the tracks.","from a secret island of warrior women.","from Mars.","with someone else's memories.","from a different time and place.","operating on the wrong side of the law.","who inherited a spooky stately manor from her late maiden aunt.","who dreams of becoming Elvis.","with a song in her heart and a spring in her step.","in the wrong place at the wrong time.","with an incredible destiny.","with the power to bend men's minds.","with an evil twin sister."] - -print "He's " + he1[a[0]] + " " + he2[a[1]] + " " + he3[a[2]] + " " + he4[a[3]], -print "She's " + she1[a[4]] + " " + she2[a[5]] + " " + she3[a[6]] + " " + she4[a[7]], -print "They fight crime!" diff --git a/bin/vi b/bin/vi deleted file mode 100755 index fe58154..0000000 --- a/bin/vi +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -export TERM=xterm-256color -if [ -n "`which nvim`" ]; then - exec -a nvim nvim "$@" -else - exec -a vim vim "$@" -fi diff --git a/bin/xinput-toggle b/bin/xinput-toggle deleted file mode 100755 index 94529fe..0000000 --- a/bin/xinput-toggle +++ /dev/null @@ -1,181 +0,0 @@ -#!/bin/bash - -debug() { - # DEBUG comes from the environment - if (( DEBUG )); then - printf '%s\n' "$@" >&2 - fi -} - -is_enabled() { - local id="${1?}" - enabled=$( - xinput list-props "$id" | - grep '\bDevice Enabled\b' | sed 's/.*\(.\)$/\1/' - ) - # xinput returns 0 for disabled and 1 for enabled, so we invert since we - # pass on 0 - return "$(( !enabled ))" -} - -should_disable() { - local id="${1?}" - local force_enable="${2?}" - local force_disable="${3?}" - - if (( force_enable )) && (( force_disable )); then - echo '-d and -e make no sense together' >&2 - exit 3 - fi - - if (( force_enable )); then - return 1 - elif (( force_disable )); then - return 0 - elif is_enabled "$id"; then - return 0 - else - return 1 - fi -} - -get_id_for_device_name() { - local name="${1?}" - xinput list "$name" | sed -n 's/.*id=\([0-9]\+\).*/\1/p' -} - -show_help() { - cat << EOF -Usage: ${0##*/} [-n] - -Enable and disable xinput devices. - - -d disable only, do not toggle - -e enable only, do not toggle - -h show this help page - -i XID only operate on device with xinput id XID - -r REGEX only operate on devices matching name REGEX - -n show results using notify-send in addition to stdout - -p print what we would do, but don't actually do it - -t SECONDS revert enable/disable after SECONDS seconds, ie. if you were - enabling, after SECONDS seconds it will be disabled again. - SECONDS must be an integer greater than 0 -EOF -} - -act_on_device() { - local print="${1?}" - local notify="${2?}" - local timeout="${3?}" - local xinput_action="${4?}" - local our_next_flag="${5?}" - local id="${6?}" - - if (( print )); then - echo "Would $xinput_action device with id $id" - else - xinput -"$xinput_action" "$id" - - if (( notify )); then - notify-send "${xinput_action^}d device with id $id" - fi - - if (( timeout )); then - debug "Added timeout $timeout" - { - sleep "$timeout" - # TODO: Make args_without_timeour_or_force non-global (sigh, - # shell makes this difficult due to pass by value) - "$0" "${args_without_timeout_or_force[@]}" \ - "$our_next_flag" -i "$id" - } & - fi - fi -} - -notify=0 -force_enable=0 -force_disable=0 -timeout=0 -print=0 -only_xid=0 -input_ids=() -args_without_timeout_or_force=() - -while getopts dehi:npr:t: opt; do - # We need to get a list of args without timeout/force for when we execute - # timeout reversions. This is a blacklist of things we should not put in - # the array, since they force enable/disable/name or do the timeout itself. - case "$opt" in - d|e|t|r) - : # Blacklisted - ;; - *) - args_without_timeout_or_force+=( -"$opt" ) - if [[ $OPTARG ]]; then - args_without_timeout_or_force+=( "$OPTARG" ) - fi - ;; - esac - - case "$opt" in - 'd') force_disable=1 ;; - 'e') force_enable=1 ;; - 'n') notify=1 ;; - 'i') only_xid="$OPTARG" ;; - 'h') - show_help - exit 0 - ;; - 'p') print=1 ;; - 'r') regex="$OPTARG" ;; - 't') timeout="$OPTARG" ;; - '?') - show_help >&2 - exit 1 - ;; - esac -done - -if (( only_xid )) && [[ "$regex" ]]; then - echo '-r and -i cannot be currently used together' >&2 - exit 4 -elif ! (( only_xid )) && ! [[ "$regex" ]]; then - echo 'either -r or -i must be passed to filter devices' >&2 - exit 5 -fi - -if (( only_xid )); then - input_ids=( "$only_xid" ) -else - mapfile -t matched_device_names < <( - xinput list | - sed -n 's/.*↳ \(.\+\)id=.*\[slave.*/\1/p' | - sed 's/[\t ]*$//' | - grep -i -- "$regex" - ) - - debug 'Matched device names:' "${matched_device_names[@]}" - - for name in "${matched_device_names[@]}"; do - input_ids+=( "$(get_id_for_device_name "$name")" ) - done -fi - -if (( "${#input_ids[@]}" == 0 )); then - msg='No matching devices found' - echo "$msg" >&2 - (( notify )) && notify-send "$msg" - exit 2 -fi - -for id in "${input_ids[@]}"; do - if should_disable "$id" "$force_enable" "$force_disable"; then - act_on_device "$print" "$notify" "$timeout" disable -e "$id" - else - act_on_device "$print" "$notify" "$timeout" enable -d "$id" - fi -done - -# We may have queued some timeout reversion jobs -wait From 30847ce7ab0a38acbdd24497590447ea10b0f982 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 18 May 2024 18:27:41 -0700 Subject: [PATCH 074/126] chezmoi-ify --- bin/executable_ack | 4985 +++++++++++++++++++++++++++++++++++++++++ bin/executable_average | 158 ++ bin/executable_battery | 132 ++ bin/executable_callout | 13 + bin/executable_contract | 34 + bin/executable_cronic | 48 + bin/executable_gblame | 63 + bin/executable_golintc | 22 + bin/executable_orly | 119 + bin/executable_pk | 61 + bin/executable_theyfightcrime | 35 + bin/executable_vi | 8 + bin/executable_xinput-toggle | 181 ++ 13 files changed, 5859 insertions(+) create mode 100644 bin/executable_ack create mode 100644 bin/executable_average create mode 100644 bin/executable_battery create mode 100644 bin/executable_callout create mode 100644 bin/executable_contract create mode 100644 bin/executable_cronic create mode 100644 bin/executable_gblame create mode 100644 bin/executable_golintc create mode 100644 bin/executable_orly create mode 100644 bin/executable_pk create mode 100644 bin/executable_theyfightcrime create mode 100644 bin/executable_vi create mode 100644 bin/executable_xinput-toggle diff --git a/bin/executable_ack b/bin/executable_ack new file mode 100644 index 0000000..88faa74 --- /dev/null +++ b/bin/executable_ack @@ -0,0 +1,4985 @@ +#!/usr/bin/env perl +# +# This file, ack, is generated code. +# Please DO NOT EDIT or send patches for it. +# +# Please take a look at the source from +# http://github.com/petdance/ack2 +# and submit patches against the individual files +# that build ack. +# + +package main; + +use strict; +use warnings; + +our $VERSION = '2.12'; # Check http://beyondgrep.com/ for updates + +use 5.008008; +use Getopt::Long 2.35 (); +use Carp 1.04 (); + + +# XXX Don't make this so brute force +# See also: https://github.com/petdance/ack2/issues/89 + +# These are all our globals. + +MAIN: { + $App::Ack::orig_program_name = $0; + $0 = join(' ', 'ack', $0); + if ( $App::Ack::VERSION ne $main::VERSION ) { + App::Ack::die( "Program/library version mismatch\n\t$0 is $main::VERSION\n\t$INC{'App/Ack.pm'} is $App::Ack::VERSION" ); + } + + # Do preliminary arg checking; + my $env_is_usable = 1; + for my $arg ( @ARGV ) { + last if ( $arg eq '--' ); + + # Get the --thpppt, --bar, --cathy checking out of the way. + $arg =~ /^--th[pt]+t+$/ and App::Ack::_thpppt($arg); + $arg eq '--bar' and App::Ack::_bar(); + $arg eq '--cathy' and App::Ack::_cathy(); + + # See if we want to ignore the environment. (Don't tell Al Gore.) + $arg eq '--env' and $env_is_usable = 1; + $arg eq '--noenv' and $env_is_usable = 0; + } + + if ( !$env_is_usable ) { + my @keys = ( 'ACKRC', grep { /^ACK_/ } keys %ENV ); + delete @ENV{@keys}; + } + load_colors(); + + Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); + Getopt::Long::Configure('pass_through', 'no_auto_abbrev'); + Getopt::Long::GetOptions( + 'help' => sub { App::Ack::show_help(); exit; }, + 'version' => sub { App::Ack::print_version_statement(); exit; }, + 'man' => sub { App::Ack::show_man(); exit; }, + ); + Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); + + if ( !@ARGV ) { + App::Ack::show_help(); + exit 1; + } + + main(); +} + +sub _compile_descend_filter { + my ( $opt ) = @_; + + my $idirs = $opt->{idirs}; + my $dont_ignore_dirs = $opt->{no_ignore_dirs}; + + # if we have one or more --noignore-dir directives, we can't ignore + # entire subdirectory hierarchies, so we return an "accept all" + # filter and scrutinize the files more in _compile_file_filter + return if $dont_ignore_dirs; + return unless $idirs && @{$idirs}; + + my %ignore_dirs; + + foreach my $idir (@{$idirs}) { + if ( $idir =~ /^(\w+):(.*)/ ) { + if ( $1 eq 'is') { + $ignore_dirs{$2} = 1; + } + else { + Carp::croak( 'Non-is filters are not yet supported for --ignore-dir' ); + } + } + else { + Carp::croak( qq{Invalid filter specification "$idir"} ); + } + } + + return sub { + return !exists $ignore_dirs{$_} && !exists $ignore_dirs{$File::Next::dir}; + }; +} + +sub _compile_file_filter { + my ( $opt, $start ) = @_; + + my $ifiles = $opt->{ifiles}; + $ifiles ||= []; + + my $ifiles_filters = App::Ack::Filter::Collection->new(); + + foreach my $filter_spec (@{$ifiles}) { + if ( $filter_spec =~ /^(\w+):(.+)/ ) { + my ($how,$what) = ($1,$2); + my $filter = App::Ack::Filter->create_filter($how, split(/,/, $what)); + $ifiles_filters->add($filter); + } + else { + Carp::croak( qq{Invalid filter specification "$filter_spec"} ); + } + } + + my $filters = $opt->{'filters'} || []; + my $direct_filters = App::Ack::Filter::Collection->new(); + my $inverse_filters = App::Ack::Filter::Collection->new(); + + foreach my $filter (@{$filters}) { + if ($filter->is_inverted()) { + # We want to check if files match the uninverted filters + $inverse_filters->add($filter->invert()); + } + else { + $direct_filters->add($filter); + } + } + + my %is_member_of_starting_set = map { (get_file_id($_) => 1) } @{$start}; + + my $ignore_dir_list = $opt->{idirs}; + my $dont_ignore_dir_list = $opt->{no_ignore_dirs}; + + my %ignore_dir_set; + my %dont_ignore_dir_set; + + foreach my $filter (@{ $ignore_dir_list }) { + if ( $filter =~ /^(\w+):(.*)/ ) { + if ( $1 eq 'is' ) { + $ignore_dir_set{ $2 } = 1; + } else { + Carp::croak( 'Non-is filters are not yet supported for --ignore-dir' ); + } + } else { + Carp::croak( qq{Invalid filter specification "$filter"} ); + } + } + foreach my $filter (@{ $dont_ignore_dir_list }) { + if ( $filter =~ /^(\w+):(.*)/ ) { + if ( $1 eq 'is' ) { + $dont_ignore_dir_set{ $2 } = 1; + } else { + Carp::croak( 'Non-is filters are not yet supported for --ignore-dir' ); + } + } else { + Carp::croak( qq{Invalid filter specification "$filter"} ); + } + } + + return sub { + # ack always selects files that are specified on the command + # line, regardless of filetype. If you want to ack a JPEG, + # and say "ack foo whatever.jpg" it will do it for you. + return 1 if $is_member_of_starting_set{ get_file_id($File::Next::name) }; + + if ( $dont_ignore_dir_list ) { + my ( undef, $dirname ) = File::Spec->splitpath($File::Next::name); + my @dirs = File::Spec->splitdir($dirname); + + my $is_ignoring = 0; + + foreach my $dir ( @dirs ) { + if ( $ignore_dir_set{ $dir } ) { + $is_ignoring = 1; + } + elsif ( $dont_ignore_dir_set{ $dir } ) { + $is_ignoring = 0; + } + } + if ( $is_ignoring ) { + return 0; + } + } + + # Ignore named pipes found in directory searching. Named + # pipes created by subprocesses get specified on the command + # line, so the rule of "always select whatever is on the + # command line" wins. + return 0 if -p $File::Next::name; + + # we can't handle unreadable filenames; report them + unless ( -r _ ) { + if ( $App::Ack::report_bad_filenames ) { + App::Ack::warn( "${File::Next::name}: cannot open file for reading" ); + } + return 0; + } + + my $resource = App::Ack::Resource::Basic->new($File::Next::name); + return 0 if ! $resource; + if ( $ifiles_filters->filter($resource) ) { + return 0; + } + + my $match_found = $direct_filters->filter($resource); + + # Don't bother invoking inverse filters unless we consider the current resource a match + if ( $match_found && $inverse_filters->filter( $resource ) ) { + $match_found = 0; + } + return $match_found; + }; +} + +sub show_types { + my $resource = shift; + my $ors = shift; + + my @types = filetypes( $resource ); + my $types = join( ',', @types ); + my $arrow = @types ? ' => ' : ' =>'; + App::Ack::print( $resource->name, $arrow, join( ',', @types ), $ors ); + + return; +} + +# Set default colors, load Term::ANSIColor +sub load_colors { + eval 'use Term::ANSIColor 1.10 ()'; + eval 'use Win32::Console::ANSI' if $App::Ack::is_windows; + + $ENV{ACK_COLOR_MATCH} ||= 'black on_yellow'; + $ENV{ACK_COLOR_FILENAME} ||= 'bold green'; + $ENV{ACK_COLOR_LINENO} ||= 'bold yellow'; + + return; +} + +sub filetypes { + my ( $resource ) = @_; + + my @matches; + + foreach my $k (keys %App::Ack::mappings) { + my $filters = $App::Ack::mappings{$k}; + + foreach my $filter (@{$filters}) { + # clone the resource + my $clone = $resource->clone; + if ( $filter->filter($clone) ) { + push @matches, $k; + last; + } + } + } + + # http://search.cpan.org/dist/Perl-Critic/lib/Perl/Critic/Policy/Subroutines/ProhibitReturnSort.pm + @matches = sort @matches; + return @matches; +} + +# Returns a (fairly) unique identifier for a file. +# Use this function to compare two files to see if they're +# equal (ie. the same file, but with a different path/links/etc). +sub get_file_id { + my ( $filename ) = @_; + + if ( $App::Ack::is_windows ) { + return File::Next::reslash( $filename ); + } + else { + # XXX is this the best method? it always hits the FS + if( my ( $dev, $inode ) = (stat($filename))[0, 1] ) { + return join(':', $dev, $inode); + } + else { + # XXX this could be better + return $filename; + } + } +} + +# Returns a regex object based on a string and command-line options. +# Dies when the regex $str is undefined (i.e. not given on command line). + +sub build_regex { + my $str = shift; + my $opt = shift; + + defined $str or App::Ack::die( 'No regular expression found.' ); + + $str = quotemeta( $str ) if $opt->{Q}; + if ( $opt->{w} ) { + $str = "\\b$str" if $str =~ /^\w/; + $str = "$str\\b" if $str =~ /\w$/; + } + + my $regex_is_lc = $str eq lc $str; + if ( $opt->{i} || ($opt->{smart_case} && $regex_is_lc) ) { + $str = "(?i)$str"; + } + + my $re = eval { qr/$str/ }; + if ( !$re ) { + die "Invalid regex '$str':\n $@"; + } + + return $re; + +} + +{ + +my @before_ctx_lines; +my @after_ctx_lines; +my $is_iterating; + +my $has_printed_something; + +BEGIN { + $has_printed_something = 0; +} + +sub print_matches_in_resource { + my ( $resource, $opt ) = @_; + + my $passthru = $opt->{passthru}; + my $max_count = $opt->{m} || -1; + my $nmatches = 0; + my $filename = $resource->name; + my $break = $opt->{break}; + my $heading = $opt->{heading}; + my $ors = $opt->{print0} ? "\0" : "\n"; + my $color = $opt->{color}; + my $print_filename = $opt->{show_filename}; + + my $has_printed_for_this_resource = 0; + + $is_iterating = 1; + + local $opt->{before_context} = $opt->{output} ? 0 : $opt->{before_context}; + local $opt->{after_context} = $opt->{output} ? 0 : $opt->{after_context}; + + my $n_before_ctx_lines = $opt->{before_context} || 0; + my $n_after_ctx_lines = $opt->{after_context} || 0; + + @after_ctx_lines = @before_ctx_lines = (); + + my $fh = $resource->open(); + if ( !$fh ) { + if ( $App::Ack::report_bad_filenames ) { + App::Ack::warn( "$filename: $!" ); + } + return 0; + } + + my $display_filename = $filename; + if ( $print_filename && $heading && $color ) { + $display_filename = Term::ANSIColor::colored($display_filename, $ENV{ACK_COLOR_FILENAME}); + } + + # check for context before the main loop, so we don't + # pay for it if we don't need it + if ( $n_before_ctx_lines || $n_after_ctx_lines ) { + my $current_line = <$fh>; # prime the first line of input + + while ( defined $current_line ) { + while ( (@after_ctx_lines < $n_after_ctx_lines) && defined($_ = <$fh>) ) { + push @after_ctx_lines, $_; + } + + local $_ = $current_line; + my $former_dot_period = $.; + $. -= @after_ctx_lines; + + if ( does_match($opt, $_) ) { + if ( !$has_printed_for_this_resource ) { + if ( $break && $has_printed_something ) { + App::Ack::print_blank_line(); + } + if ( $print_filename && $heading ) { + App::Ack::print_filename( $display_filename, $ors ); + } + } + print_line_with_context($opt, $filename, $_, $.); + $has_printed_for_this_resource = 1; + $nmatches++; + $max_count--; + } + elsif ( $passthru ) { + chomp; # XXX proper newline handling? + # XXX inline this call? + if ( $break && !$has_printed_for_this_resource && $has_printed_something ) { + App::Ack::print_blank_line(); + } + print_line_with_options($opt, $filename, $_, $., ':'); + $has_printed_for_this_resource = 1; + } + last unless $max_count != 0; + + # I tried doing this with local(), but for some reason, + # $. continued to have its new value after the exit of the + # enclosing block. I'm guessing that $. has some extra + # magic associated with it or something. If someone can + # tell me why this happened, I would love to know! + $. = $former_dot_period; # XXX this won't happen on an exception + + if ( $n_before_ctx_lines ) { + push @before_ctx_lines, $current_line; + shift @before_ctx_lines while @before_ctx_lines > $n_before_ctx_lines; + } + if ( $n_after_ctx_lines ) { + $current_line = shift @after_ctx_lines; + } + else { + $current_line = <$fh>; + } + } + } + else { + local $_; + + while ( <$fh> ) { + if ( does_match($opt, $_) ) { + if ( !$has_printed_for_this_resource ) { + if ( $break && $has_printed_something ) { + App::Ack::print_blank_line(); + } + if ( $print_filename && $heading ) { + App::Ack::print_filename( $display_filename, $ors ); + } + } + print_line_with_context($opt, $filename, $_, $.); + $has_printed_for_this_resource = 1; + $nmatches++; + $max_count--; + } + elsif ( $passthru ) { + chomp; # XXX proper newline handling? + if ( $break && !$has_printed_for_this_resource && $has_printed_something ) { + App::Ack::print_blank_line(); + } + print_line_with_options($opt, $filename, $_, $., ':'); + $has_printed_for_this_resource = 1; + } + last unless $max_count != 0; + } + } + + $is_iterating = 0; # XXX this won't happen on an exception + # then again, do we care? ack doesn't really + # handle exceptions anyway. + + return $nmatches; +} + +sub print_line_with_options { + my ( $opt, $filename, $line, $line_no, $separator ) = @_; + + $has_printed_something = 1; + + my $print_filename = $opt->{show_filename}; + my $print_column = $opt->{column}; + my $ors = $opt->{print0} ? "\0" : "\n"; + my $heading = $opt->{heading}; + my $output_expr = $opt->{output}; + my $color = $opt->{color}; + + my @line_parts; + + if( $color ) { + $filename = Term::ANSIColor::colored($filename, + $ENV{ACK_COLOR_FILENAME}); + $line_no = Term::ANSIColor::colored($line_no, + $ENV{ACK_COLOR_LINENO}); + } + + if($print_filename) { + if( $heading ) { + push @line_parts, $line_no; + } + else { + push @line_parts, $filename, $line_no; + } + + if( $print_column ) { + push @line_parts, get_match_column(); + } + } + if( $output_expr ) { + while ( $line =~ /$opt->{regex}/og ) { + my $output = eval $output_expr; + App::Ack::print( join( $separator, @line_parts, $output ), $ors ); + } + } + else { + if ( $color ) { + $line =~ /$opt->{regex}/o; # this match is redundant, but we need + # to perfom it in order to get if + # capture groups are set + + if ( @+ > 1 ) { # if we have captures + while ( $line =~ /$opt->{regex}/og ) { + my $offset = 0; # additional offset for when we add stuff + my $previous_match_end = 0; + + for ( my $i = 1; $i < @+; $i++ ) { + my ( $match_start, $match_end ) = ( $-[$i], $+[$i] ); + + next unless defined($match_start); + next if $match_start < $previous_match_end; + + my $substring = substr( $line, + $offset + $match_start, $match_end - $match_start ); + my $substitution = Term::ANSIColor::colored( $substring, + $ENV{ACK_COLOR_MATCH} ); + + substr( $line, $offset + $match_start, + $match_end - $match_start, $substitution ); + + $previous_match_end = $match_end; # offsets do not need to be applied + $offset += length( $substitution ) - length( $substring ); + } + + pos($line) = $+[0] + $offset; + } + } + else { + my $matched = 0; # flag; if matched, need to escape afterwards + + while ( $line =~ /$opt->{regex}/og ) { + + $matched = 1; + my ( $match_start, $match_end ) = ($-[0], $+[0]); + next unless defined($match_start); + + my $substring = substr( $line, $match_start, + $match_end - $match_start ); + my $substitution = Term::ANSIColor::colored( $substring, + $ENV{ACK_COLOR_MATCH} ); + + substr( $line, $match_start, $match_end - $match_start, + $substitution ); + + pos($line) = $match_end + + (length( $substitution ) - length( $substring )); + } + # XXX why do we do this? + $line .= "\033[0m\033[K" if $matched; + } + } + + push @line_parts, $line; + App::Ack::print( join( $separator, @line_parts ), $ors ); + } + + return; +} + +sub iterate { + my ( $resource, $opt, $cb ) = @_; + + $is_iterating = 1; + + local $opt->{before_context} = $opt->{output} ? 0 : $opt->{before_context}; + local $opt->{after_context} = $opt->{output} ? 0 : $opt->{after_context}; + + my $n_before_ctx_lines = $opt->{before_context} || 0; + my $n_after_ctx_lines = $opt->{after_context} || 0; + + @after_ctx_lines = @before_ctx_lines = (); + + my $fh = $resource->open(); + if ( !$fh ) { + if ( $App::Ack::report_bad_filenames ) { + # XXX direct access to filename + App::Ack::warn( "$resource->{filename}: $!" ); + } + return; + } + + # check for context before the main loop, so we don't + # pay for it if we don't need it + if ( $n_before_ctx_lines || $n_after_ctx_lines ) { + my $current_line = <$fh>; # prime the first line of input + + while ( defined $current_line ) { + while ( (@after_ctx_lines < $n_after_ctx_lines) && defined($_ = <$fh>) ) { + push @after_ctx_lines, $_; + } + + local $_ = $current_line; + my $former_dot_period = $.; + $. -= @after_ctx_lines; + + last unless $cb->(); + + # I tried doing this with local(), but for some reason, + # $. continued to have its new value after the exit of the + # enclosing block. I'm guessing that $. has some extra + # magic associated with it or something. If someone can + # tell me why this happened, I would love to know! + $. = $former_dot_period; # XXX this won't happen on an exception + + if ( $n_before_ctx_lines ) { + push @before_ctx_lines, $current_line; + shift @before_ctx_lines while @before_ctx_lines > $n_before_ctx_lines; + } + if ( $n_after_ctx_lines ) { + $current_line = shift @after_ctx_lines; + } + else { + $current_line = <$fh>; + } + } + } + else { + local $_; + + while ( <$fh> ) { + last unless $cb->(); + } + } + + $is_iterating = 0; # XXX this won't happen on an exception + # then again, do we care? ack doesn't really + # handle exceptions anyway. + + return; +} + +sub get_context { + if ( not $is_iterating ) { + Carp::croak( 'get_context() called outside of iterate()' ); + } + + return ( + scalar(@before_ctx_lines) ? \@before_ctx_lines : undef, + scalar(@after_ctx_lines) ? \@after_ctx_lines : undef, + ); +} + +} + +{ + +my $is_first_match; +my $previous_file_processed; +my $previous_line_printed; + +BEGIN { + $is_first_match = 1; + $previous_line_printed = -1; +} + +sub print_line_with_context { + my ( $opt, $filename, $matching_line, $line_no ) = @_; + + my $heading = $opt->{heading}; + + if( !defined($previous_file_processed) || + $previous_file_processed ne $filename ) { + $previous_file_processed = $filename; + $previous_line_printed = -1; + + if( $heading ) { + $is_first_match = 1; + } + } + + my $ors = $opt->{print0} ? "\0" : "\n"; + my $match_word = $opt->{w}; + my $is_tracking_context = $opt->{after_context} || $opt->{before_context}; + my $output_expr = $opt->{output}; + + $matching_line =~ s/[\r\n]+$//g; + + my ( $before_context, $after_context ) = get_context(); + + if ( $before_context ) { + my $first_line = $. - @{$before_context}; + + if ( $first_line <= $previous_line_printed ) { + splice @{$before_context}, 0, $previous_line_printed - $first_line + 1; + $first_line = $. - @{$before_context}; + } + if ( @{$before_context} ) { + my $offset = @{$before_context}; + + if( !$is_first_match && $previous_line_printed != $first_line - 1 ) { + App::Ack::print('--', $ors); + } + foreach my $line (@{$before_context}) { + my $context_line_no = $. - $offset; + if ( $context_line_no <= $previous_line_printed ) { + next; + } + + chomp $line; + local $opt->{column}; + + print_line_with_options($opt, $filename, $line, $context_line_no, '-'); + $previous_line_printed = $context_line_no; + $offset--; + } + } + } + + if ( $. > $previous_line_printed ) { + if( $is_tracking_context && !$is_first_match && $previous_line_printed != $. - 1 ) { + App::Ack::print('--', $ors); + } + + print_line_with_options($opt, $filename, $matching_line, $line_no, ':'); + $previous_line_printed = $.; + } + + if($after_context) { + my $offset = 1; + foreach my $line (@{$after_context}) { + # XXX improve this! + if ( $previous_line_printed >= $. + $offset ) { + $offset++; + next; + } + chomp $line; + + if ( $opt->{regex} && does_match( $opt, $line ) ) { + print_line_with_options($opt, $filename, $line, $. + $offset, ':'); + } + else { + local $opt->{column}; + print_line_with_options($opt, $filename, $line, $. + $offset, '-'); + } + $previous_line_printed = $. + $offset; + $offset++; + } + } + + $is_first_match = 0; + + return; +} + +} + +{ + +my $match_column_number; + +# does_match() MUST have an $opt->{regex} set. + +sub does_match { + my ( $opt, $line ) = @_; + + $match_column_number = undef; + + if ( $opt->{v} ) { + return ( $line !~ /$opt->{regex}/o ); + } + else { + if ( $line =~ /$opt->{regex}/o ) { + # @- = @LAST_MATCH_START + # @+ = @LAST_MATCH_END + $match_column_number = $-[0] + 1; + return 1; + } + else { + return; + } + } +} + +sub get_match_column { + return $match_column_number; +} + +} + +sub resource_has_match { + my ( $resource, $opt ) = @_; + + my $has_match = 0; + my $fh = $resource->open(); + if ( !$fh ) { + if ( $App::Ack::report_bad_filenames ) { + # XXX direct access to filename + App::Ack::warn( "$resource->{filename}: $!" ); + } + } + else { + my $opt_v = $opt->{v}; + my $re = $opt->{regex}; + while ( <$fh> ) { + if (/$re/o xor $opt_v) { + $has_match = 1; + last; + } + } + close $fh; + } + + return $has_match; +} + +sub count_matches_in_resource { + my ( $resource, $opt ) = @_; + + my $nmatches = 0; + my $fh = $resource->open(); + if ( !$fh ) { + if ( $App::Ack::report_bad_filenames ) { + # XXX direct access to filename + App::Ack::warn( "$resource->{filename}: $!" ); + } + } + else { + my $opt_v = $opt->{v}; + my $re = $opt->{regex}; + while ( <$fh> ) { + ++$nmatches if (/$re/o xor $opt_v); + } + close $fh; + } + + return $nmatches; +} + +sub main { + my @arg_sources = App::Ack::ConfigLoader::retrieve_arg_sources(); + + my $opt = App::Ack::ConfigLoader::process_args( @arg_sources ); + + $App::Ack::report_bad_filenames = !$opt->{dont_report_bad_filenames}; + + if ( $opt->{flush} ) { + $| = 1; + } + + if ( !defined($opt->{color}) && !$opt->{g} ) { + my $windows_color = 1; + if ( $App::Ack::is_windows ) { + $windows_color = eval { require Win32::Console::ANSI; } + } + $opt->{color} = !App::Ack::output_to_pipe() && $windows_color; + } + if ( not defined $opt->{heading} and not defined $opt->{break} ) { + $opt->{heading} = $opt->{break} = !App::Ack::output_to_pipe(); + } + + if ( defined($opt->{H}) || defined($opt->{h}) ) { + $opt->{show_filename}= $opt->{H} && !$opt->{h}; + } + + if ( my $output = $opt->{output} ) { + $output =~ s{\\}{\\\\}g; + $output =~ s{"}{\\"}g; + $opt->{output} = qq{"$output"}; + } + + my $resources; + if ( $App::Ack::is_filter_mode && !$opt->{files_from} ) { # probably -x + $resources = App::Ack::Resources->from_stdin( $opt ); + my $regex = $opt->{regex}; + $regex = shift @ARGV if not defined $regex; + $opt->{regex} = build_regex( $regex, $opt ); + } + else { + if ( $opt->{f} || $opt->{lines} ) { + if ( $opt->{regex} ) { + App::Ack::warn( "regex ($opt->{regex}) specified with -f or --lines" ); + App::Ack::exit_from_ack( 0 ); # XXX the 0 is misleading + } + } + else { + my $regex = $opt->{regex}; + $regex = shift @ARGV if not defined $regex; + $opt->{regex} = build_regex( $regex, $opt ); + } + my @start; + if ( not defined $opt->{files_from} ) { + @start = @ARGV; + } + if ( !exists($opt->{show_filename}) ) { + unless(@start == 1 && !(-d $start[0])) { + $opt->{show_filename} = 1; + } + } + + if ( defined $opt->{files_from} ) { + $resources = App::Ack::Resources->from_file( $opt, $opt->{files_from} ); + exit 1 unless $resources; + } + else { + @start = ('.') unless @start; + foreach my $target (@start) { + if ( !-e $target && $App::Ack::report_bad_filenames) { + App::Ack::warn( "$target: No such file or directory" ); + } + } + + $opt->{file_filter} = _compile_file_filter($opt, \@start); + $opt->{descend_filter} = _compile_descend_filter($opt); + + $resources = App::Ack::Resources->from_argv( $opt, \@start ); + } + } + App::Ack::set_up_pager( $opt->{pager} ) if defined $opt->{pager}; + + my $print_filenames = $opt->{show_filename}; + my $max_count = $opt->{m}; + my $ors = $opt->{print0} ? "\0" : "\n"; + my $only_first = $opt->{1}; + + my $nmatches = 0; + my $total_count = 0; +RESOURCES: + while ( my $resource = $resources->next ) { + # XXX this variable name combined with what we're trying + # to do makes no sense. + + # XXX Combine the -f and -g functions + if ( $opt->{f} ) { + # XXX printing should probably happen inside of App::Ack + if ( $opt->{show_types} ) { + show_types( $resource, $ors ); + } + else { + App::Ack::print( $resource->name, $ors ); + } + ++$nmatches; + last RESOURCES if defined($max_count) && $nmatches >= $max_count; + } + elsif ( $opt->{g} ) { + my $is_match = ( $resource->name =~ /$opt->{regex}/o ); + if ( $opt->{v} ? !$is_match : $is_match ) { + if ( $opt->{show_types} ) { + show_types( $resource, $ors ); + } + else { + local $opt->{show_filename} = 0; + + print_line_with_options($opt, '', $resource->name, 0, $ors); + } + ++$nmatches; + last RESOURCES if defined($max_count) && $nmatches >= $max_count; + } + } + elsif ( $opt->{lines} ) { + my $print_filename = $opt->{show_filename}; + my $passthru = $opt->{passthru}; + + my %line_numbers; + foreach my $line ( @{ $opt->{lines} } ) { + my @lines = split /,/, $line; + @lines = map { + /^(\d+)-(\d+)$/ + ? ( $1 .. $2 ) + : $_ + } @lines; + @line_numbers{@lines} = (1) x @lines; + } + + my $filename = $resource->name; + + local $opt->{color} = 0; + + iterate($resource, $opt, sub { + chomp; + + if ( $line_numbers{$.} ) { + print_line_with_context($opt, $filename, $_, $.); + } + elsif ( $passthru ) { + print_line_with_options($opt, $filename, $_, $., ':'); + } + return 1; + }); + } + elsif ( $opt->{count} ) { + my $matches_for_this_file = count_matches_in_resource( $resource, $opt ); + + unless ( $opt->{show_filename} ) { + $total_count += $matches_for_this_file; + next RESOURCES; + } + + if ( !$opt->{l} || $matches_for_this_file > 0) { + if ( $print_filenames ) { + App::Ack::print( $resource->name, ':', $matches_for_this_file, $ors ); + } + else { + App::Ack::print( $matches_for_this_file, $ors ); + } + } + } + elsif ( $opt->{l} || $opt->{L} ) { + my $is_match = resource_has_match( $resource, $opt ); + + if ( $opt->{L} ? !$is_match : $is_match ) { + App::Ack::print( $resource->name, $ors ); + ++$nmatches; + + last RESOURCES if $only_first; + last RESOURCES if defined($max_count) && $nmatches >= $max_count; + } + } + else { + $nmatches += print_matches_in_resource( $resource, $opt ); + if ( $nmatches && $only_first ) { + last RESOURCES; + } + } + } + + if ( $opt->{count} && !$opt->{show_filename} ) { + App::Ack::print( $total_count, "\n" ); + } + + close $App::Ack::fh; + App::Ack::exit_from_ack( $nmatches ); +} + + + +=head1 NAME + +ack - grep-like text finder + +=head1 SYNOPSIS + + ack [options] PATTERN [FILE...] + ack -f [options] [DIRECTORY...] + +=head1 DESCRIPTION + +Ack is designed as a replacement for 99% of the uses of F<grep>. + +Ack searches the named input FILEs (or standard input if no files +are named, or the file name - is given) for lines containing a match +to the given PATTERN. By default, ack prints the matching lines. + +PATTERN is a Perl regular expression. Perl regular expressions +are commonly found in other programming languages, but for the particulars +of their behavior, please consult +L<http://perldoc.perl.org/perlreref.html|perlreref>. If you don't know +how to use regular expression but are interested in learning, you may +consult L<http://perldoc.perl.org/perlretut.html|perlretut>. If you do not +need or want ack to use regular expressions, please see the +C<-Q>/C<--literal> option. + +Ack can also list files that would be searched, without actually +searching them, to let you take advantage of ack's file-type filtering +capabilities. + +=head1 FILE SELECTION + +If files are not specified for searching, either on the command +line or piped in with the C<-x> option, I<ack> delves into +subdirectories selecting files for searching. + +I<ack> is intelligent about the files it searches. It knows about +certain file types, based on both the extension on the file and, +in some cases, the contents of the file. These selections can be +made with the B<--type> option. + +With no file selection, I<ack> searches through regular files that +are not explicitly excluded by B<--ignore-dir> and B<--ignore-file> +options, either present in F<ackrc> files or on the command line. + +The default options for I<ack> ignore certain files and directories. These +include: + +=over 4 + +=item * Backup files: Files matching F<#*#> or ending with F<~>. + +=item * Coredumps: Files matching F<core.\d+> + +=item * Version control directories like F<.svn> and F<.git>. + +=back + +Run I<ack> with the C<--dump> option to see what settings are set. + +However, I<ack> always searches the files given on the command line, +no matter what type. If you tell I<ack> to search in a coredump, +it will search in a coredump. + +=head1 DIRECTORY SELECTION + +I<ack> descends through the directory tree of the starting directories +specified. If no directories are specified, the current working directory is +used. However, it will ignore the shadow directories used by +many version control systems, and the build directories used by the +Perl MakeMaker system. You may add or remove a directory from this +list with the B<--[no]ignore-dir> option. The option may be repeated +to add/remove multiple directories from the ignore list. + +For a complete list of directories that do not get searched, run +C<ack --dump>. + +=head1 WHEN TO USE GREP + +I<ack> trumps I<grep> as an everyday tool 99% of the time, but don't +throw I<grep> away, because there are times you'll still need it. + +E.g., searching through huge files looking for regexes that can be +expressed with I<grep> syntax should be quicker with I<grep>. + +If your script or parent program uses I<grep> C<--quiet> or C<--silent> +or needs exit 2 on IO error, use I<grep>. + +=head1 OPTIONS + +=over 4 + +=item B<--ackrc> + +Specifies an ackrc file to load after all others; see L</"ACKRC LOCATION SEMANTICS">. + +=item B<-A I<NUM>>, B<--after-context=I<NUM>> + +Print I<NUM> lines of trailing context after matching lines. + +=item B<-B I<NUM>>, B<--before-context=I<NUM>> + +Print I<NUM> lines of leading context before matching lines. + +=item B<--[no]break> + +Print a break between results from different files. On by default +when used interactively. + +=item B<-C [I<NUM>]>, B<--context[=I<NUM>]> + +Print I<NUM> lines (default 2) of context around matching lines. + +=item B<-c>, B<--count> + +Suppress normal output; instead print a count of matching lines for +each input file. If B<-l> is in effect, it will only show the +number of lines for each file that has lines matching. Without +B<-l>, some line counts may be zeroes. + +If combined with B<-h> (B<--no-filename>) ack outputs only one total +count. + +=item B<--[no]color>, B<--[no]colour> + +B<--color> highlights the matching text. B<--nocolor> suppresses +the color. This is on by default unless the output is redirected. + +On Windows, this option is off by default unless the +L<Win32::Console::ANSI> module is installed or the C<ACK_PAGER_COLOR> +environment variable is used. + +=item B<--color-filename=I<color>> + +Sets the color to be used for filenames. + +=item B<--color-match=I<color>> + +Sets the color to be used for matches. + +=item B<--color-lineno=I<color>> + +Sets the color to be used for line numbers. + +=item B<--[no]column> + +Show the column number of the first match. This is helpful for +editors that can place your cursor at a given position. + +=item B<--create-ackrc> + +Dumps the default ack options to standard output. This is useful for +when you want to customize the defaults. + +=item B<--dump> + +Writes the list of options loaded and where they came from to standard +output. Handy for debugging. + +=item B<--[no]env> + +B<--noenv> disables all environment processing. No F<.ackrc> is +read and all environment variables are ignored. By default, F<ack> +considers F<.ackrc> and settings in the environment. + +=item B<--flush> + +B<--flush> flushes output immediately. This is off by default +unless ack is running interactively (when output goes to a pipe or +file). + +=item B<-f> + +Only print the files that would be searched, without actually doing +any searching. PATTERN must not be specified, or it will be taken +as a path to search. + +=item B<--files-from=I<FILE>> + +The list of files to be searched is specified in I<FILE>. The list of +files are separated by newlines. If I<FILE> is C<->, the list is loaded +from standard input. + +=item B<--[no]filter> + +Forces ack to act as if it were receiving input via a pipe. + +=item B<--[no]follow> + +Follow or don't follow symlinks, other than whatever starting files +or directories were specified on the command line. + +This is off by default. + +=item B<-g I<PATTERN>> + +Print files where the relative path + filename matches I<PATTERN>. +This option can be combined with B<--color> to make it easier to spot +the match. + +=item B<--[no]group> + +B<--group> groups matches by file name. This is the default +when used interactively. + +B<--nogroup> prints one result per line, like grep. This is the +default when output is redirected. + +=item B<-H>, B<--with-filename> + +Print the filename for each match. This is the default unless searching +a single explicitly specified file. + +=item B<-h>, B<--no-filename> + +Suppress the prefixing of filenames on output when multiple files are +searched. + +=item B<--[no]heading> + +Print a filename heading above each file's results. This is the default +when used interactively. + +=item B<--help>, B<-?> + +Print a short help statement. + +=item B<--help-types>, B<--help=types> + +Print all known types. + +=item B<-i>, B<--ignore-case> + +Ignore case distinctions in PATTERN + +=item B<--ignore-ack-defaults> + +Tells ack to completely ignore the default definitions provided with ack. +This is useful in combination with B<--create-ackrc> if you I<really> want +to customize ack. + +=item B<--[no]ignore-dir=I<DIRNAME>>, B<--[no]ignore-directory=I<DIRNAME>> + +Ignore directory (as CVS, .svn, etc are ignored). May be used +multiple times to ignore multiple directories. For example, mason +users may wish to include B<--ignore-dir=data>. The B<--noignore-dir> +option allows users to search directories which would normally be +ignored (perhaps to research the contents of F<.svn/props> directories). + +The I<DIRNAME> must always be a simple directory name. Nested +directories like F<foo/bar> are NOT supported. You would need to +specify B<--ignore-dir=foo> and then no files from any foo directory +are taken into account by ack unless given explicitly on the command +line. + +=item B<--ignore-file=I<FILTERTYPE:FILTERARGS>> + +Ignore files matching I<FILTERTYPE:FILTERARGS>. The filters are specified +identically to file type filters as seen in L</"Defining your own types">. + +=item B<-k>, B<--known-types> + +Limit selected files to those with types that ack knows about. This is +equivalent to the default behavior found in ack 1. + +=item B<--lines=I<NUM>> + +Only print line I<NUM> of each file. Multiple lines can be given with multiple +B<--lines> options or as a comma separated list (B<--lines=3,5,7>). B<--lines=4-7> +also works. The lines are always output in ascending order, no matter the +order given on the command line. + +=item B<-l>, B<--files-with-matches> + +Only print the filenames of matching files, instead of the matching text. + +=item B<-L>, B<--files-without-matches> + +Only print the filenames of files that do I<NOT> match. + +=item B<--match I<PATTERN>> + +Specify the I<PATTERN> explicitly. This is helpful if you don't want to put the +regex as your first argument, e.g. when executing multiple searches over the +same set of files. + + # search for foo and bar in given files + ack file1 t/file* --match foo + ack file1 t/file* --match bar + +=item B<-m=I<NUM>>, B<--max-count=I<NUM>> + +Stop reading a file after I<NUM> matches. + +=item B<--man> + +Print this manual page. + +=item B<-n>, B<--no-recurse> + +No descending into subdirectories. + +=item B<-o> + +Show only the part of each line matching PATTERN (turns off text +highlighting) + +=item B<--output=I<expr>> + +Output the evaluation of I<expr> for each line (turns off text +highlighting) +If PATTERN matches more than once then a line is output for each non-overlapping match. +For more information please see the section L</"Examples of F<--output>">. + +=item B<--pager=I<program>>, B<--nopager> + +B<--pager> directs ack's output through I<program>. This can also be specified +via the C<ACK_PAGER> and C<ACK_PAGER_COLOR> environment variables. + +Using --pager does not suppress grouping and coloring like piping +output on the command-line does. + +B<--nopager> cancels any setting in ~/.ackrc, C<ACK_PAGER> or C<ACK_PAGER_COLOR>. +No output will be sent through a pager. + +=item B<--passthru> + +Prints all lines, whether or not they match the expression. Highlighting +will still work, though, so it can be used to highlight matches while +still seeing the entire file, as in: + + # Watch a log file, and highlight a certain IP address + $ tail -f ~/access.log | ack --passthru 123.45.67.89 + +=item B<--print0> + +Only works in conjunction with -f, -g, -l or -c (filename output). The filenames +are output separated with a null byte instead of the usual newline. This is +helpful when dealing with filenames that contain whitespace, e.g. + + # remove all files of type html + ack -f --html --print0 | xargs -0 rm -f + +=item B<-Q>, B<--literal> + +Quote all metacharacters in PATTERN, it is treated as a literal. + +=item B<-r>, B<-R>, B<--recurse> + +Recurse into sub-directories. This is the default and just here for +compatibility with grep. You can also use it for turning B<--no-recurse> off. + +=item B<-s> + +Suppress error messages about nonexistent or unreadable files. This is taken +from fgrep. + +=item B<--[no]smart-case>, B<--no-smart-case> + +Ignore case in the search strings if PATTERN contains no uppercase +characters. This is similar to C<smartcase> in vim. This option is +off by default, and ignored if C<-i> is specified. + +B<-i> always overrides this option. + +=item B<--sort-files> + +Sorts the found files lexicographically. Use this if you want your file +listings to be deterministic between runs of I<ack>. + +=item B<--show-types> + +Outputs the filetypes that ack associates with each file. + +Works with B<-f> and B<-g> options. + +=item B<--type=[no]TYPE> + +Specify the types of files to include or exclude from a search. +TYPE is a filetype, like I<perl> or I<xml>. B<--type=perl> can +also be specified as B<--perl>, and B<--type=noperl> can be done +as B<--noperl>. + +If a file is of both type "foo" and "bar", specifying --foo and +--nobar will exclude the file, because an exclusion takes precedence +over an inclusion. + +Type specifications can be repeated and are ORed together. + +See I<ack --help=types> for a list of valid types. + +=item B<--type-add I<TYPE>:I<FILTER>:I<FILTERARGS>> + +Files with the given FILTERARGS applied to the given FILTER +are recognized as being of (the existing) type TYPE. +See also L</"Defining your own types">. + + +=item B<--type-set I<TYPE>:I<FILTER>:I<FILTERARGS>> + +Files with the given FILTERARGS applied to the given FILTER are recognized as +being of type TYPE. This replaces an existing definition for type TYPE. See +also L</"Defining your own types">. + +=item B<--type-del I<TYPE>> + +The filters associated with TYPE are removed from Ack, and are no longer considered +for searches. + +=item B<-v>, B<--invert-match> + +Invert match: select non-matching lines + +=item B<--version> + +Display version and copyright information. + +=item B<-w>, B<--word-regexp> + +Force PATTERN to match only whole words. The PATTERN is wrapped with +C<\b> metacharacters. + +=item B<-x> + +An abbreviation for B<--files-from=->; the list of files to search are read +from standard input, with one line per file. + +=item B<-1> + +Stops after reporting first match of any kind. This is different +from B<--max-count=1> or B<-m1>, where only one match per file is +shown. Also, B<-1> works with B<-f> and B<-g>, where B<-m> does +not. + +=item B<--thpppt> + +Display the all-important Bill The Cat logo. Note that the exact +spelling of B<--thpppppt> is not important. It's checked against +a regular expression. + +=item B<--bar> + +Check with the admiral for traps. + +=item B<--cathy> + +Chocolate, Chocolate, Chocolate! + +=back + +=head1 THE .ackrc FILE + +The F<.ackrc> file contains command-line options that are prepended +to the command line before processing. Multiple options may live +on multiple lines. Lines beginning with a # are ignored. A F<.ackrc> +might look like this: + + # Always sort the files + --sort-files + + # Always color, even if piping to a another program + --color + + # Use "less -r" as my pager + --pager=less -r + +Note that arguments with spaces in them do not need to be quoted, +as they are not interpreted by the shell. Basically, each I<line> +in the F<.ackrc> file is interpreted as one element of C<@ARGV>. + +F<ack> looks in several locations for F<.ackrc> files; the searching +process is detailed in L</"ACKRC LOCATION SEMANTICS">. These +files are not considered if B<--noenv> is specified on the command line. + +=head1 Defining your own types + +ack allows you to define your own types in addition to the predefined +types. This is done with command line options that are best put into +an F<.ackrc> file - then you do not have to define your types over and +over again. In the following examples the options will always be shown +on one command line so that they can be easily copy & pasted. + +I<ack --perl foo> searches for foo in all perl files. I<ack --help=types> +tells you, that perl files are files ending +in .pl, .pm, .pod or .t. So what if you would like to include .xs +files as well when searching for --perl files? I<ack --type-add perl:ext:xs --perl foo> +does this for you. B<--type-add> appends +additional extensions to an existing type. + +If you want to define a new type, or completely redefine an existing +type, then use B<--type-set>. I<ack --type-set eiffel:ext:e,eiffel> defines +the type I<eiffel> to include files with +the extensions .e or .eiffel. So to search for all eiffel files +containing the word Bertrand use I<ack --type-set eiffel:ext:e,eiffel --eiffel Bertrand>. +As usual, you can also write B<--type=eiffel> +instead of B<--eiffel>. Negation also works, so B<--noeiffel> excludes +all eiffel files from a search. Redefining also works: I<ack --type-set cc:ext:c,h> +and I<.xs> files no longer belong to the type I<cc>. + +When defining your own types in the F<.ackrc> file you have to use +the following: + + --type-set=eiffel:ext:e,eiffel + +or writing on separate lines + + --type-set + eiffel:ext:e,eiffel + +The following does B<NOT> work in the F<.ackrc> file: + + --type-set eiffel:ext:e,eiffel + + +In order to see all currently defined types, use I<--help-types>, e.g. +I<ack --type-set backup:ext:bak --type-add perl:ext:perl --help-types> + +In addition to filtering based on extension (like ack 1.x allowed), ack 2 +offers additional filter types. The generic syntax is +I<--type-set TYPE:FILTER:FILTERARGS>; I<FILTERARGS> depends on the value +of I<FILTER>. + +=over 4 + +=item is:I<FILENAME> + +I<is> filters match the target filename exactly. It takes exactly one +argument, which is the name of the file to match. + +Example: + + --type-set make:is:Makefile + +=item ext:I<EXTENSION>[,I<EXTENSION2>[,...]] + +I<ext> filters match the extension of the target file against a list +of extensions. No leading dot is needed for the extensions. + +Example: + + --type-set perl:ext:pl,pm,t + +=item match:I<PATTERN> + +I<match> filters match the target filename against a regular expression. +The regular expression is made case insensitive for the search. + +Example: + + --type-set make:match:/(gnu)?makefile/ + +=item firstlinematch:I<PATTERN> + +I<firstlinematch> matches the first line of the target file against a +regular expression. Like I<match>, the regular expression is made +case insensitive. + +Example: + + --type-add perl:firstlinematch:/perl/ + +=back + +More filter types may be made available in the future. + +=head1 ENVIRONMENT VARIABLES + +For commonly-used ack options, environment variables can make life +much easier. These variables are ignored if B<--noenv> is specified +on the command line. + +=over 4 + +=item ACKRC + +Specifies the location of the user's F<.ackrc> file. If this file doesn't +exist, F<ack> looks in the default location. + +=item ACK_OPTIONS + +This variable specifies default options to be placed in front of +any explicit options on the command line. + +=item ACK_COLOR_FILENAME + +Specifies the color of the filename when it's printed in B<--group> +mode. By default, it's "bold green". + +The recognized attributes are clear, reset, dark, bold, underline, +underscore, blink, reverse, concealed black, red, green, yellow, +blue, magenta, on_black, on_red, on_green, on_yellow, on_blue, +on_magenta, on_cyan, and on_white. Case is not significant. +Underline and underscore are equivalent, as are clear and reset. +The color alone sets the foreground color, and on_color sets the +background color. + +This option can also be set with B<--color-filename>. + +=item ACK_COLOR_MATCH + +Specifies the color of the matching text when printed in B<--color> +mode. By default, it's "black on_yellow". + +This option can also be set with B<--color-match>. + +See B<ACK_COLOR_FILENAME> for the color specifications. + +=item ACK_COLOR_LINENO + +Specifies the color of the line number when printed in B<--color> +mode. By default, it's "bold yellow". + +This option can also be set with B<--color-lineno>. + +See B<ACK_COLOR_FILENAME> for the color specifications. + +=item ACK_PAGER + +Specifies a pager program, such as C<more>, C<less> or C<most>, to which +ack will send its output. + +Using C<ACK_PAGER> does not suppress grouping and coloring like +piping output on the command-line does, except that on Windows +ack will assume that C<ACK_PAGER> does not support color. + +C<ACK_PAGER_COLOR> overrides C<ACK_PAGER> if both are specified. + +=item ACK_PAGER_COLOR + +Specifies a pager program that understands ANSI color sequences. +Using C<ACK_PAGER_COLOR> does not suppress grouping and coloring +like piping output on the command-line does. + +If you are not on Windows, you never need to use C<ACK_PAGER_COLOR>. + +=back + +=head1 ACK & OTHER TOOLS + +=head2 Vim integration + +F<ack> integrates easily with the Vim text editor. Set this in your +F<.vimrc> to use F<ack> instead of F<grep>: + + set grepprg=ack\ -k + +That example uses C<-k> to search through only files of the types ack +knows about, but you may use other default flags. Now you can search +with F<ack> and easily step through the results in Vim: + + :grep Dumper perllib + +Miles Sterrett has written a Vim plugin for F<ack> which allows you to use +C<:Ack> instead of C<:grep>, as well as several other advanced features. + +L<https://github.com/mileszs/ack.vim> + +=head2 Emacs integration + +Phil Jackson put together an F<ack.el> extension that "provides a +simple compilation mode ... has the ability to guess what files you +want to search for based on the major-mode." + +L<http://www.shellarchive.co.uk/content/emacs.html> + +=head2 TextMate integration + +Pedro Melo is a TextMate user who writes "I spend my day mostly +inside TextMate, and the built-in find-in-project sucks with large +projects. So I hacked a TextMate command that was using find + +grep to use ack. The result is the Search in Project with ack, and +you can find it here: +L<http://www.simplicidade.org/notes/archives/2008/03/search_in_proje.html>" + +=head2 Shell and Return Code + +For greater compatibility with I<grep>, I<ack> in normal use returns +shell return or exit code of 0 only if something is found and 1 if +no match is found. + +(Shell exit code 1 is C<$?=256> in perl with C<system> or backticks.) + +The I<grep> code 2 for errors is not used. + +If C<-f> or C<-g> are specified, then 0 is returned if at least one +file is found. If no files are found, then 1 is returned. + +=cut + +=head1 DEBUGGING ACK PROBLEMS + +If ack gives you output you're not expecting, start with a few simple steps. + +=head2 Use B<--noenv> + +Your environment variables and F<.ackrc> may be doing things you're +not expecting, or forgotten you specified. Use B<--noenv> to ignore +your environment and F<.ackrc>. + +=head2 Use B<-f> to see what files have been selected + +Ack's B<-f> was originally added as a debugging tool. If ack is +not finding matches you think it should find, run F<ack -f> to see +what files have been selected. You can also add the C<--show-types> +options to show the type of each file selected. + +=head2 Use B<--dump> + +This lists the ackrc files that are loaded and the options loaded +from them. +So for example you can find a list of directories that do not get searched or where filetypes are defined. + +=head1 TIPS + +=head2 Use the F<.ackrc> file. + +The F<.ackrc> is the place to put all your options you use most of +the time but don't want to remember. Put all your --type-add and +--type-set definitions in it. If you like --smart-case, set it +there, too. I also set --sort-files there. + +=head2 Use F<-f> for working with big codesets + +Ack does more than search files. C<ack -f --perl> will create a +list of all the Perl files in a tree, ideal for sending into F<xargs>. +For example: + + # Change all "this" to "that" in all Perl files in a tree. + ack -f --perl | xargs perl -p -i -e's/this/that/g' + +or if you prefer: + + perl -p -i -e's/this/that/g' $(ack -f --perl) + +=head2 Use F<-Q> when in doubt about metacharacters + +If you're searching for something with a regular expression +metacharacter, most often a period in a filename or IP address, add +the -Q to avoid false positives without all the backslashing. See +the following example for more... + +=head2 Use ack to watch log files + +Here's one I used the other day to find trouble spots for a website +visitor. The user had a problem loading F<troublesome.gif>, so I +took the access log and scanned it with ack twice. + + ack -Q aa.bb.cc.dd /path/to/access.log | ack -Q -B5 troublesome.gif + +The first ack finds only the lines in the Apache log for the given +IP. The second finds the match on my troublesome GIF, and shows +the previous five lines from the log in each case. + +=head2 Examples of F<--output> + +Following variables are useful in the expansion string: + +=over 4 + +=item C<$&> + +The whole string matched by PATTERN. + +=item C<$1>, C<$2>, ... + +The contents of the 1st, 2nd ... bracketed group in PATTERN. + +=item C<$`> + +The string before the match. + +=item C<$'> + +The string after the match. + +=back + +For more details and other variables see +L<http://perldoc.perl.org/perlvar.html#Variables-related-to-regular-expressions|perlvar>. + +This example shows how to add text around a particular pattern +(in this case adding _ around word with "e") + + ack2.pl "\w*e\w*" quick.txt --output="$`_$&_$'" + _The_ quick brown fox jumps over the lazy dog + The quick brown fox jumps _over_ the lazy dog + The quick brown fox jumps over _the_ lazy dog + +This shows how to pick out particular parts of a match using ( ) within regular expression. + + ack '=head(\d+)\s+(.*)' --output=' $1 : $2' + input file contains "=head1 NAME" + output "1 : NAME" + +=head2 Share your knowledge + +Join the ack-users mailing list. Send me your tips and I may add +them here. + +=head1 FAQ + +=head2 Why isn't ack finding a match in (some file)? + +Probably because it's of a type that ack doesn't recognize. ack's +searching behavior is driven by filetype. B<If ack doesn't know +what kind of file it is, ack ignores the file.> + +Use the C<-f> switch to see a list of files that ack will search +for you. You can use the C<--show-types> switch to show which type +ack thinks each file is. + +=head2 Wouldn't it be great if F<ack> did search & replace? + +No, ack will always be read-only. Perl has a perfectly good way +to do search & replace in files, using the C<-i>, C<-p> and C<-n> +switches. + +You can certainly use ack to select your files to update. For +example, to change all "foo" to "bar" in all PHP files, you can do +this from the Unix shell: + + $ perl -i -p -e's/foo/bar/g' $(ack -f --php) + +=head2 Can I make ack recognize F<.xyz> files? + +Yes! Please see L</"Defining your own types">. If you think +that F<ack> should recognize a type by default, please see +L</"ENHANCEMENTS">. + +=head2 There's already a program/package called ack. + +Yes, I know. + +=head2 Why is it called ack if it's called ack-grep? + +The name of the program is "ack". Some packagers have called it +"ack-grep" when creating packages because there's already a package +out there called "ack" that has nothing to do with this ack. + +I suggest you make a symlink named F<ack> that points to F<ack-grep> +because one of the crucial benefits of ack is having a name that's +so short and simple to type. + +To do that, run this with F<sudo> or as root: + + ln -s /usr/bin/ack-grep /usr/bin/ack + +Alternatively, you could use a shell alias: + + # bash/zsh + alias ack=ack-grep + + # csh + alias ack ack-grep + +=head2 What does F<ack> mean? + +Nothing. I wanted a name that was easy to type and that you could +pronounce as a single syllable. + +=head2 Can I do multi-line regexes? + +No, ack does not support regexes that match multiple lines. Doing +so would require reading in the entire file at a time. + +If you want to see lines near your match, use the C<--A>, C<--B> +and C<--C> switches for displaying context. + +=head2 Why is ack telling me I have an invalid option when searching for C<+foo>? + +ack treats command line options beginning with C<+> or C<-> as options; if you +would like to search for these, you may prefix your search term with C<--> or +use the C<--match> option. (However, don't forget that C<+> is a regular +expression metacharacter!) + +=head2 Why does C<"ack '.{40000,}'"> fail? Isn't that a valid regex? + +The Perl language limits the repetition quanitifier to 32K. You +can search for C<.{32767}> but not C<.{32768}>. + +=head1 ACKRC LOCATION SEMANTICS + +Ack can load its configuration from many sources. This list +specifies the sources Ack looks for configuration; each one +that is found is loaded in the order specified here, and +each one overrides options set in any of the sources preceding +it. (For example, if I set --sort-files in my user ackrc, and +--nosort-files on the command line, the command line takes +precedence) + +=over 4 + +=item * + +Defaults are loaded from App::Ack::ConfigDefaults. This can be omitted +using C<--ignore-ack-defaults>. + +=item * Global ackrc + +Options are then loaded from the global ackrc. This is located at +C</etc/ackrc> on Unix-like systems, and +C<C:\Documents and Settings\All Users\Application Data\ackrc> on Windows. +This can be omitted using C<--noenv>. + +=item * User ackrc + +Options are then loaded from the user's ackrc. This is located at +C<$HOME/.ackrc> on Unix-like systems, and +C<C:\Documents and Settings\$USER\Application Data\ackrc>. If a different +ackrc is desired, it may be overridden with the C<$ACKRC> environment +variable. +This can be omitted using C<--noenv>. + +=item * Project ackrc + +Options are then loaded from the project ackrc. The project ackrc is +the first ackrc file with the name C<.ackrc> or C<_ackrc>, first searching +in the current directory, then the parent directory, then the grandparent +directory, etc. This can be omitted using C<--noenv>. + +=item * --ackrc + +The C<--ackrc> option may be included on the command line to specify an +ackrc file that can override all others. It is consulted even if C<--noenv> +is present. + +=item * ACK_OPTIONS + +Options are then loaded from the environment variable C<ACK_OPTIONS>. This can +be omitted using C<--noenv>. + +=item * Command line + +Options are then loaded from the command line. + +=back + +=head1 DIFFERENCES BETWEEN ACK 1.X AND ACK 2.X + +A lot of changes were made for ack 2; here is a list of them. + +=head2 GENERAL CHANGES + +=over 4 + +=item * + +When no selectors are specified, ack 1.x only searches through files that +it can map to a file type. ack 2.x, by contrast, will search through +every regular, non-binary file that is not explicitly ignored via +B<--ignore-file> or B<--ignore-dir>. This is similar to the behavior of the +B<-a/--all> option in ack 1.x. + +=item * + +A more flexible filter system has been added, so that more powerful file types +may be created by the user. For details, please consult +L</"Defining your own types">. + +=item * + +ack now loads multiple ackrc files; see L</"ACKRC LOCATION SEMANTICS"> for +details. + +=item * + +ack's default filter definitions aren't special; you may tell ack to +completely disregard them if you don't like them. + +=back + +=head2 REMOVED OPTIONS + +=over 4 + +=item * + +Because of the change in default search behavior, the B<-a/--all> and +B<-u/--unrestricted> options have been removed. In addition, the +B<-k/--known-types> option was added to cause ack to behave with +the default search behavior of ack 1.x. + +=item * + +The B<-G> option has been removed. Two regular expressions on the +command line was considered too confusing; to simulate B<-G>'s functionality, +you may use the new B<-x> option to pipe filenames from one invocation of +ack into another. + +=item * + +The B<--binary> option has been removed. + +=item * + +The B<--skipped> option has been removed. + +=item * + +The B<--text> option has been removed. + +=item * + +The B<--invert-file-match> option has been removed. Instead, you may +use B<-v> with B<-g>. + +=back + +=head2 CHANGED OPTIONS + +=over 4 + +=item * + +The options that modify the regular expression's behavior (B<-i>, B<-w>, +B<-Q>, and B<-v>) may now be used with B<-g>. + +=back + +=head2 ADDED OPTIONS + +=over 4 + +=item * + +B<--files-from> was added so that a user may submit a list of filenames as +a list of files to search. + +=item * + +B<-x> was added to tell ack to accept a list of filenames via standard input; +this list is the list of filenames that will be used for the search. + +=item * + +B<-s> was added to tell ack to suppress error messages about non-existent or +unreadable files. + +=item * + +B<--ignore-directory> and B<--noignore-directory> were added as aliases for +B<--ignore-dir> and B<--noignore-dir> respectively. + +=item * + +B<--ignore-file> was added so that users may specify patterns of files to +ignore (ex. /.*~$/). + +=item * + +B<--dump> was added to allow users to easily find out which options are +set where. + +=item * + +B<--create-ackrc> was added so that users may create custom ackrc files based +on the default settings loaded by ack, and so that users may easily view those +defaults. + +=item * + +B<--type-del> was added to selectively remove file type definitions. + +=item * + +B<--ignore-ack-defaults> was added so that users may ignore ack's default +options in favor of their own. + +=item * + +B<--bar> was added so ack users may consult Admiral Ackbar. + +=back + +=head1 AUTHOR + +Andy Lester, C<< <andy at petdance.com> >> + +=head1 BUGS + +Please report any bugs or feature requests to the issues list at +Github: L<https://github.com/petdance/ack2/issues> + +=head1 ENHANCEMENTS + +All enhancement requests MUST first be posted to the ack-users +mailing list at L<http://groups.google.com/group/ack-users>. I +will not consider a request without it first getting seen by other +ack users. This includes requests for new filetypes. + +There is a list of enhancements I want to make to F<ack> in the ack +issues list at Github: L<https://github.com/petdance/ack2/issues> + +Patches are always welcome, but patches with tests get the most +attention. + +=head1 SUPPORT + +Support for and information about F<ack> can be found at: + +=over 4 + +=item * The ack homepage + +L<http://beyondgrep.com/> + +=item * The ack-users mailing list + +L<http://groups.google.com/group/ack-users> + +=item * The ack issues list at Github + +L<https://github.com/petdance/ack2/issues> + +=item * AnnoCPAN: Annotated CPAN documentation + +L<http://annocpan.org/dist/ack> + +=item * CPAN Ratings + +L<http://cpanratings.perl.org/d/ack> + +=item * Search CPAN + +L<http://search.cpan.org/dist/ack> + +=item * Git source repository + +L<https://github.com/petdance/ack2> + +=back + +=head1 ACKNOWLEDGEMENTS + +How appropriate to have I<ack>nowledgements! + +Thanks to everyone who has contributed to ack in any way, including +Fraser Tweedale, +RaE<aacute>l GundE<aacute>n, +Steffen Jaeckel, +Stephan Hohe, +Michael Beijen, +Alexandr Ciornii, +Christian Walde, +Charles Lee, +Joe McMahon, +John Warwick, +David Steinbrunner, +Kara Martens, +Volodymyr Medvid, +Ron Savage, +Konrad Borowski, +Dale Sedivic, +Michael McClimon, +Andrew Black, +Ralph Bodenner, +Shaun Patterson, +Ryan Olson, +Shlomi Fish, +Karen Etheridge, +Olivier Mengue, +Matthew Wild, +Scott Kyle, +Nick Hooey, +Bo Borgerson, +Mark Szymanski, +Marq Schneider, +Packy Anderson, +JR Boyens, +Dan Sully, +Ryan Niebur, +Kent Fredric, +Mike Morearty, +Ingmar Vanhassel, +Eric Van Dewoestine, +Sitaram Chamarty, +Adam James, +Richard Carlsson, +Pedro Melo, +AJ Schuster, +Phil Jackson, +Michael Schwern, +Jan Dubois, +Christopher J. Madsen, +Matthew Wickline, +David Dyck, +Jason Porritt, +Jjgod Jiang, +Thomas Klausner, +Uri Guttman, +Peter Lewis, +Kevin Riggle, +Ori Avtalion, +Torsten Blix, +Nigel Metheringham, +GE<aacute>bor SzabE<oacute>, +Tod Hagan, +Michael Hendricks, +E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason, +Piers Cawley, +Stephen Steneker, +Elias Lutfallah, +Mark Leighton Fisher, +Matt Diephouse, +Christian Jaeger, +Bill Sully, +Bill Ricker, +David Golden, +Nilson Santos F. Jr, +Elliot Shank, +Merijn Broeren, +Uwe Voelker, +Rick Scott, +Ask BjE<oslash>rn Hansen, +Jerry Gay, +Will Coleda, +Mike O'Regan, +Slaven ReziE<0x107>, +Mark Stosberg, +David Alan Pisoni, +Adriano Ferreira, +James Keenan, +Leland Johnson, +Ricardo Signes, +Pete Krawczyk and +Rob Hoelz. + +=head1 COPYRIGHT & LICENSE + +Copyright 2005-2013 Andy Lester. + +This program is free software; you can redistribute it and/or modify +it under the terms of the Artistic License v2.0. + +See http://www.perlfoundation.org/artistic_license_2_0 or the LICENSE.md +file that comes with the ack distribution. + +=cut +package App::Ack; + +use warnings; +use strict; + + +our $VERSION; +our $COPYRIGHT; +BEGIN { + $VERSION = '2.12'; + $COPYRIGHT = 'Copyright 2005-2013 Andy Lester.'; +} + +our $fh; + +BEGIN { + $fh = *STDOUT; +} + + +our %types; +our %type_wanted; +our %mappings; +our %ignore_dirs; + +our $is_filter_mode; +our $output_to_pipe; + +our $dir_sep_chars; +our $is_cygwin; +our $is_windows; + +use File::Spec 1.00015 (); + +BEGIN { + # These have to be checked before any filehandle diddling. + $output_to_pipe = not -t *STDOUT; + $is_filter_mode = -p STDIN; + + $is_cygwin = ($^O eq 'cygwin'); + $is_windows = ($^O eq 'MSWin32'); + $dir_sep_chars = $is_windows ? quotemeta( '\\/' ) : quotemeta( File::Spec->catfile( '', '' ) ); +} + + + +sub remove_dir_sep { + my $path = shift; + $path =~ s/[$dir_sep_chars]$//; + + return $path; +} + + + +sub warn { + return CORE::warn( _my_program(), ': ', @_, "\n" ); +} + + +sub die { + return CORE::die( _my_program(), ': ', @_, "\n" ); +} + +sub _my_program { + require File::Basename; + return File::Basename::basename( $0 ); +} + + + +sub filetypes_supported { + return keys %mappings; +} + +sub _get_thpppt { + my $y = q{_ /|,\\'!.x',=(www)=, U }; + $y =~ tr/,x!w/\nOo_/; + return $y; +} + +sub _thpppt { + my $y = _get_thpppt(); + App::Ack::print( "$y ack $_[0]!\n" ); + exit 0; +} + +sub _bar { + my $x; + $x = <<'_BAR'; + 6?!I'7!I"?%+! + 3~!I#7#I"7#I!?!+!="+"="+!:! + 2?#I!7!I!?#I!7!I"+"=%+"=# + 1?"+!?*+!=#~"=!+#?"="+! + 0?"+!?"I"?&+!="~!=!~"=!+%="+" + /I!+!?)+!?!+!=$~!=!~!="+!="+"?!="?! + .?%I"?%+%='?!=#~$=" + ,,!?%I"?(+$=$~!=#:"~$:!~! + ,I!?!I!?"I"?!+#?"+!?!+#="~$:!~!:!~!:!,!:!,":#~! + +I!?&+!="+!?#+$=!~":!~!:!~!:!,!:#,!:!,%:" + *+!I!?!+$=!+!=!+!?$+#=!~":!~":#,$:",#:!,!:! + *I!?"+!?!+!=$+!?#+#=#~":$,!:",!:!,&:" + )I!?$=!~!=#+"?!+!=!+!=!~!="~!:!~":!,'.!,%:!~! + (=!?"+!?!=!~$?"+!?!+!=#~"=",!="~$,$.",#.!:!=! + (I"+"="~"=!+&=!~"=!~!,!~!+!=!?!+!?!=!I!?!+"=!.",!.!,":! + %I$?!+!?!=%+!~!+#~!=!~#:#=!~!+!~!=#:!,%.!,!.!:" + $I!?!=!?!I!+!?"+!=!~!=!~!?!I!?!=!+!=!~#:",!~"=!~!:"~!=!:",&:" '-/ + $?!+!I!?"+"=!+"~!,!:"+#~#:#,"=!~"=!,!~!,!.",!:".!:! */! !I!t!'!s! !a! !g!r!e!p!!! !/! + $+"=!+!?!+"~!=!:!~!:"I!+!,!~!=!:!~!,!:!,$:!~".&:"~!,# (-/ + %~!=!~!=!:!.!+"~!:!,!.!,!~!=!:$.!,":!,!.!:!~!,!:!=!.#="~!,!:" ./! + %=!~!?!+"?"+!=!~",!.!:!?!~!.!:!,!:!,#.!,!:","~!:!=!~!=!:",!~! ./! + %+"~":!~!=#~!:!~!,!.!~!:",!~!=!~!.!:!,!.",!:!,":!=":!.!,!:!7! -/! + %~",!:".#:!=!:!,!:"+!:!~!:!.!,!~!,!.#,!.!,$:"~!,":"~!=! */! + &=!~!=#+!=!~",!.!:",#:#,!.",+:!,!.",!=!+!?! + &~!=!~!=!~!:"~#:",!.!,#~!:!.!+!,!.",$.",$.#,!+!I!?! + &~!="~!:!~":!~",!~!=!~":!,!:!~!,!:!,&.$,#."+!?!I!?!I! + &~!=!~!=!+!,!:!~!:!=!,!:!~&:$,!.!,".!,".!,#."~!+!?$I! + &~!=!~!="~!=!:!~":!,!~%:#,!:",!.!,#.",#I!7"I!?!+!?"I" + &+!I!7!:#~"=!~!:!,!:"~$.!=!.!,!~!,$.#,!~!7!I#?!+!?"I"7! + %7#?!+!~!:!=!~!=!~":!,!:"~":#.!,)7#I"?"I!7& + %7#I!=":!=!~!:"~$:"~!:#,!:!,!:!~!:#,!7#I!?#7) + $7$+!,!~!=#~!:!~!:!~$:#,!.!~!:!=!,":!7#I"?#7+=!?! + $7#I!~!,!~#=!~!:"~!:!,!:!,#:!=!~",":!7$I!?#I!7*+!=!+" + "I!7$I!,":!,!.!=":$,!:!,$:$7$I!+!?"I!7+?"I!7!I!7!,! + !,!7%I!:",!."~":!,&.!,!:!~!I!7$I!+!?"I!7,?!I!7',! + !7(,!.#~":!,%.!,!7%I!7!?#I"7,+!?!7* +7+:!,!~#,"=!7'I!?#I"7/+!7+ +77I!+!7!?!7!I"71+!7, +_BAR + + App::Ack::__pic($x); +} + +sub _cathy { + my $x = <<'CATHY'; + 0+!--+! + 0|! "C!H!O!C!O!L!A!T!E!!! !|! + 0|! "C!H!O!C!O!L!A!T!E!!! !|! + 0|! "C!H!O!C!O!L!A!T!E!!! !|! + 0|! $A"C!K!!! $|! + 0+!--+! + 6\! 1:!,!.! ! + 7\! /.!M!~!Z!M!~! + 8\! /~!D! "M! ! + 4.! $\! /M!~!.!8! +.!M# 4 + 0,!.! (\! .~!M!N! ,+!I!.!M!.! 3 + /?!O!.!M!:! '\! .O!.! +~!Z!=!N!.! 4 + ..! !D!Z!.!Z!.! '\! 9=!M".! 6 + /.! !.!~!M".! '\! 8~! 9 + 4M!.! /.!7!N!M!.! F + 4.! &:!M! !N"M# !M"N!M! #D!M&=! = + :M!7!M#:! !~!M!7!,!$!M!:! #.! !O!N!.!M!:!M# ; + 8Z!M"~!N!$!D!.!N!?! !I!N!.! (?!M! !M!,!D!M".! 9 + (?!Z!M!N!:! )=!M!O!8!.!M!+!M! !M!,! !O!M! +,!M!.!M!~!Z!N!M!:! &:!~! 0 + &8!7!.!~!M"D!M!,! &M!?!=!8! !M!,!O! !M!+! !+!O!.!M! $M#~! !.!8!M!Z!.!M! !O!M"Z! %:!~!M!Z!M!Z!.! + + &:!M!7!,! *M!.!Z!M! !8"M!.!M!~! !.!M!.!=! #~!8!.!M! !7!M! "N!Z#I! !D!M!,!M!.! $."M!,! !M!.! * + 2$!O! "N! !.!M!I! !7" "M! "+!O! !~!M! !d!O!.!7!I!M!.! !.!O!=!M!.! !M",!M!.! %.!$!O!D! + + 1~!O! "M!+! !8!$! "M! "?!O! %Z!8!D!M!?!8!I!O!7!M! #M!.!M! "M",!M! 4 + 07!~! ".!8! !.!M! "I!+! !.!M! &Z!D!.!7!=!M! !:!.!M! #:!8"+! !.!+!8! !8! 3 + /~!M! #N! !~!M!$! !.!M! !.!M" &~!M! "~!M!O! "D! $M! !8! "M!,!M!+!D!.! 1 + #.! #?!M!N!.! #~!O! $M!.!7!$! "?" !?!~!M! '7!8!?!M!.!+!M"O! $?"$!D! !.!O! !$!7!I!.! 0 + $,!M!:!O!?! ".! !?!=! $=!:!O! !M! "M! !M! !+!$! (.! +.!M! !M!.! !8! !+"Z!~! $:!M!$! !.! ' + #.!8!.!I!$! $7!I! %M" !=!M! !~!M!D! "7!I! .I!O! %?!=!,!D! !,!M! !D!~!8!~! %D!M! ( + #.!M"?! $=!O! %=!N! "8!.! !Z!M! #M!~! (M!:! #.!M" &O! !M!.! !?!,! !8!.!N!~! $8!N!M!,!.! % + *$!O! &M!,! "O! !.!M!.! #M! (~!M( &O!.! !7! "M! !.!M!.!M!,! #.!M! !M! & + )=!8!.! $.!M!O!.! "$!.!I!N! !I!M# (7!M(I! %D"Z!M! "=!I! "M! !M!:! #~!D! ' + )D! &8!N!:! ".!O! !M!="M! "M! (7!M) %." !M!D!."M!.! !$!=! !M!,! + + (M! &+!.!M! #Z!7!O!M!.!~!8! +,!M#D!?!M#D! #.!Z!M#,!Z!?! !~!N! "N!.! !M! + + 'D!:! %$!D! !?! #M!Z! !8!.! !M"?!7!?!7! '+!I!D! !?!O!:!M!:! ":!M!:! !M!7".!M! "8!+! !:!D! !.!M! * + %.!O!:! $.!O!+! !D!.! #M! "M!.!+!N!I!Z! "7!M!N!M!N!?!I!7!Z!=!M'D"~! #M!.!8!$! !:! !.!M! "N!?! !,!O! ) + !.!?!M!:!M!I! %8!,! "M!.! #M! "N! !M!.! !M!.! !+!~! !.!M!.! ':!M! $M! $M!Z!$! !M!.! "D! "M! "?!M! ( + !7!8! !+!I! ".! "$!=! ":!$! "+! !M!.! !O! !M!I!M".! !=!~! ",!O! '=!M! $$!,! #N!:! ":!8!.! !D!~! !,!M!.! !:!M!.! & + !:!,!.! &Z" #D! !.!8!."M!.! !8!?!Z!M!.!M! #Z!~! !?!M!Z!.! %~!O!.!8!$!N!8!O!I!:!~! !+! #M!.! !.!M!.! !+!M! ".!~!M!+! $ + !.! 'D!I! #?!M!.!M!,! !.!Z! !.!8! #M&O!I!?! (~!I!M"." !M!Z!.! !M!N!.! "+!$!.! "M!.! !M!?!.! "8!M! $ + (O!8! $M! !M!.! ".!:! !+!=! #M! #.!M! !+" *$!M":!.! !M!~! "M!7! #M! #7!Z! "M"$!M!.! !.! # + '$!Z! #.!7!+!M! $.!,! !+!:! #N! #.!M!.!+!M! +D!M! #=!N! ":!O! #=!M! #Z!D! $M!I! % + $,! ".! $.!M" %$!.! !?!~! "+!7!." !.!M!,! !M! *,!N!M!.$M!?! "D!,! #M!.! #N! + + ,M!Z! &M! "I!,! "M! %I!M! !?!=!.! (Z!8!M! $:!M!.! !,!M! $D! #.!M!.! ) + +8!O! &.!8! "I!,! !~!M! &N!M! !M!D! '?!N!O!." $?!7! "?!~! #M!.! #I!D!.! ( + 3M!,! "N!.! !D" &.!+!M!.! !M":!.":!M!7!M!D! 'M!.! "M!.! "M!,! $I! ) + 3I! #M! "M!,! !:! &.!M" ".!,! !.!$!M!I! #.! !:! !.!M!?! "N!+! ".! / + 1M!,! #.!M!8!M!=!.! +~!N"O!Z"~! *+!M!.! "M! 2 + 0.!M! &M!.! 8:! %.!M!Z! "M!=! *O!,! % + 0?!$! &N! )." .,! %."M! ":!M!.! 0 + 0N!:! %?!O! #.! ..! &,! &.!D!,! "N!I! 0 +CATHY + App::Ack::__pic($x); +} + +sub __pic { + my($compressed) = @_; + $compressed =~ s/(.)(.)/$1x(ord($2)-32)/eg; + App::Ack::print( $compressed ); + exit 0; +} + + +sub show_help { + my $help_arg = shift || 0; + + return show_help_types() if $help_arg =~ /^types?/; + + App::Ack::print( <<"END_OF_HELP" ); +Usage: ack [OPTION]... PATTERN [FILES OR DIRECTORIES] + +Search for PATTERN in each source file in the tree from the current +directory on down. If any files or directories are specified, then +only those files and directories are checked. ack may also search +STDIN, but only if no file or directory arguments are specified, +or if one of them is "-". + +Default switches may be specified in ACK_OPTIONS environment variable or +an .ackrc file. If you want no dependency on the environment, turn it +off with --noenv. + +Example: ack -i select + +Searching: + -i, --ignore-case Ignore case distinctions in PATTERN + --[no]smart-case Ignore case distinctions in PATTERN, + only if PATTERN contains no upper case. + Ignored if -i is specified + -v, --invert-match Invert match: select non-matching lines + -w, --word-regexp Force PATTERN to match only whole words + -Q, --literal Quote all metacharacters; PATTERN is literal + +Search output: + --lines=NUM Only print line(s) NUM of each file + -l, --files-with-matches Only print filenames containing matches + -L, --files-without-matches Only print filenames with no matches + --output=expr Output the evaluation of expr for each line + (turns off text highlighting) + -o Show only the part of a line matching PATTERN + Same as --output='\$&' + --passthru Print all lines, whether matching or not + --match PATTERN Specify PATTERN explicitly. + -m, --max-count=NUM Stop searching in each file after NUM matches + -1 Stop searching after one match of any kind + -H, --with-filename Print the filename for each match (default: + on unless explicitly searching a single file) + -h, --no-filename Suppress the prefixing filename on output + -c, --count Show number of lines matching per file + --[no]column Show the column number of the first match + + -A NUM, --after-context=NUM Print NUM lines of trailing context after + matching lines. + -B NUM, --before-context=NUM Print NUM lines of leading context before + matching lines. + -C [NUM], --context[=NUM] Print NUM lines (default 2) of output context. + + --print0 Print null byte as separator between filenames, + only works with -f, -g, -l, -L or -c. + + -s Suppress error messages about nonexistent or + unreadable files. + + +File presentation: + --pager=COMMAND Pipes all ack output through COMMAND. For + example, --pager="less -R". Ignored if output + is redirected. + --nopager Do not send output through a pager. Cancels + any setting in ~/.ackrc, ACK_PAGER or + ACK_PAGER_COLOR. + --[no]heading Print a filename heading above each file's + results. (default: on when used interactively) + --[no]break Print a break between results from different + files. (default: on when used interactively) + --group Same as --heading --break + --nogroup Same as --noheading --nobreak + --[no]color Highlight the matching text (default: on unless + output is redirected, or on Windows) + --[no]colour Same as --[no]color + --color-filename=COLOR + --color-match=COLOR + --color-lineno=COLOR Set the color for filenames, matches, and line + numbers. + --flush Flush output immediately, even when ack is used + non-interactively (when output goes to a pipe or + file). + + +File finding: + -f Only print the files selected, without + searching. The PATTERN must not be specified. + -g Same as -f, but only select files matching + PATTERN. + --sort-files Sort the found files lexically. + --show-types Show which types each file has. + --files-from=FILE Read the list of files to search from FILE. + -x Read the list of files to search from STDIN. + +File inclusion/exclusion: + --[no]ignore-dir=name Add/remove directory from list of ignored dirs + --[no]ignore-directory=name Synonym for ignore-dir + --ignore-file=filter Add filter for ignoring files + -r, -R, --recurse Recurse into subdirectories (default: on) + -n, --no-recurse No descending into subdirectories + --[no]follow Follow symlinks. Default is off. + -k, --known-types Include only files of types that ack recognizes. + + --type=X Include only X files, where X is a recognized + filetype. + --type=noX Exclude X files. + See "ack --help-types" for supported filetypes. + +File type specification: + --type-set TYPE:FILTER:FILTERARGS + Files with the given FILTERARGS applied to the + given FILTER are recognized as being of type + TYPE. This replaces an existing definition for + type TYPE. + --type-add TYPE:FILTER:FILTERARGS + Files with the given FILTERARGS applied to the + given FILTER are recognized as being type TYPE. + --type-del TYPE Removes all filters associated with TYPE. + + +Miscellaneous: + --[no]env Ignore environment variables and global ackrc + files. --env is legal but redundant. + --ackrc=filename Specify an ackrc file to use + --ignore-ack-defaults Ignore default definitions included with ack. + --create-ackrc Outputs a default ackrc for your customization + to standard output. + --help, -? This help + --help-types Display all known types + --dump Dump information on which options are loaded + from which RC files + --[no]filter Force ack to treat standard input as a pipe + (--filter) or tty (--nofilter) + --man Man page + --version Display version & copyright + --thpppt Bill the Cat + --bar The warning admiral + --cathy Chocolate! Chocolate! Chocolate! + +Exit status is 0 if match, 1 if no match. + +This is version $VERSION of ack. +END_OF_HELP + + return; + } + + + +sub show_help_types { + App::Ack::print( <<'END_OF_HELP' ); +Usage: ack [OPTION]... PATTERN [FILES OR DIRECTORIES] + +The following is the list of filetypes supported by ack. You can +specify a file type with the --type=TYPE format, or the --TYPE +format. For example, both --type=perl and --perl work. + +Note that some extensions may appear in multiple types. For example, +.pod files are both Perl and Parrot. + +END_OF_HELP + + my @types = filetypes_supported(); + my $maxlen = 0; + for ( @types ) { + $maxlen = length if $maxlen < length; + } + for my $type ( sort @types ) { + next if $type =~ /^-/; # Stuff to not show + my $ext_list = $mappings{$type}; + + if ( ref $ext_list ) { + $ext_list = join( '; ', map { $_->to_string } @{$ext_list} ); + } + App::Ack::print( sprintf( " --[no]%-*.*s %s\n", $maxlen, $maxlen, $type, $ext_list ) ); + } + + return; +} + +sub show_man { + require Pod::Usage; + + Pod::Usage::pod2usage({ + -input => $App::Ack::orig_program_name, + -verbose => 2, + -exitval => 0, + }); + + return; +} + + +sub get_version_statement { + require Config; + + my $copyright = get_copyright(); + my $this_perl = $Config::Config{perlpath}; + if ($^O ne 'VMS') { + my $ext = $Config::Config{_exe}; + $this_perl .= $ext unless $this_perl =~ m/$ext$/i; + } + my $ver = sprintf( '%vd', $^V ); + + return <<"END_OF_VERSION"; +ack ${VERSION} +Running under Perl $ver at $this_perl + +$copyright + +This program is free software. You may modify or distribute it +under the terms of the Artistic License v2.0. +END_OF_VERSION +} + + +sub print_version_statement { + App::Ack::print( get_version_statement() ); + + return; +} + + +sub get_copyright { + return $COPYRIGHT; +} + + +# print subs added in order to make it easy for a third party +# module (such as App::Wack) to redefine the display methods +# and show the results in a different way. +sub print { print {$fh} @_; return; } +sub print_first_filename { App::Ack::print( $_[0], "\n" ); return; } +sub print_blank_line { App::Ack::print( "\n" ); return; } +sub print_separator { App::Ack::print( "--\n" ); return; } +sub print_filename { App::Ack::print( $_[0], $_[1] ); return; } +sub print_line_no { App::Ack::print( $_[0], $_[1] ); return; } +sub print_column_no { App::Ack::print( $_[0], $_[1] ); return; } +sub print_count { + my $filename = shift; + my $nmatches = shift; + my $ors = shift; + my $count = shift; + my $show_filename = shift; + + if ($show_filename) { + App::Ack::print( $filename ); + App::Ack::print( ':', $nmatches ) if $count; + } + else { + App::Ack::print( $nmatches ) if $count; + } + App::Ack::print( $ors ); + + return; +} + +sub print_count0 { + my $filename = shift; + my $ors = shift; + my $show_filename = shift; + + if ($show_filename) { + App::Ack::print( $filename, ':0', $ors ); + } + else { + App::Ack::print( '0', $ors ); + } + + return; +} + +sub set_up_pager { + my $command = shift; + + return if App::Ack::output_to_pipe(); + + my $pager; + if ( not open( $pager, '|-', $command ) ) { + App::Ack::die( qq{Unable to pipe to pager "$command": $!} ); + } + $fh = $pager; + + return; +} + + +sub output_to_pipe { + return $output_to_pipe; +} + + +sub exit_from_ack { + my $nmatches = shift; + + my $rc = $nmatches ? 0 : 1; + exit $rc; +} + + + +1; # End of App::Ack +package App::Ack::Resource; + + +use warnings; +use strict; +use overload + '""' => 'name'; + +sub FAIL { + require Carp; + Carp::confess( 'Must be overloaded' ); +} + + +sub new { + return FAIL(); +} + + +sub name { + return FAIL(); +} + + +sub is_binary { + return FAIL(); +} + + +sub open { + return FAIL(); +} + + +sub needs_line_scan { + return FAIL(); +} + + +sub reset { + return FAIL(); +} + + +sub close { + return FAIL(); +} + + +sub clone { + return FAIL(); +} + + +sub firstliney { + return FAIL(); +} + +1; +package App::Ack::Resources; + + + +use warnings; +use strict; + + +sub from_argv { + my $class = shift; + my $opt = shift; + my $start = shift; + + my $self = bless {}, $class; + + my $file_filter = undef; + my $descend_filter = $opt->{descend_filter}; + + if( $opt->{n} ) { + $descend_filter = sub { + return 0; + }; + } + + $self->{iter} = + File::Next::files( { + file_filter => $opt->{file_filter}, + descend_filter => $descend_filter, + error_handler => sub { my $msg = shift; App::Ack::warn( $msg ) }, + sort_files => $opt->{sort_files}, + follow_symlinks => $opt->{follow}, + }, @{$start} ); + + return $self; +} + + +sub from_file { + my $class = shift; + my $opt = shift; + my $file = shift; + + my $iter = + File::Next::from_file( { + error_handler => sub { my $msg = shift; App::Ack::warn( $msg ) }, + warning_handler => sub { my $msg = shift; App::Ack::warn( $msg ) }, + sort_files => $opt->{sort_files}, + }, $file ) or return undef; + + return bless { + iter => $iter, + }, $class; +} + +# This is for reading input lines from STDIN, not the list of files from STDIN +sub from_stdin { + my $class = shift; + my $opt = shift; + + my $self = bless {}, $class; + + my $has_been_called = 0; + + $self->{iter} = sub { + if ( !$has_been_called ) { + $has_been_called = 1; + return '-'; + } + return; + }; + + return $self; +} + +sub next { + my $self = shift; + + my $file = $self->{iter}->() or return; + + return App::Ack::Resource::Basic->new( $file ); +} + +1; +package App::Ack::Resource::Basic; + + +use warnings; +use strict; + +use Fcntl (); + +BEGIN { + our @ISA = 'App::Ack::Resource'; +} + + +sub new { + my $class = shift; + my $filename = shift; + + my $self = bless { + filename => $filename, + fh => undef, + opened => 0, + }, $class; + + if ( $self->{filename} eq '-' ) { + $self->{fh} = *STDIN; + $self->{opened} = 1; + } + + return $self; +} + + +sub name { + return $_[0]->{filename}; +} + + + +sub needs_line_scan { + my $self = shift; + my $opt = shift; + + return 1 if $opt->{v}; + + my $size = -s $self->{fh}; + if ( $size == 0 ) { + return 0; + } + elsif ( $size > 100_000 ) { + return 1; + } + + my $buffer; + my $rc = sysread( $self->{fh}, $buffer, $size ); + if ( !defined($rc) && $App::Ack::report_bad_filenames ) { + App::Ack::warn( "$self->{filename}: $!" ); + return 1; + } + return 0 unless $rc && ( $rc == $size ); + + my $regex = $opt->{regex}; + return $buffer =~ /$regex/m; +} + + +sub reset { + my $self = shift; + + # return if we haven't opened the file yet + if ( !defined($self->{fh}) ) { + return; + } + + if( !seek( $self->{fh}, 0, 0 ) && $App::Ack::report_bad_filenames ) { + App::Ack::warn( "$self->{filename}: $!" ); + } + + return; +} + + +sub close { + my $self = shift; + + # return if we haven't opened the file yet + if ( !defined($self->{fh}) ) { + return; + } + + if ( !close($self->{fh}) && $App::Ack::report_bad_filenames ) { + App::Ack::warn( $self->name() . ": $!" ); + } + + $self->{opened} = 0; + + return; +} + + +sub clone { + my ( $self ) = @_; + + return __PACKAGE__->new($self->name); +} + +sub firstliney { + my ( $self ) = @_; + + my $fh = $self->open(); + + unless(exists $self->{firstliney}) { + my $buffer = ''; + my $rc = sysread( $fh, $buffer, 250 ); + unless($rc) { # XXX handle this better? + $buffer = ''; + } + $buffer =~ s/[\r\n].*//s; + $self->{firstliney} = $buffer; + $self->reset; + } + + $self->close; + + return $self->{firstliney}; +} + +sub open { + my ( $self ) = @_; + + return $self->{fh} if $self->{opened}; + + unless ( open $self->{fh}, '<', $self->{filename} ) { + return; + } + + $self->{opened} = 1; + + return $self->{fh}; +} + +1; +package App::Ack::ConfigDefault; + +use warnings; +use strict; + +sub options { + my @options = split( /\n/, _options_block() ); + @options = grep { /./ && !/^#/ } @options; + + return @options; +} + +sub _options_block { + return <<'HERE'; +# This is the default ackrc for ack 2.0 + +# There are four different ways to match +# +# is: Match the filename exactly +# +# ext: Match the extension of the filename exactly +# +# match: Match the filename against a Perl regular expression +# +# firstlinematch: Match the first 250 characters of the first line +# of text against a Perl regular expression. This is only for +# the --type-add option. + + +### Directories to ignore + +# Bazaar +--ignore-directory=is:.bzr + +# Codeville +--ignore-directory=is:.cdv + +# Interface Builder +--ignore-directory=is:~.dep +--ignore-directory=is:~.dot +--ignore-directory=is:~.nib +--ignore-directory=is:~.plst + +# Git +--ignore-directory=is:.git + +# Mercurial +--ignore-directory=is:.hg + +# quilt +--ignore-directory=is:.pc + +# Subversion +--ignore-directory=is:.svn + +# Monotone +--ignore-directory=is:_MTN + +# CVS +--ignore-directory=is:CVS + +# RCS +--ignore-directory=is:RCS + +# SCCS +--ignore-directory=is:SCCS + +# darcs +--ignore-directory=is:_darcs + +# Vault/Fortress +--ignore-directory=is:_sgbak + +# autoconf +--ignore-directory=is:autom4te.cache + +# Perl module building +--ignore-directory=is:blib +--ignore-directory=is:_build + +# Perl Devel::Cover module's output directory +--ignore-directory=is:cover_db + +# Node modules created by npm +--ignore-directory=is:node_modules + +# CMake cache +--ignore-directory=is:CMakeFiles + +# Eclipse workspace folder +--ignore-directory=is:.metadata + +### Files to ignore + +# Backup files +--ignore-file=ext:bak +--ignore-file=match:/~$/ + +# Emacs swap files +--ignore-file=match:/^#.+#$/ + +# vi/vim swap files +--ignore-file=match:/[._].*\.swp$/ + +# core dumps +--ignore-file=match:/core\.\d+$/ + +# minified Javascript +--ignore-file=match:/[.-]min[.]js$/ +--ignore-file=match:/[.]js[.]min$/ + +# minified CSS +--ignore-file=match:/[.]min[.]css$/ +--ignore-file=match:/[.]css[.]min$/ + +# PDFs, because they pass Perl's -T detection +--ignore-file=ext:pdf + +# Common graphics, just as an optimization +--ignore-file=ext:gif,jpg,jpeg,png + + +### Filetypes defined + +# Perl http://perl.org/ +--type-add=perl:ext:pl,pm,pod,t,psgi +--type-add=perl:firstlinematch:/^#!.*\bperl/ + +# Perl tests +--type-add=perltest:ext:t + +# Makefiles http://www.gnu.org/s/make/ +--type-add=make:ext:mk +--type-add=make:ext:mak +--type-add=make:is:makefile +--type-add=make:is:Makefile +--type-add=make:is:GNUmakefile + +# Rakefiles http://rake.rubyforge.org/ +--type-add=rake:is:Rakefile + +# CMake http://www.cmake.org/ +--type-add=cmake:is:CMakeLists.txt +--type-add=cmake:ext:cmake + +# Actionscript +--type-add=actionscript:ext:as,mxml + +# Ada http://www.adaic.org/ +--type-add=ada:ext:ada,adb,ads + +# ASP http://msdn.microsoft.com/en-us/library/aa286483.aspx +--type-add=asp:ext:asp + +# ASP.Net http://www.asp.net/ +--type-add=aspx:ext:master,ascx,asmx,aspx,svc + +# Assembly +--type-add=asm:ext:asm,s + +# Batch +--type-add=batch:ext:bat,cmd + +# ColdFusion http://en.wikipedia.org/wiki/ColdFusion +--type-add=cfmx:ext:cfc,cfm,cfml + +# Clojure http://clojure.org/ +--type-add=clojure:ext:clj + +# C +# .xs are Perl C files +--type-add=cc:ext:c,h,xs + +# C header files +--type-add=hh:ext:h + +# CoffeeScript http://coffeescript.org/ +--type-add=coffeescript:ext:coffee + +# C++ +--type-add=cpp:ext:cpp,cc,cxx,m,hpp,hh,h,hxx + +# C# +--type-add=csharp:ext:cs + +# CSS http://www.w3.org/Style/CSS/ +--type-add=css:ext:css + +# Dart http://www.dartlang.org/ +--type-add=dart:ext:dart + +# Delphi http://en.wikipedia.org/wiki/Embarcadero_Delphi +--type-add=delphi:ext:pas,int,dfm,nfm,dof,dpk,dproj,groupproj,bdsgroup,bdsproj + +# Elixir http://elixir-lang.org/ +--type-add=elixir:ext:ex,exs + +# Emacs Lisp http://www.gnu.org/software/emacs +--type-add=elisp:ext:el + +# Erlang http://www.erlang.org/ +--type-add=erlang:ext:erl,hrl + +# Fortran http://en.wikipedia.org/wiki/Fortran +--type-add=fortran:ext:f,f77,f90,f95,f03,for,ftn,fpp + +# Google Go http://golang.org/ +--type-add=go:ext:go + +# Groovy http://groovy.codehaus.org/ +--type-add=groovy:ext:groovy,gtmpl,gpp,grunit,gradle + +# Haskell http://www.haskell.org/ +--type-add=haskell:ext:hs,lhs + +# HTML +--type-add=html:ext:htm,html + +# Java http://www.oracle.com/technetwork/java/index.html +--type-add=java:ext:java,properties + +# JavaScript +--type-add=js:ext:js + +# JSP http://www.oracle.com/technetwork/java/javaee/jsp/index.html +--type-add=jsp:ext:jsp,jspx,jhtm,jhtml + +# JSON http://www.json.org/ +--type-add=json:ext:json + +# Less http://www.lesscss.org/ +--type-add=less:ext:less + +# Common Lisp http://common-lisp.net/ +--type-add=lisp:ext:lisp,lsp + +# Lua http://www.lua.org/ +--type-add=lua:ext:lua +--type-add=lua:firstlinematch:/^#!.*\blua(jit)?/ + +# Objective-C +--type-add=objc:ext:m,h + +# Objective-C++ +--type-add=objcpp:ext:mm,h + +# OCaml http://caml.inria.fr/ +--type-add=ocaml:ext:ml,mli + +# Matlab http://en.wikipedia.org/wiki/MATLAB +--type-add=matlab:ext:m + +# Parrot http://www.parrot.org/ +--type-add=parrot:ext:pir,pasm,pmc,ops,pod,pg,tg + +# PHP http://www.php.net/ +--type-add=php:ext:php,phpt,php3,php4,php5,phtml +--type-add=php:firstlinematch:/^#!.*\bphp/ + +# Plone http://plone.org/ +--type-add=plone:ext:pt,cpt,metadata,cpy,py + +# Python http://www.python.org/ +--type-add=python:ext:py +--type-add=python:firstlinematch:/^#!.*\bpython/ + +# R http://www.r-project.org/ +--type-add=rr:ext:R + +# Ruby http://www.ruby-lang.org/ +--type-add=ruby:ext:rb,rhtml,rjs,rxml,erb,rake,spec +--type-add=ruby:is:Rakefile +--type-add=ruby:firstlinematch:/^#!.*\bruby/ + +# Rust http://www.rust-lang.org/ +--type-add=rust:ext:rs + +# Sass http://sass-lang.com +--type-add=sass:ext:sass,scss + +# Scala http://www.scala-lang.org/ +--type-add=scala:ext:scala + +# Scheme http://groups.csail.mit.edu/mac/projects/scheme/ +--type-add=scheme:ext:scm,ss + +# Shell +--type-add=shell:ext:sh,bash,csh,tcsh,ksh,zsh,fish +--type-add=shell:firstlinematch:/^#!.*\b(?:ba|t?c|k|z|fi)?sh\b/ + +# Smalltalk http://www.smalltalk.org/ +--type-add=smalltalk:ext:st + +# SQL http://www.iso.org/iso/catalogue_detail.htm?csnumber=45498 +--type-add=sql:ext:sql,ctl + +# Tcl http://www.tcl.tk/ +--type-add=tcl:ext:tcl,itcl,itk + +# LaTeX http://www.latex-project.org/ +--type-add=tex:ext:tex,cls,sty + +# Template Toolkit http://template-toolkit.org/ +--type-add=tt:ext:tt,tt2,ttml + +# Visual Basic +--type-add=vb:ext:bas,cls,frm,ctl,vb,resx + +# Verilog +--type-add=verilog:ext:v,vh,sv + +# VHDL http://www.eda.org/twiki/bin/view.cgi/P1076/WebHome +--type-add=vhdl:ext:vhd,vhdl + +# Vim http://www.vim.org/ +--type-add=vim:ext:vim + +# XML http://www.w3.org/TR/REC-xml/ +--type-add=xml:ext:xml,dtd,xsl,xslt,ent +--type-add=xml:firstlinematch:/<[?]xml/ + +# YAML http://yaml.org/ +--type-add=yaml:ext:yaml,yml +HERE +} + +1; +package App::Ack::ConfigFinder; + + +use strict; +use warnings; + +use Cwd 3.00 (); +use File::Spec 3.00; + +use if ($^O eq 'MSWin32'), 'Win32'; + + +sub new { + my ( $class ) = @_; + + return bless {}, $class; +} + +sub _remove_redundancies { + my ( @configs ) = @_; + + if ( $App::Ack::is_windows ) { + # inode stat always returns 0 on windows, so just check filenames. + my (%seen, @uniq); + + foreach my $path (map { $_->{path} } @configs) { + push @uniq, $path unless $seen{$path}; + $seen{$path} = 1; + } + + return @uniq; + } + + else { + + my %dev_and_inode_seen; + + foreach my $config ( @configs ) { + my $path = $config->{path}; + my ( $dev, $inode ) = (stat $path)[0, 1]; + + if( defined($dev) ) { + if( $dev_and_inode_seen{"$dev:$inode"} ) { + undef $config; + } + else { + $dev_and_inode_seen{"$dev:$inode"} = 1; + } + } + } + + return grep { defined() } @configs; + + } +} + +sub _check_for_ackrc { + return unless defined $_[0]; + + my @files = grep { -f } + map { File::Spec->catfile(@_, $_) } + qw(.ackrc _ackrc); + + die File::Spec->catdir(@_) . " contains both .ackrc and _ackrc.\n" . + "Please remove one of those files.\n" + if @files > 1; + + return wantarray ? @files : $files[0]; +} # end _check_for_ackrc + + +sub find_config_files { + my @config_files; + + if ( $App::Ack::is_windows ) { + push @config_files, map { +{ path => File::Spec->catfile($_, 'ackrc') } } ( + Win32::GetFolderPath(Win32::CSIDL_COMMON_APPDATA()), + Win32::GetFolderPath(Win32::CSIDL_APPDATA()), + ); + } + else { + push @config_files, { path => '/etc/ackrc' }; + } + + + if ( $ENV{'ACKRC'} && -f $ENV{'ACKRC'} ) { + push @config_files, { path => $ENV{'ACKRC'} }; + } + else { + push @config_files, map { +{ path => $_ } } _check_for_ackrc($ENV{'HOME'}); + } + + my @dirs = File::Spec->splitdir(Cwd::getcwd()); + while(@dirs) { + my $ackrc = _check_for_ackrc(@dirs); + if(defined $ackrc) { + push @config_files, { project => 1, path => $ackrc }; + last; + } + pop @dirs; + } + + # XXX we only test for existence here, so if the file is + # deleted out from under us, this will fail later. =( + return _remove_redundancies( @config_files ); +} + + +sub read_rcfile { + my $file = shift; + + return unless defined $file && -e $file; + + my @lines; + + open( my $fh, '<', $file ) or App::Ack::die( "Unable to read $file: $!" ); + while ( my $line = <$fh> ) { + chomp $line; + $line =~ s/^\s+//; + $line =~ s/\s+$//; + + next if $line eq ''; + next if $line =~ /^#/; + + push( @lines, $line ); + } + close $fh; + + return @lines; +} + +1; +package App::Ack::ConfigLoader; + +use strict; +use warnings; + +use Carp 1.04 (); +use Getopt::Long 2.35 (); +use Text::ParseWords 3.1 (); + + +my @INVALID_COMBINATIONS; + +BEGIN { + my @context = qw( -A -B -C --after-context --before-context --context ); + my @pretty = qw( --heading --group --break ); + my @filename = qw( -h -H --with-filename --no-filename ); + + @INVALID_COMBINATIONS = ( + # XXX normalize + [qw(-l)] => [@context, @pretty, @filename, qw(-L -o --passthru --output --max-count --column -f -g --show-types)], + [qw(-L)] => [@context, @pretty, @filename, qw(-l -o --passthru --output --max-count --column -f -g --show-types -c --count)], + [qw(--line)] => [@context, @pretty, @filename, qw(-l --files-with-matches --files-without-matches -L -o --passthru --match -m --max-count -1 -c --count --column --print0 -f -g --show-types)], + [qw(-o)] => [@context, qw(--output -c --count --column --column -f --show-types)], + [qw(--passthru)] => [@context, qw(--output --column -m --max-count -1 -c --count -f -g)], + [qw(--output)] => [@context, qw(-c --count -f -g)], + [qw(--match)] => [qw(-f -g)], + [qw(-m --max-count)] => [qw(-1 -f -g -c --count)], + [qw(-h --no-filename)] => [qw(-H --with-filename -f -g --group --heading)], + [qw(-H --with-filename)] => [qw(-h --no-filename -f -g)], + [qw(-c --count)] => [@context, @pretty, qw(--column -f -g)], + [qw(--column)] => [qw(-f -g)], + [@context] => [qw(-f -g)], + [qw(-f)] => [qw(-g), @pretty], + [qw(-g)] => [qw(-f), @pretty], + ); +} + +sub process_filter_spec { + my ( $spec ) = @_; + + if ( $spec =~ /^(\w+):(\w+):(.*)/ ) { + my ( $type_name, $ext_type, $arguments ) = ( $1, $2, $3 ); + + return ( $type_name, + App::Ack::Filter->create_filter($ext_type, split(/,/, $arguments)) ); + } + elsif ( $spec =~ /^(\w+)=(.*)/ ) { # Check to see if we have ack1-style argument specification. + my ( $type_name, $extensions ) = ( $1, $2 ); + + my @extensions = split(/,/, $extensions); + foreach my $extension ( @extensions ) { + $extension =~ s/^[.]//; + } + + return ( $type_name, App::Ack::Filter->create_filter('ext', @extensions) ); + } + else { + Carp::croak "invalid filter specification '$spec'"; + } +} + +sub uninvert_filter { + my ( $opt, @filters ) = @_; + + return unless defined $opt->{filters} && @filters; + + # Loop through all the registered filters. If we hit one that + # matches this extension and it's inverted, we need to delete it from + # the options. + for ( my $i = 0; $i < @{ $opt->{filters} }; $i++ ) { + my $opt_filter = @{ $opt->{filters} }[$i]; + + # XXX Do a real list comparison? This just checks string equivalence. + if ( $opt_filter->is_inverted() && "$opt_filter->{filter}" eq "@filters" ) { + splice @{ $opt->{filters} }, $i, 1; + $i--; + } + } +} + +sub process_filetypes { + my ( $opt, $arg_sources ) = @_; + + Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); # start with default options, minus some annoying ones + Getopt::Long::Configure( + 'no_ignore_case', + 'no_auto_abbrev', + 'pass_through', + ); + my %additional_specs; + + my $add_spec = sub { + my ( undef, $spec ) = @_; + + my ( $name, $filter ) = process_filter_spec($spec); + + push @{ $App::Ack::mappings{$name} }, $filter; + + $additional_specs{$name . '!'} = sub { + my ( undef, $value ) = @_; + + my @filters = @{ $App::Ack::mappings{$name} }; + if ( not $value ) { + @filters = map { $_->invert() } @filters; + } + else { + uninvert_filter( $opt, @filters ); + } + + push @{ $opt->{'filters'} }, @filters; + }; + }; + + my $set_spec = sub { + my ( undef, $spec ) = @_; + + my ( $name, $filter ) = process_filter_spec($spec); + + $App::Ack::mappings{$name} = [ $filter ]; + + $additional_specs{$name . '!'} = sub { + my ( undef, $value ) = @_; + + my @filters = @{ $App::Ack::mappings{$name} }; + if ( not $value ) { + @filters = map { $_->invert() } @filters; + } + + push @{ $opt->{'filters'} }, @filters; + }; + }; + + my $delete_spec = sub { + my ( undef, $name ) = @_; + + delete $App::Ack::mappings{$name}; + delete $additional_specs{$name . '!'}; + }; + + my %type_arg_specs = ( + 'type-add=s' => $add_spec, + 'type-set=s' => $set_spec, + 'type-del=s' => $delete_spec, + ); + + foreach my $source (@{$arg_sources}) { + my ( $source_name, $args ) = @{$source}{qw/name contents/}; + + if ( ref($args) ) { + # $args are modified in place, so no need to munge $arg_sources + local @ARGV = @{$args}; + Getopt::Long::GetOptions(%type_arg_specs); + @{$args} = @ARGV; + } + else { + ( undef, $source->{contents} ) = + Getopt::Long::GetOptionsFromString($args, %type_arg_specs); + } + } + + $additional_specs{'k|known-types'} = sub { + my ( undef, $value ) = @_; + + my @filters = map { @{$_} } values(%App::Ack::mappings); + + push @{ $opt->{'filters'} }, @filters; + }; + + return \%additional_specs; +} + +sub removed_option { + my ( $option, $explanation ) = @_; + + $explanation ||= ''; + return sub { + warn "Option '$option' is not valid in ack 2\n$explanation"; + exit 1; + }; +} + +sub get_arg_spec { + my ( $opt, $extra_specs ) = @_; + + my $dash_a_explanation = <<EOT; +This is because we now have -k/--known-types which makes it only select files +of known types, rather than any text file (which is the behavior of ack 1.x). +You may have options in a .ackrc, or in the ACKRC_OPTIONS environment variable. +Try using the --dump flag. +EOT + + return { + 1 => sub { $opt->{1} = $opt->{m} = 1 }, + 'A|after-context=i' => \$opt->{after_context}, + 'B|before-context=i' + => \$opt->{before_context}, + 'C|context:i' => sub { shift; my $val = shift; $opt->{before_context} = $opt->{after_context} = ($val || 2) }, + 'a' => removed_option('-a', $dash_a_explanation), + 'all' => removed_option('--all', $dash_a_explanation), + 'break!' => \$opt->{break}, + c => \$opt->{count}, + 'color|colour!' => \$opt->{color}, + 'color-match=s' => \$ENV{ACK_COLOR_MATCH}, + 'color-filename=s' => \$ENV{ACK_COLOR_FILENAME}, + 'color-lineno=s' => \$ENV{ACK_COLOR_LINENO}, + 'column!' => \$opt->{column}, + count => \$opt->{count}, + 'create-ackrc' => sub { print "$_\n" for ( '--ignore-ack-defaults', App::Ack::ConfigDefault::options() ); exit; }, + 'env!' => sub { + my ( undef, $value ) = @_; + + if ( !$value ) { + $opt->{noenv_seen} = 1; + } + }, + f => \$opt->{f}, + 'files-from=s' => \$opt->{files_from}, + 'filter!' => \$App::Ack::is_filter_mode, + flush => \$opt->{flush}, + 'follow!' => \$opt->{follow}, + g => \$opt->{g}, + G => removed_option('-G'), + 'group!' => sub { shift; $opt->{heading} = $opt->{break} = shift }, + 'heading!' => \$opt->{heading}, + 'h|no-filename' => \$opt->{h}, + 'H|with-filename' => \$opt->{H}, + 'i|ignore-case' => \$opt->{i}, + 'ignore-directory|ignore-dir=s' # XXX Combine this version with the negated version below + => sub { + my ( undef, $dir ) = @_; + + $dir = App::Ack::remove_dir_sep( $dir ); + if ( $dir !~ /^(?:is|match):/ ) { + $dir = 'is:' . $dir; + } + push @{ $opt->{idirs} }, $dir; + }, + 'ignore-file=s' => sub { + my ( undef, $file ) = @_; + push @{ $opt->{ifiles} }, $file; + }, + 'lines=s' => sub { shift; my $val = shift; push @{$opt->{lines}}, $val }, + 'l|files-with-matches' + => \$opt->{l}, + 'L|files-without-matches' + => \$opt->{L}, + 'm|max-count=i' => \$opt->{m}, + 'match=s' => \$opt->{regex}, + 'n|no-recurse' => \$opt->{n}, + o => sub { $opt->{output} = '$&' }, + 'output=s' => \$opt->{output}, + 'pager:s' => sub { + my ( undef, $value ) = @_; + + $opt->{pager} = $value || $ENV{PAGER}; + }, + 'noignore-directory|noignore-dir=s' + => sub { + my ( undef, $dir ) = @_; + + # XXX can you do --noignore-dir=match,...? + $dir = App::Ack::remove_dir_sep( $dir ); + if ( $dir !~ /^(?:is|match):/ ) { + $dir = 'is:' . $dir; + } + if ( $dir !~ /^(?:is|match):/ ) { + Carp::croak("invalid noignore-directory argument: '$dir'"); + } + + @{ $opt->{idirs} } = grep { + $_ ne $dir + } @{ $opt->{idirs} }; + + push @{ $opt->{no_ignore_dirs} }, $dir; + }, + 'nopager' => sub { $opt->{pager} = undef }, + 'passthru' => \$opt->{passthru}, + 'print0' => \$opt->{print0}, + 'Q|literal' => \$opt->{Q}, + 'r|R|recurse' => sub { $opt->{n} = 0 }, + 's' => \$opt->{dont_report_bad_filenames}, + 'show-types' => \$opt->{show_types}, + 'smart-case!' => \$opt->{smart_case}, + 'sort-files' => \$opt->{sort_files}, + 'type=s' => sub { + my ( $getopt, $value ) = @_; + + my $cb_value = 1; + if ( $value =~ s/^no// ) { + $cb_value = 0; + } + + my $callback = $extra_specs->{ $value . '!' }; + + if ( $callback ) { + $callback->( $getopt, $cb_value ); + } + else { + Carp::croak( "Unknown type '$value'" ); + } + }, + 'u' => removed_option('-u'), + 'unrestricted' => removed_option('--unrestricted'), + 'v|invert-match' => \$opt->{v}, + 'w|word-regexp' => \$opt->{w}, + 'x' => sub { $opt->{files_from} = '-' }, + + 'version' => sub { App::Ack::print_version_statement(); exit; }, + 'help|?:s' => sub { shift; App::Ack::show_help(@_); exit; }, + 'help-types' => sub { App::Ack::show_help_types(); exit; }, + 'man' => sub { App::Ack::show_man(); exit; }, + $extra_specs ? %{$extra_specs} : (), + }; # arg_specs +} + +sub process_other { + my ( $opt, $extra_specs, $arg_sources ) = @_; + + Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); # start with default options, minus some annoying ones + Getopt::Long::Configure( + 'bundling', + 'no_ignore_case', + ); + + my $argv_source; + my $is_help_types_active; + + foreach my $source (@{$arg_sources}) { + my ( $source_name, $args ) = @{$source}{qw/name contents/}; + + if ( $source_name eq 'ARGV' ) { + $argv_source = $args; + last; + } + } + + if ( $argv_source ) { # This *should* always be true, but you never know... + my @copy = @{$argv_source}; + local @ARGV = @copy; + + Getopt::Long::Configure('pass_through'); + + Getopt::Long::GetOptions( + 'help-types' => \$is_help_types_active, + ); + + Getopt::Long::Configure('no_pass_through'); + } + + my $arg_specs = get_arg_spec($opt, $extra_specs); + + foreach my $source (@{$arg_sources}) { + my ( $source_name, $args ) = @{$source}{qw/name contents/}; + + my $args_for_source = $arg_specs; + + if ( $source->{project} ) { + my $illegal = sub { + my ( $option ) = @_; + + return sub { + die "Option $option is illegal in project ackrcs"; + }; + }; + + $args_for_source = { %$args_for_source, + 'output=s'=> $illegal->('--output'), + 'pager:s' => $illegal->('--pager'), + 'match=s' => $illegal->('--match'), + }; + } + + my $ret; + if ( ref($args) ) { + local @ARGV = @{$args}; + $ret = Getopt::Long::GetOptions( %{$args_for_source} ); + @{$args} = @ARGV; + } + else { + ( $ret, $source->{contents} ) = + Getopt::Long::GetOptionsFromString( $args, %{$args_for_source} ); + } + if ( !$ret ) { + if ( !$is_help_types_active ) { + my $where = $source_name eq 'ARGV' ? 'on command line' : "in $source_name"; + App::Ack::die( "Invalid option $where" ); + } + } + if ( $opt->{noenv_seen} ) { + App::Ack::die( "--noenv found in $source_name" ); + } + } + + # XXX We need to check on a -- in the middle of a non-ARGV source + + return; +} + +sub should_dump_options { + my ( $sources ) = @_; + + + foreach my $source (@{$sources}) { + my ( $name, $options ) = @{$source}{qw/name contents/}; + + if($name eq 'ARGV') { + my $dump; + local @ARGV = @{$options}; + Getopt::Long::Configure('default', 'pass_through', 'no_auto_help', 'no_auto_version'); + Getopt::Long::GetOptions( + 'dump' => \$dump, + ); + @{$options} = @ARGV; + return $dump; + } + } + return; +} + +sub explode_sources { + my ( $sources ) = @_; + + my @new_sources; + + Getopt::Long::Configure('default', 'pass_through', 'no_auto_help', 'no_auto_version'); + + my %opt; + my $arg_spec = get_arg_spec(\%opt); + + my $add_type = sub { + my ( undef, $arg ) = @_; + + # XXX refactor? + if ( $arg =~ /(\w+)=/) { + $arg_spec->{$1} = sub {}; + } + else { + ( $arg ) = split /:/, $arg; + $arg_spec->{$arg} = sub {}; + } + }; + + my $del_type = sub { + my ( undef, $arg ) = @_; + + delete $arg_spec->{$arg}; + }; + + foreach my $source (@{$sources}) { + my ( $name, $options ) = @{$source}{qw/name contents/}; + if ( ref($options) ne 'ARRAY' ) { + $source->{contents} = $options = + [ Text::ParseWords::shellwords($options) ]; + } + for ( my $j = 0; $j < @{$options}; $j++ ) { + next unless $options->[$j] =~ /^-/; + my @chunk = ( $options->[$j] ); + push @chunk, $options->[$j] while ++$j < @{$options} && $options->[$j] !~ /^-/; + $j--; + + my @copy = @chunk; + local @ARGV = @chunk; + Getopt::Long::GetOptions( + 'type-add=s' => $add_type, + 'type-set=s' => $add_type, + 'type-del=s' => $del_type, + ); + Getopt::Long::GetOptions( %{$arg_spec} ); + + push @new_sources, { + name => $name, + contents => \@copy, + }; + } + } + + return \@new_sources; +} + +sub compare_opts { + my ( $a, $b ) = @_; + + my $first_a = $a->[0]; + my $first_b = $b->[0]; + + $first_a =~ s/^--?//; + $first_b =~ s/^--?//; + + return $first_a cmp $first_b; +} + +sub dump_options { + my ( $sources ) = @_; + + $sources = explode_sources($sources); + + my %opts_by_source; + my @source_names; + + foreach my $source (@{$sources}) { + my ( $name, $contents ) = @{$source}{qw/name contents/}; + if ( not $opts_by_source{$name} ) { + $opts_by_source{$name} = []; + push @source_names, $name; + } + push @{$opts_by_source{$name}}, $contents; + } + + foreach my $name (@source_names) { + my $contents = $opts_by_source{$name}; + + print $name, "\n"; + print '=' x length($name), "\n"; + print ' ', join(' ', @{$_}), "\n" foreach sort { compare_opts($a, $b) } @{$contents}; + } + + return; +} + +sub remove_default_options_if_needed { + my ( $sources ) = @_; + + my $default_index; + + foreach my $index ( 0 .. $#$sources ) { + if ( $sources->[$index]{'name'} eq 'Defaults' ) { + $default_index = $index; + last; + } + } + + return $sources unless defined $default_index; + + my $should_remove = 0; + + # Start with default options, minus some annoying ones. + Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); + Getopt::Long::Configure( + 'no_ignore_case', + 'no_auto_abbrev', + 'pass_through', + ); + + foreach my $index ( $default_index + 1 .. $#$sources ) { + my ( $name, $args ) = @{$sources->[$index]}{qw/name contents/}; + + if (ref($args)) { + local @ARGV = @{$args}; + Getopt::Long::GetOptions( + 'ignore-ack-defaults' => \$should_remove, + ); + @{$args} = @ARGV; + } + else { + ( undef, $sources->[$index]{contents} ) = Getopt::Long::GetOptionsFromString($args, + 'ignore-ack-defaults' => \$should_remove, + ); + } + } + + Getopt::Long::Configure('default'); + Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); + + return $sources unless $should_remove; + + my @copy = @{$sources}; + splice @copy, $default_index, 1; + return \@copy; +} + +sub check_for_mutually_exclusive_options { + my ( $arg_sources ) = @_; + + my %mutually_exclusive_with; + my @copy = @{$arg_sources}; + + for(my $i = 0; $i < @INVALID_COMBINATIONS; $i += 2) { + my ( $lhs, $rhs ) = @INVALID_COMBINATIONS[ $i, $i + 1 ]; + + foreach my $l_opt ( @{$lhs} ) { + foreach my $r_opt ( @{$rhs} ) { + push @{ $mutually_exclusive_with{ $l_opt } }, $r_opt; + push @{ $mutually_exclusive_with{ $r_opt } }, $l_opt; + } + } + } + + while( @copy ) { + my %set_opts; + + my $source = shift @copy; + my ( $source_name, $args ) = @{$source}{qw/name contents/}; + $args = ref($args) ? [ @{$args} ] : [ Text::ParseWords::shellwords($args) ]; + + foreach my $opt ( @{$args} ) { + next unless $opt =~ /^[-+]/; + last if $opt eq '--'; + + if( $opt =~ /^(.*)=/ ) { + $opt = $1; + } + elsif ( $opt =~ /^(-[^-]).+/ ) { + $opt = $1; + } + + $set_opts{ $opt } = 1; + + my $mutex_opts = $mutually_exclusive_with{ $opt }; + + next unless $mutex_opts; + + foreach my $mutex_opt ( @{$mutex_opts} ) { + if($set_opts{ $mutex_opt }) { + die "Options '$mutex_opt' and '$opt' are mutually exclusive\n"; + } + } + } + } +} + +sub process_args { + my $arg_sources = \@_; + + my %opt = ( + pager => $ENV{ACK_PAGER_COLOR} || $ENV{ACK_PAGER}, + ); + + check_for_mutually_exclusive_options($arg_sources); + + $arg_sources = remove_default_options_if_needed($arg_sources); + + if ( should_dump_options($arg_sources) ) { + dump_options($arg_sources); + exit(0); + } + + my $type_specs = process_filetypes(\%opt, $arg_sources); + process_other(\%opt, $type_specs, $arg_sources); + while ( @{$arg_sources} ) { + my $source = shift @{$arg_sources}; + my ( $source_name, $args ) = @{$source}{qw/name contents/}; + + # All of our sources should be transformed into an array ref + if ( ref($args) ) { + if ( $source_name eq 'ARGV' ) { + @ARGV = @{$args}; + } + elsif (@{$args}) { + Carp::croak "source '$source_name' has extra arguments!"; + } + } + else { + Carp::croak 'The impossible has occurred!'; + } + } + my $filters = ($opt{filters} ||= []); + + # Throw the default filter in if no others are selected. + if ( not grep { !$_->is_inverted() } @{$filters} ) { + push @{$filters}, App::Ack::Filter::Default->new(); + } + return \%opt; +} + + +sub retrieve_arg_sources { + my @arg_sources; + + my $noenv; + my $ackrc; + + Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); + Getopt::Long::Configure('pass_through'); + Getopt::Long::Configure('no_auto_abbrev'); + + Getopt::Long::GetOptions( + 'noenv' => \$noenv, + 'ackrc=s' => \$ackrc, + ); + + Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); + + my @files; + + if ( !$noenv ) { + my $finder = App::Ack::ConfigFinder->new; + @files = $finder->find_config_files; + } + if ( $ackrc ) { + # We explicitly use open so we get a nice error message. + # XXX This is a potential race condition!. + if(open my $fh, '<', $ackrc) { + close $fh; + } + else { + die "Unable to load ackrc '$ackrc': $!" + } + push( @files, { path => $ackrc } ); + } + + push @arg_sources, { + name => 'Defaults', + contents => [ App::Ack::ConfigDefault::options() ], + }; + + foreach my $file ( @files) { + my @lines = App::Ack::ConfigFinder::read_rcfile($file->{path}); + + if(@lines) { + push @arg_sources, { + name => $file->{path}, + contents => \@lines, + project => $file->{project}, + }; + } + } + + if ( $ENV{ACK_OPTIONS} && !$noenv ) { + push @arg_sources, { + name => 'ACK_OPTIONS', + contents => $ENV{ACK_OPTIONS}, + }; + } + + push @arg_sources, { + name => 'ARGV', + contents => [ @ARGV ], + }; + + return @arg_sources; +} + +1; # End of App::Ack::ConfigLoader +package App::Ack::Filter; + +use strict; +use warnings; +use overload + '""' => 'to_string'; + +use Carp 1.04 (); + +my %filter_types; + + +sub create_filter { + my ( undef, $type, @args ) = @_; + + if ( my $package = $filter_types{$type} ) { + return $package->new(@args); + } + Carp::croak "Unknown filter type '$type'"; +} + + +sub register_filter { + my ( undef, $type, $package ) = @_; + + $filter_types{$type} = $package; + + return; +} + + +sub invert { + my ( $self ) = @_; + + return App::Ack::Filter::Inverse->new( $self ); +} + + +sub is_inverted { + return 0; +} + + +sub to_string { + my ( $self ) = @_; + + return '(unimplemented to_string)'; +} + + +sub inspect { + my ( $self ) = @_; + + return ref($self); +} + +1; +package App::Ack::Filter::Extension; + +use strict; +use warnings; +BEGIN { + our @ISA = 'App::Ack::Filter'; +} + + +sub new { + my ( $class, @extensions ) = @_; + + my $exts = join('|', map { "\Q$_\E"} @extensions); + my $re = qr/[.](?:$exts)$/i; + + return bless { + extensions => \@extensions, + regex => $re, + groupname => 'ExtensionGroup', + }, $class; +} + +sub create_group { + return App::Ack::Filter::ExtensionGroup->new(); +} + +sub filter { + my ( $self, $resource ) = @_; + + my $re = $self->{'regex'}; + + return $resource->name =~ /$re/; +} + +sub inspect { + my ( $self ) = @_; + + my $re = $self->{'regex'}; + + return ref($self) . " - $re"; +} + +sub to_string { + my ( $self ) = @_; + + my $exts = $self->{'extensions'}; + + return join(' ', map { ".$_" } @{$exts}); +} + +BEGIN { + App::Ack::Filter->register_filter(ext => __PACKAGE__); +} + +1; +package App::Ack::Filter::FirstLineMatch; + +use strict; +use warnings; +BEGIN { + our @ISA = 'App::Ack::Filter'; +} + +sub new { + my ( $class, $re ) = @_; + + $re =~ s{^/|/$}{}g; # XXX validate? + $re = qr{$re}i; + + return bless { + regex => $re, + }, $class; +} + +# This test reads the first 250 characters of a file, then just uses the +# first line found in that. This prevents reading something like an entire +# .min.js file (which might be only one "line" long) into memory. + +sub filter { + my ( $self, $resource ) = @_; + + my $re = $self->{'regex'}; + + my $line = $resource->firstliney; + + return $line =~ /$re/; +} + +sub inspect { + my ( $self ) = @_; + + my $re = $self->{'regex'}; + + return ref($self) . " - $re"; +} + +sub to_string { + my ( $self ) = @_; + + (my $re = $self->{regex}) =~ s{\([^:]*:(.*)\)$}{$1}; + + return "first line matches /$re/"; +} + +BEGIN { + App::Ack::Filter->register_filter(firstlinematch => __PACKAGE__); +} + +1; +package App::Ack::Filter::Is; + +use strict; +use warnings; +BEGIN { + our @ISA = 'App::Ack::Filter'; +} + +use File::Spec 3.00 (); + +sub new { + my ( $class, $filename ) = @_; + + return bless { + filename => $filename, + groupname => 'IsGroup', + }, $class; +} + +sub create_group { + return App::Ack::Filter::IsGroup->new(); +} + +sub filter { + my ( $self, $resource ) = @_; + + my $filename = $self->{'filename'}; + my $base = (File::Spec->splitpath($resource->name))[2]; + + return $base eq $filename; +} + +sub inspect { + my ( $self ) = @_; + + my $filename = $self->{'filename'}; + + return ref($self) . " - $filename"; +} + +sub to_string { + my ( $self ) = @_; + + my $filename = $self->{'filename'}; + + return $filename; +} + +BEGIN { + App::Ack::Filter->register_filter(is => __PACKAGE__); +} + +1; +package App::Ack::Filter::Match; + +use strict; +use warnings; +BEGIN { + our @ISA = 'App::Ack::Filter'; +} + +use File::Spec 3.00; + +sub new { + my ( $class, $re ) = @_; + + $re =~ s{^/|/$}{}g; # XXX validate? + $re = qr/$re/i; + + return bless { + regex => $re, + }, $class; +} + +sub filter { + my ( $self, $resource ) = @_; + + my $re = $self->{'regex'}; + my $base = (File::Spec->splitpath($resource->name))[2]; + + return $base =~ /$re/; +} + +sub inspect { + my ( $self ) = @_; + + my $re = $self->{'regex'}; + + print ref($self) . " - $re"; +} + +sub to_string { + my ( $self ) = @_; + + my $re = $self->{'regex'}; + + return "filename matches $re"; +} + +BEGIN { + App::Ack::Filter->register_filter(match => __PACKAGE__); +} + +1; +package App::Ack::Filter::Default; + +use strict; +use warnings; +BEGIN { + our @ISA = 'App::Ack::Filter'; +} + +sub new { + my ( $class ) = @_; + + return bless {}, $class; +} + +sub filter { + my ( $self, $resource ) = @_; + + return -T $resource->name; +} + +1; +package App::Ack::Filter::Inverse; + +use strict; +use warnings; +BEGIN { + our @ISA = 'App::Ack::Filter'; +} + +sub new { + my ( $class, $filter ) = @_; + + return bless { + filter => $filter, + }, $class; +} + +sub filter { + my ( $self, $resource ) = @_; + + my $filter = $self->{'filter'}; + return !$filter->filter( $resource ); +} + +sub invert { + my $self = shift; + + return $self->{'filter'}; +} + +sub is_inverted { + return 1; +} + +sub inspect { + my ( $self ) = @_; + + my $filter = $self->{'filter'}; + + return "!$filter"; +} + +1; +package App::Ack::Filter::Collection; + +use strict; +use warnings; +BEGIN { + our @ISA = 'App::Ack::Filter'; +} + +use File::Spec 3.00 (); + +sub new { + my ( $class ) = @_; + + return bless { + groups => {}, + ungrouped => [], + }, $class; +} + +sub filter { + my ( $self, $resource ) = @_; + + for my $group (values %{$self->{'groups'}}) { + if ($group->filter($resource)) { + return 1; + } + } + + for my $filter (@{$self->{'ungrouped'}}) { + if ($filter->filter($resource)) { + return 1; + } + } + + return 0; +} + +sub add { + my ( $self, $filter ) = @_; + + if (exists $filter->{'groupname'}) { + my $groups = $self->{'groups'}; + my $group_name = $filter->{'groupname'}; + + my $group; + if (exists $groups->{$group_name}) { + $group = $groups->{$group_name}; + } + else { + $group = $groups->{$group_name} = $filter->create_group(); + } + + $group->add($filter); + } + else { + push @{$self->{'ungrouped'}}, $filter; + } + + return; +} + +sub inspect { + my ( $self ) = @_; + + return ref($self) . " - $self"; +} + +sub to_string { + my ( $self ) = @_; + + my $ungrouped = $self->{'ungrouped'}; + + return join(', ', map { "($_)" } @{$ungrouped}); +} + +1; +package App::Ack::Filter::IsGroup; + +use strict; +use warnings; +BEGIN { + our @ISA = 'App::Ack::Filter'; +} + +use File::Spec 3.00 (); + +sub new { + my ( $class ) = @_; + + return bless { + data => {}, + }, $class; +} + +sub add { + my ( $self, $filter ) = @_; + + $self->{data}->{ $filter->{filename} } = 1; +} + +sub filter { + my ( $self, $resource ) = @_; + + my $data = $self->{'data'}; + my $base = (File::Spec->splitpath($resource->name))[2]; + + return exists $data->{$base}; +} + +sub inspect { + my ( $self ) = @_; + + return ref($self) . " - $self"; +} + +sub to_string { + my ( $self ) = @_; + + return join(' ', keys %{$self->{data}}); +} + +1; +package App::Ack::Filter::ExtensionGroup; + +use strict; +use warnings; +BEGIN { + our @ISA = 'App::Ack::Filter'; +} + +use File::Spec 3.00 (); + +sub new { + my ( $class ) = @_; + + return bless { + data => {}, + }, $class; +} + +sub add { + my ( $self, $filter ) = @_; + + my $data = $self->{'data'}; + my $extensions = $filter->{'extensions'}; + + foreach my $ext (@{$extensions}) { + $data->{lc $ext} = 1; + } +} + +sub filter { + my ( $self, $resource ) = @_; + + if ($resource->name =~ /[.]([^.]*)$/) { + return exists $self->{'data'}->{lc $1}; + } + + return 0; +} + +sub inspect { + my ( $self ) = @_; + + return ref($self) . " - $self"; +} + +sub to_string { + my ( $self ) = @_; + + my $data = $self->{'data'}; + + return join(' ', map { ".$_" } (keys %$data)); +} + +1; +package File::Next; + +use strict; +use warnings; + + +our $VERSION = '1.12'; + + + +use File::Spec (); + +our $name; # name of the current file +our $dir; # dir of the current file + +our %files_defaults; +our %skip_dirs; + +BEGIN { + %files_defaults = ( + file_filter => undef, + descend_filter => undef, + error_handler => sub { CORE::die @_ }, + warning_handler => sub { CORE::warn @_ }, + sort_files => undef, + follow_symlinks => 1, + nul_separated => 0, + ); + %skip_dirs = map {($_,1)} (File::Spec->curdir, File::Spec->updir); +} + + +sub files { + die _bad_invocation() if @_ && defined($_[0]) && ($_[0] eq __PACKAGE__); + + my ($parms,@queue) = _setup( \%files_defaults, @_ ); + my $filter = $parms->{file_filter}; + + return sub { + while (@queue) { + my ($dirname,$file,$fullpath) = splice( @queue, 0, 3 ); + if ( -f $fullpath || -p $fullpath || $fullpath =~ m{^/dev/fd} ) { + if ( $filter ) { + local $_ = $file; + local $File::Next::dir = $dirname; + local $File::Next::name = $fullpath; + next if not $filter->(); + } + return wantarray ? ($dirname,$file,$fullpath) : $fullpath; + } + elsif ( -d _ ) { + unshift( @queue, _candidate_files( $parms, $fullpath ) ); + } + } # while + + return; + }; # iterator +} + + + + + + +sub from_file { + die _bad_invocation() if @_ && defined($_[0]) && ($_[0] eq __PACKAGE__); + + my ($parms,@queue) = _setup( \%files_defaults, @_ ); + my $err = $parms->{error_handler}; + my $warn = $parms->{error_handler}; + + my $filename = $queue[1]; + + if ( !defined($filename) ) { + $err->( 'Must pass a filename to from_file()' ); + return undef; + } + + my $fh; + if ( $filename eq '-' ) { + $fh = \*STDIN; + } + else { + if ( !open( $fh, '<', $filename ) ) { + $err->( "Unable to open $filename: $!" ); + return undef; + } + } + my $filter = $parms->{file_filter}; + + return sub { + local $/ = $parms->{nul_separated} ? "\x00" : $/; + while ( my $fullpath = <$fh> ) { + chomp $fullpath; + next unless $fullpath =~ /./; + if ( not ( -f $fullpath || -p _ ) ) { + $warn->( "$fullpath: No such file" ); + next; + } + + my ($volume,$dirname,$file) = File::Spec->splitpath( $fullpath ); + if ( $filter ) { + local $_ = $file; + local $File::Next::dir = $dirname; + local $File::Next::name = $fullpath; + next if not $filter->(); + } + return wantarray ? ($dirname,$file,$fullpath) : $fullpath; + } # while + close $fh; + + return; + }; # iterator +} + +sub _bad_invocation { + my $good = (caller(1))[3]; + my $bad = $good; + $bad =~ s/(.+)::/$1->/; + return "$good must not be invoked as $bad"; +} + +sub sort_standard($$) { return $_[0]->[1] cmp $_[1]->[1] } +sub sort_reverse($$) { return $_[1]->[1] cmp $_[0]->[1] } + +sub reslash { + my $path = shift; + + my @parts = split( /\//, $path ); + + return $path if @parts < 2; + + return File::Spec->catfile( @parts ); +} + + + +sub _setup { + my $defaults = shift; + my $passed_parms = ref $_[0] eq 'HASH' ? {%{+shift}} : {}; # copy parm hash + + my %passed_parms = %{$passed_parms}; + + my $parms = {}; + for my $key ( keys %{$defaults} ) { + $parms->{$key} = + exists $passed_parms{$key} + ? delete $passed_parms{$key} + : $defaults->{$key}; + } + + # Any leftover keys are bogus + for my $badkey ( keys %passed_parms ) { + my $sub = (caller(1))[3]; + $parms->{error_handler}->( "Invalid option passed to $sub(): $badkey" ); + } + + # If it's not a code ref, assume standard sort + if ( $parms->{sort_files} && ( ref($parms->{sort_files}) ne 'CODE' ) ) { + $parms->{sort_files} = \&sort_standard; + } + my @queue; + + for ( @_ ) { + my $start = reslash( $_ ); + if (-d $start) { + push @queue, ($start,undef,$start); + } + else { + push @queue, (undef,$start,$start); + } + } + + return ($parms,@queue); +} + + +sub _candidate_files { + my $parms = shift; + my $dirname = shift; + + my $dh; + if ( !opendir $dh, $dirname ) { + $parms->{error_handler}->( "$dirname: $!" ); + return; + } + + my @newfiles; + my $descend_filter = $parms->{descend_filter}; + my $follow_symlinks = $parms->{follow_symlinks}; + my $sort_sub = $parms->{sort_files}; + + for my $file ( grep { !exists $skip_dirs{$_} } readdir $dh ) { + my $has_stat; + + # Only do directory checking if we have a descend_filter + my $fullpath = File::Spec->catdir( $dirname, $file ); + if ( !$follow_symlinks ) { + next if -l $fullpath; + $has_stat = 1; + } + + if ( $descend_filter ) { + if ( $has_stat ? (-d _) : (-d $fullpath) ) { + local $File::Next::dir = $fullpath; + local $_ = $file; + next if not $descend_filter->(); + } + } + if ( $sort_sub ) { + push( @newfiles, [ $dirname, $file, $fullpath ] ); + } + else { + push( @newfiles, $dirname, $file, $fullpath ); + } + } + closedir $dh; + + if ( $sort_sub ) { + return map { @{$_} } sort $sort_sub @newfiles; + } + + return @newfiles; +} + + +1; # End of File::Next diff --git a/bin/executable_average b/bin/executable_average new file mode 100644 index 0000000..3a7988f --- /dev/null +++ b/bin/executable_average @@ -0,0 +1,158 @@ +#!/usr/bin/env perl + +# Copyright J.M.P. Alves 2008-2011 (jmalves@vcu.edu) +# This software is licensed under the GNU General Public License v. 3 +# Please see http://www.fsf.org/licensing/licenses/gpl.html for details + +# first version 0.2, 2008-03-24, by J. +# Last update 0.7 2011-07-29, by J. + +use strict; +use warnings; +use Getopt::Long; +Getopt::Long::Configure ("bundling"); + +my($A,$s,$t,$l,$m,$h,$v,$d,$x,$n,$E,$c); + +GetOptions ('a' => \$A, 's' => \$s, 't' => \$t, 'l' => \$l, 'x' => \$x, 'e' => \$E, + 'n' => \$n, 'm' => \$m, 'h' => \$h, 'v' => \$v, 'd=i' => \$d, 'c=i' => \$c); + +my @vals; +my $version = "0.7.1"; +if($h) { print "Version: $version\n\n"; Help(); } +if($v) { print "$version\n"; exit; } +my $type = $E ? "E" : "f"; +$c = $c ? $c - 1 : 0; +unless(defined $d) { $d = "2$type"; } else { $d .= "$type"; } + +while(<>) { + next if $_ =~ /^\s*$/; + chomp; + $_ =~ s/^\s*//; + my @tmp = split(/\s+|\t+/, $_); + unless($tmp[$c] =~ /^\s*[+\-\d\.]+\s*$/ || $tmp[$c] =~ /^\s*[+\-\d\.e]+\s*$/i) { next; } + my $flag = 0; + local $SIG{__WARN__} = sub { + print "WARNING: Possible non-numeric value found, ignored: $_\n"; + $flag = 1; + }; + my $test = $tmp[$c] + 1; + unless($flag) { push @vals, $tmp[$c]; } +} + +unless(scalar(@vals)) { print STDERR "ERROR: No numerical values found. I quit.\n"; exit; } +if(scalar(@vals) == 1) { print STDERR "ERROR: Only one numerical value (@vals) found. Nothing to do, so I quit.\n"; exit; } + +my($sum, $av, $sd, $median, $min, $max); + +($sum, $av) = avrg(@vals); +$sd = stddev($av, @vals); +($median,$min,$max) = median(@vals); + +if($l || !($A || $s || $t || $m || $x || $n)) { + printf "%.$d +/- %.$d, total %.$d, median %.$d, minimum %.$d, maximum %.$d, n = %d\n", $av, $sd, $sum, $median, $min, $max, scalar(@vals); + exit; +} +if($A && !$s) { printf "%.$d\n", $av; exit; } +if($s) { printf "%.$d\t%.$d\n", $av, $sd; exit; } +if($t) { printf "%.$d\n", $sum; exit; } +if($m) { printf "%.$d\n", $median; exit; } +if($n) { printf "%.$d\n", $min; exit; } +if($x) { printf "%.$d\n", $max; exit; } + +exit; + +############################## + +sub avrg { + my $size = scalar(@_); + my($sum,$med); + for my $Valor (@_) { $sum += $Valor; } + if ($size) { $med = $sum/$size; } + else { $med = 0; } + return $sum, $med; +} + +############################## + +sub stddev { + my($media) = shift(@_); + my(@Lista) = @_; + my $nonzero = 0; + my($sum,$sd); + for ($a=0; $a < scalar(@Lista); $a++) { + $nonzero++; + $sum += (($Lista[$a] - $media) ** 2); + } + if ($nonzero) { $sd = sqrt($sum/($nonzero-1)); } + else { $sd = 0; } + return $sd; +} + +############################## + +sub median { + my @list = sort {$a<=>$b} @_; + if(scalar(@list) % 2 != 0) { + my $ind = int(scalar(@list)/2); + return $list[$ind], $list[0], $list[$#list]; + } + else { + my $ind = scalar(@list)/2 -1; + my(undef, $median) = avrg($list[$ind],$list[$ind+1]); + return $median, $list[0], $list[$#list]; + } +} + +############################## + +sub Help { + my (@stuff) = <DATA>; + print @stuff; + exit; +} + +############################## + +__DATA__ +average +------- + +Usage: + average [options] + +Synopsis: + Takes a series of numbers and calculates simple statistics: average (arithmetic + mean), standard deviation, median, total sum, and minimum and maximum values + present. For version 0.6 and later, also works with scientific notation numbers. + + Numbers can be in a file or presented from standard input (press control-d + to end number input after last number). Output is to standard output. + + Input can also have more than one column, in which case the column to use + in calculations can be determined using the -c option. Otherwise, the first + column is used (leading spaces are ignored; repeated whitespace is considered + as one). + +Options: + -d Number of decimal places to show (default: 2); + -c Column to use for calculations (default: 1); + -e Output in scientific notation (e.g. 1E12); + -a Shows only the arithmetic mean; + -s Shows arithmetic mean and the standard deviation; + -t Shows only the total sum of the numbers; + -m Shows only the median; + -n Shows only the minimum value; + -x Shows only the maximum value; + -l Long format, presenting all of the above (default); + -v Prints program version and exits; + -h Prints this help message and exits. + + * Options listed first have precedence over the ones below; e.g. if the user + uses both -t and -n, only -t will have an effect (total sum only will be shown). + * If average is used without any options, all statistics are shown (same as -l). + +Copyright J.M.P. Alves 2008-2011 (jmalves@vcu.edu) +This software is licensed under the GNU General Public License v. 3. +Please see http://www.fsf.org/licensing/licenses/gpl.html for details. + diff --git a/bin/executable_battery b/bin/executable_battery new file mode 100644 index 0000000..03ce28b --- /dev/null +++ b/bin/executable_battery @@ -0,0 +1,132 @@ +#!/bin/sh + +HEART_FULL=♥ +HEART_EMPTY=♡ +[ -z "$NUM_HEARTS" ] && + NUM_HEARTS=5 + +cutinate() +{ + perc=$1 + inc=$(( 100 / $NUM_HEARTS)) + + + for i in `seq $NUM_HEARTS`; do + if [ $perc -lt 100 ]; then + echo $HEART_EMPTY + else + echo $HEART_FULL + fi + perc=$(( $perc + $inc )) + done +} + +linux_get_bat () +{ + echo $(( $BAT_TOTAL / $BAT_COUNT )) +} + + +openbsd_get_bat () +{ + bf=$(sysctl -n hw.sensors.acpibat0.amphour0 | cut -d ' ' -f 1) + bn=$(sysctl -n hw.sensors.acpibat0.amphour3 | cut -d ' ' -f 1) + echo "(($bn * 100) / $bf)" | bc -l | awk -F '.' '{ print $1 }'; +} + +freebsd_get_bat () +{ + sysctl -n hw.acpi.battery.life +} + +battery_status() +{ +case $(uname -s) in + "Linux") + BATTERIES=$(ls /sys/class/power_supply | grep BAT) + BAT_COUNT=$(ls /sys/class/power_supply | grep BAT | wc -l) + [ $BAT_COUNT -eq 0 ] && return + for BATTERY in $BATTERIES; do + BAT_PATH=/sys/class/power_supply/$BATTERY + STATUS=$BAT_PATH/status + [ "$1" = `cat $STATUS` ] || [ "$1" = "" ] || return 0 + if [ -f "$BAT_PATH/energy_full" ]; then + naming="energy" + elif [ -f "$BAT_PATH/charge_full" ]; then + naming="charge" + elif [ -f "$BAT_PATH/capacity" ]; then + cat "$BAT_PATH/capacity" + return 0 + fi + BAT_PERCENT=$(( 100 * $(cat $BAT_PATH/${naming}_now) / $(cat $BAT_PATH/${naming}_full) )) + BAT_TOTAL=$(( ${BAT_TOTAL-0} + $BAT_PERCENT )) + done + linux_get_bat + ;; + "FreeBSD") + STATUS=`sysctl -n hw.acpi.battery.state` + case $1 in + "Discharging") + if [ $STATUS -eq 1 ]; then + freebsd_get_bat + fi + ;; + "Charging") + if [ $STATUS -eq 2 ]; then + freebsd_get_bat + fi + ;; + "") + freebsd_get_bat + ;; + esac + ;; + "OpenBSD") + openbsd_get_bat + ;; + "Darwin") + case $1 in + "Discharging") + ext="No";; + "Charging") + ext="Yes";; + esac + + ioreg -c AppleSmartBattery -w0 | \ + grep -o '"[^"]*" = [^ ]*' | \ + sed -e 's/= //g' -e 's/"//g' | \ + sort | \ + while read key value; do + case $key in + "MaxCapacity") + export maxcap=$value;; + "CurrentCapacity") + export curcap=$value;; + "ExternalConnected") + if [ -n "$ext" ] && [ "$ext" != "$value" ]; then + exit + fi + ;; + "FullyCharged") + if [ "$value" = "Yes" ]; then + exit + fi + ;; + esac + if [[ -n "$maxcap" && -n $curcap ]]; then + echo $(( 100 * $curcap / $maxcap )) + break + fi + done +esac +} + +BATTERY_STATUS=`battery_status $1` +[ -z "$BATTERY_STATUS" ] && exit + +if [ -n "$CUTE_BATTERY_INDICATOR" ]; then + cutinate $BATTERY_STATUS +else + echo ${BATTERY_STATUS}% +fi + diff --git a/bin/executable_callout b/bin/executable_callout new file mode 100644 index 0000000..5664189 --- /dev/null +++ b/bin/executable_callout @@ -0,0 +1,13 @@ +#!/usr/bin/ruby + +x = readline() +x = x.strip +(x.length() + 4).times {print "*"} +print "\n" +print "* " +print x +print " *\n" + +(x.length() + 4).times {print "*"} +print "\n" + diff --git a/bin/executable_contract b/bin/executable_contract new file mode 100644 index 0000000..f7bbeeb --- /dev/null +++ b/bin/executable_contract @@ -0,0 +1,34 @@ +#!/usr/bin/env python2 + +import sys + +loadfile = sys.stdin + +if len(sys.argv) == 1: + print("No command to run") + sys.exit(1) + +if len(sys.argv) == 3: + if sys.argv[2] != "-": + loadfile = open(sys.argv[2]) + +def add(x, y): + return x + y + +def sub(x, y): + return x - y + +def mult(x, y): + return x * y + +def div(x,y): + return x / y; + +lis = [] +for line in loadfile: + if line.strip() is not "": + x = float(line) + lis.append(x) + +print reduce(eval(sys.argv[1]), lis) + diff --git a/bin/executable_cronic b/bin/executable_cronic new file mode 100644 index 0000000..8536f29 --- /dev/null +++ b/bin/executable_cronic @@ -0,0 +1,48 @@ +#!/bin/bash + +# Cronic v2 - cron job report wrapper +# Copyright 2007 Chuck Houpt. No rights reserved, whatsoever. +# Public Domain CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +set -eu + +OUT=/tmp/cronic.out.$$ +ERR=/tmp/cronic.err.$$ +TRACE=/tmp/cronic.trace.$$ + +set +e +"$@" >$OUT 2>$TRACE +RESULT=$? +set -e + +PATTERN="^${PS4:0:1}\\+${PS4:1}" +if grep -aq "$PATTERN" $TRACE +then + ! grep -av "$PATTERN" $TRACE > $ERR +else + ERR=$TRACE +fi + +if [ $RESULT -ne 0 -o -s "$ERR" ] + then + echo "Cronic detected failure or error output for the command:" + echo "$@" + echo + echo "RESULT CODE: $RESULT" + echo + echo "ERROR OUTPUT:" + cat "$ERR" + echo + echo "STANDARD OUTPUT:" + cat "$OUT" + if [ $TRACE != $ERR ] + then + echo + echo "TRACE-ERROR OUTPUT:" + cat "$TRACE" + fi +fi + +rm -f "$OUT" +rm -f "$ERR" +rm -f "$TRACE" diff --git a/bin/executable_gblame b/bin/executable_gblame new file mode 100644 index 0000000..be49356 --- /dev/null +++ b/bin/executable_gblame @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 + +import subprocess +import sys +import os + +from typing import List, Dict, Any + +DataLine = Dict[Any, Any] + + +def grab_blame_data() -> List[DataLine]: + p = subprocess.check_output( + ["git", "blame", "--line-porcelain"] + sys.argv[1:], + encoding='utf-8', + ) + data = [] + cur = {} + p = str(p) + in_segment = False + for line in p.splitlines(): + l = line.rstrip() + if len(l) == 0: + continue + if l[0] == '\t': + cur["data"] = l[1:] + data.append(cur) + cur = {} + in_segment = False + continue + d = l.split() + if not in_segment: + cur["sha"] = d[0] + cur["sha8"] = d[0][:8] + in_segment = True + else: + cur[d[0]] = " ".join(d[1:]) + + assert in_segment is False + return data + + +FIELDS = ["sha8", "author", "summary", "data"] + + +def main() -> None: + d = grab_blame_data() + lens = {} + for f in FIELDS: + maxn = 0 + for x in d: + if len(x[f]) > maxn: + maxn = len(x[f]) + lens[f] = maxn + for x in d: + s = "" + for f in FIELDS: + s = s + x[f].ljust(lens[f]) + ' ' + print(s) + + +if __name__ == "__main__": + main() diff --git a/bin/executable_golintc b/bin/executable_golintc new file mode 100644 index 0000000..90b9c78 --- /dev/null +++ b/bin/executable_golintc @@ -0,0 +1,22 @@ +#!/usr/bin/env perl +use strict; +use warnings; + +my $a = join(" ", @ARGV); +my $cmd = "golint " . $a; +open(my $fh, '-|', $cmd) + or die "Could not run golint"; + +my $cnt = 0; +while (my $row = <$fh>) { + chomp $row; + if ($row !~ /should have comment or be unexported/) { + print "$row\n"; + $cnt++; + } +} + +if ($cnt > 0) { + exit 1; +} +exit 0; diff --git a/bin/executable_orly b/bin/executable_orly new file mode 100644 index 0000000..68f664e --- /dev/null +++ b/bin/executable_orly @@ -0,0 +1,119 @@ +#!/usr/bin/perl + +# +# Globals +# +use vars qw/$deftext %opt /; + +# +# Command line options processing +# +sub init() +{ + use Getopt::Std; + my $opt_string = 'hdoynsi'; + getopts( "$opt_string", \%opt ) or usage(); + usage() if $opt{h}; +} + +# +# Message about this program and how to use it +# +sub usage() +{ + print STDERR << "EOF"; + +orly -- Print an O RLY owl + +usage: $0 [-hdoyn] [<MESSAGE>] + + -h : this (help) message + -o, -d : print the "O RLY" owl + -y : print the "YA RLY" owl + -n : print the "NO WAI!" owl + -s : Print "SRSLY" as a question, statement or + exclamation, respectively for the above. + -i : take MESSAGE from STDIN + +EOF + exit; +} + +sub printorly() { + $deftext = "O RLY?"; + print << "EOO" + ___ +{o,o} +|)__) +-"-"- +EOO +} + +sub printyarly() { + $deftext = "YA RLY"; + print << "EOO" + ___ +{o.o} +|)_(| +-"-"- +EOO +} + +sub printnowai() { + $deftext = "NO WAI!"; + print << "EOO" + ___ + {o,o} + (__(| + -"-"- +EOO +} + +$givenstatement = ""; +for ($i=0; $i<($#ARGV + 1); $i++) +{ + if (substr($ARGV[$i],0,1) ne "-") + { + $up = uc($ARGV[$i]); + $givenstatement = "$givenstatement$up "; + } +} + +init(); + +if ($opt{i}) { + while (<STDIN>) { + $givenstatement = $givenstatement.uc($_); + } + chomp($givenstatement); +} +if ($opt{y}) { + printyarly(); + $deftext = "SRSLY" if ($opt{s}); +} +elsif ($opt{n}) { + printnowai(); + $deftext = "SRSLY!" if ($opt{s}); +} +elsif ($opt{d} || $opt {o}) { + printorly(); + $deftext = "SRSLY?" if ($opt{s}); +} +elsif ($opt{s}) { + printyarly(); + $deftext = "SRSLY"; +} +else { + printorly(); +} + +if ($givenstatement) +{ + print "$givenstatement\n"; +} +else +{ + print "$deftext\n"; +} + +exit; diff --git a/bin/executable_pk b/bin/executable_pk new file mode 100644 index 0000000..a7edbdf --- /dev/null +++ b/bin/executable_pk @@ -0,0 +1,61 @@ +#!/bin/sh +search () { + shift + if command -v pacman &> /dev/null; then + pacman -Ss $1 || yay -Ss $1 + elif command -v dnf &> /dev/null; then + dnf search $1 + elif command -v port &> /dev/null; then + port search $1 + elif command -v portmaster &> /dev/null; then + cd /usr/ports + make search name=$1 | grep "^\(Port\|Path\|Info\|Moved\|$\)" + elif command -v aptitude &> /dev/null; then + aptitude search $1 + elif command -v apt-cache &> /dev/null; then + apt-cache search $1 + fi +} + +update () { + shift + if command -v pacman &> /dev/null; then + sudo pacman -Sy + elif command -v dnf &> /dev/null; then + sudo dnf update + elif command -v port &> /dev/null; then + sudo port selfupdate + elif command -v portsnap &> /dev/null; then + sudo portsnap fetch && sudo portsnap upgrade + elif command -v apt-get &> /dev/null; then + sudo apt-get update + fi +} + +install () { + shift + if command -v pacman &> /dev/null; then + sudo pacman -S $* || yay -S $* + elif command -v dnf &> /dev/null; then + sudo dnf install $* + elif command -v port &> /dev/null; then + sudo port install $* + elif command -v portmaster &> /dev/null; then + sudo portmaster $* + elif command -v apt-get &> /dev/null; then + sudo apt-get install $* + fi +} + +case $1 +in + "i" | "install") + install $*;; + + "s" | "search") + search $*;; + + "u" | "update") + update $*;; +esac + diff --git a/bin/executable_theyfightcrime b/bin/executable_theyfightcrime new file mode 100644 index 0000000..d04e18b --- /dev/null +++ b/bin/executable_theyfightcrime @@ -0,0 +1,35 @@ +#!/usr/bin/env python2 +# +# They Fight Crime! +# +# taken from the Javascript at +# http://home.epix.net/~mhryvnak/theyfightcrime.html +# and translated into python by B. Michener +# + +import random + +#init a; +a = [0, 1, 2, 3, 4, 5, 6, 7] +for i in range(0,8): + a[i] = random.randint(0,39) + +he1 = ["a superhumanly strong","an underprivileged","a globe-trotting","an impetuous","a shy","a suave","a notorious","a one-legged","an all-American","a short-sighted","an otherworldly","a hate-fuelled","a scrappy","an unconventional","a jaded","a leather-clad","a fiendish","a Nobel prize-winning","a suicidal","a maverick","a bookish","an old-fashioned","a witless","a lounge-singing","a war-weary","a scarfaced","a gun-slinging","an obese","a time-tossed","a benighted","an uncontrollable","an immortal","an oversexed","a world-famous","an ungodly","a fast talking","a deeply religious","a lonely","a sword-wielding","a genetically engineered"] + +he2 = ["white trash","zombie","shark-wrestling","playboy","guitar-strumming","Jewish","sweet-toothed","bohemian","crooked","chivalrous","moralistic","amnesiac","devious","drug-addicted","voodoo","Catholic","overambitious","coffee-fuelled","pirate","misogynist","skateboarding","arachnophobic","Amish","small-town","Republican","one-eyed","gay","guerilla","vegetarian","dishevelled","alcoholic","flyboy","ninja","albino","hunchbacked","neurotic","umbrella-wielding","native American","soccer-playing","day-dreaming"] + +he3 = ["grifter","stage actor","paramedic","gentleman spy","jungle king","hairdresser","photographer","ex-con","vagrant","filmmaker","werewolf","senator","romance novelist","shaman","cop","rock star","farmboy","cat burglar","cowboy","cyborg","inventor","assassin","boxer","dog-catcher","master criminal","gangster","firefighter","househusband","dwarf","librarian","paranormal investigator","Green Beret","waffle chef","vampire hunter","messiah","astronaut","sorceror","card sharp","matador","barbarian"] + +he4 = ["with a robot buddy named Sparky.","whom everyone believes is mad.","gone bad.","with a mysterious suitcase handcuffed to his arm.","living undercover at Ringling Bros. Circus.","searching for his wife's true killer.","who dotes on his loving old ma.","looking for 'the Big One.'","who knows the secret of the alien invasion.","on the edge.","on a mission from God.","with a secret.","in drag.","","plagued by the memory of his family's brutal murder.","looking for a cure to the poison coursing through his veins.","moving from town to town, helping folk in trouble.","who must take medication to keep him sane.","who hangs with the wrong crowd.","possessed of the uncanny powers of an insect.","with a winning smile and a way with the ladies.","fleeing from a secret government programme.","from the 'hood.","haunted by an iconic dead American confidante","with a passion for fast cars.","trapped in a world he never made.","in a wheelchair.","on the hunt for the last specimen of a great and near-mythical creature.","on the run.","for the 21st century.","who hides his scarred face behind a mask.","on the wrong side of the law.","with no name.","from the Mississippi delta.","with acid for blood.","with nothing left to lose.","haunted by memories of 'Nam.","on a search for his missing sister.","on his last day in the job.","from a doomed world.","who believes he can never love again."] + +she1 = ["a radical","a green-fingered","a tortured","a time-travelling","a vivacious","a scantily clad","a mistrustful","a violent","a transdimensional","a strong-willed","a ditzy","a man-hating","a high-kicking","a blind","an elegant","a supernatural","a foxy","a bloodthirsty","a cynical","a beautiful","a plucky","a sarcastic","a psychotic","a hard-bitten","a manipulative","an orphaned","a cosmopolitan","a chain-smoking","a cold-hearted","a warm-hearted","a sharp-shooting","an enchanted","a wealthy","a pregnant","a mentally unstable","a virginal","a brilliant","a disco-crazy","a provocative","an artistic"] + +she2 = ["tempestuous","Buddhist","foul-mouthed","nymphomaniac","green-skinned","impetuous","African-American","punk","hypochondriac","junkie","blonde","goth","insomniac","gypsy","mutant","renegade","tomboy","French-Canadian","motormouth","belly-dancing","communist","hip-hop","thirtysomething","cigar-chomping","extravagent","out-of-work","Bolivian","mute","cat-loving","snooty","wisecracking","red-headed","winged","kleptomaniac","antique-collecting","psychic","gold-digging","bisexual","paranoid","streetsmart"] + +she3 = ["archaeologist","pearl diver","mechanic","detective","hooker","femme fatale","former first lady","barmaid","fairy princess","magician's assistant","schoolgirl","college professor","angel","bounty hunter","opera singer","cab driver","soap star","doctor","politician","lawyer","nun","snake charmer","journalist","bodyguard","vampire","stripper","Valkyrie","wrestler","mermaid","single mother","safe cracker","traffic cop","research scientist","queen of the dead","Hell's Angel","museum curator","advertising executive","widow","mercenary","socialite"] + +she4 = ["on her way to prison for a murder she didn't commit.","trying to make a difference in a man's world.","with the soul of a mighty warrior.","looking for love in all the wrong places.","with an MBA from Harvard.","who hides her beauty behind a pair of thick-framed spectacles.","with the power to see death.","descended from a line of powerful witches.","from a family of eight older brothers.","with a flame-thrower.","with her own daytime radio talk show.","living on borrowed time.","who can talk to animals.","prone to fits of savage, blood-crazed rage.","who don't take no shit from nobody.","with a knack for trouble.","who believes she is the reincarnation of an ancient Egyptian queen.","fleeing from a Satanic cult.","on the trail of a serial killer.","with a birthmark shaped like Liberty's torch.","in the witness protection scheme.","from out of town.","from aristocratic European stock.","living homeless in New York's sewers.","with only herself to blame.","from beyond the grave","married to the Mob.","from the wrong side of the tracks.","from a secret island of warrior women.","from Mars.","with someone else's memories.","from a different time and place.","operating on the wrong side of the law.","who inherited a spooky stately manor from her late maiden aunt.","who dreams of becoming Elvis.","with a song in her heart and a spring in her step.","in the wrong place at the wrong time.","with an incredible destiny.","with the power to bend men's minds.","with an evil twin sister."] + +print "He's " + he1[a[0]] + " " + he2[a[1]] + " " + he3[a[2]] + " " + he4[a[3]], +print "She's " + she1[a[4]] + " " + she2[a[5]] + " " + she3[a[6]] + " " + she4[a[7]], +print "They fight crime!" diff --git a/bin/executable_vi b/bin/executable_vi new file mode 100644 index 0000000..fe58154 --- /dev/null +++ b/bin/executable_vi @@ -0,0 +1,8 @@ +#!/bin/sh + +export TERM=xterm-256color +if [ -n "`which nvim`" ]; then + exec -a nvim nvim "$@" +else + exec -a vim vim "$@" +fi diff --git a/bin/executable_xinput-toggle b/bin/executable_xinput-toggle new file mode 100644 index 0000000..94529fe --- /dev/null +++ b/bin/executable_xinput-toggle @@ -0,0 +1,181 @@ +#!/bin/bash + +debug() { + # DEBUG comes from the environment + if (( DEBUG )); then + printf '%s\n' "$@" >&2 + fi +} + +is_enabled() { + local id="${1?}" + enabled=$( + xinput list-props "$id" | + grep '\bDevice Enabled\b' | sed 's/.*\(.\)$/\1/' + ) + # xinput returns 0 for disabled and 1 for enabled, so we invert since we + # pass on 0 + return "$(( !enabled ))" +} + +should_disable() { + local id="${1?}" + local force_enable="${2?}" + local force_disable="${3?}" + + if (( force_enable )) && (( force_disable )); then + echo '-d and -e make no sense together' >&2 + exit 3 + fi + + if (( force_enable )); then + return 1 + elif (( force_disable )); then + return 0 + elif is_enabled "$id"; then + return 0 + else + return 1 + fi +} + +get_id_for_device_name() { + local name="${1?}" + xinput list "$name" | sed -n 's/.*id=\([0-9]\+\).*/\1/p' +} + +show_help() { + cat << EOF +Usage: ${0##*/} [-n] + +Enable and disable xinput devices. + + -d disable only, do not toggle + -e enable only, do not toggle + -h show this help page + -i XID only operate on device with xinput id XID + -r REGEX only operate on devices matching name REGEX + -n show results using notify-send in addition to stdout + -p print what we would do, but don't actually do it + -t SECONDS revert enable/disable after SECONDS seconds, ie. if you were + enabling, after SECONDS seconds it will be disabled again. + SECONDS must be an integer greater than 0 +EOF +} + +act_on_device() { + local print="${1?}" + local notify="${2?}" + local timeout="${3?}" + local xinput_action="${4?}" + local our_next_flag="${5?}" + local id="${6?}" + + if (( print )); then + echo "Would $xinput_action device with id $id" + else + xinput -"$xinput_action" "$id" + + if (( notify )); then + notify-send "${xinput_action^}d device with id $id" + fi + + if (( timeout )); then + debug "Added timeout $timeout" + { + sleep "$timeout" + # TODO: Make args_without_timeour_or_force non-global (sigh, + # shell makes this difficult due to pass by value) + "$0" "${args_without_timeout_or_force[@]}" \ + "$our_next_flag" -i "$id" + } & + fi + fi +} + +notify=0 +force_enable=0 +force_disable=0 +timeout=0 +print=0 +only_xid=0 +input_ids=() +args_without_timeout_or_force=() + +while getopts dehi:npr:t: opt; do + # We need to get a list of args without timeout/force for when we execute + # timeout reversions. This is a blacklist of things we should not put in + # the array, since they force enable/disable/name or do the timeout itself. + case "$opt" in + d|e|t|r) + : # Blacklisted + ;; + *) + args_without_timeout_or_force+=( -"$opt" ) + if [[ $OPTARG ]]; then + args_without_timeout_or_force+=( "$OPTARG" ) + fi + ;; + esac + + case "$opt" in + 'd') force_disable=1 ;; + 'e') force_enable=1 ;; + 'n') notify=1 ;; + 'i') only_xid="$OPTARG" ;; + 'h') + show_help + exit 0 + ;; + 'p') print=1 ;; + 'r') regex="$OPTARG" ;; + 't') timeout="$OPTARG" ;; + '?') + show_help >&2 + exit 1 + ;; + esac +done + +if (( only_xid )) && [[ "$regex" ]]; then + echo '-r and -i cannot be currently used together' >&2 + exit 4 +elif ! (( only_xid )) && ! [[ "$regex" ]]; then + echo 'either -r or -i must be passed to filter devices' >&2 + exit 5 +fi + +if (( only_xid )); then + input_ids=( "$only_xid" ) +else + mapfile -t matched_device_names < <( + xinput list | + sed -n 's/.*↳ \(.\+\)id=.*\[slave.*/\1/p' | + sed 's/[\t ]*$//' | + grep -i -- "$regex" + ) + + debug 'Matched device names:' "${matched_device_names[@]}" + + for name in "${matched_device_names[@]}"; do + input_ids+=( "$(get_id_for_device_name "$name")" ) + done +fi + +if (( "${#input_ids[@]}" == 0 )); then + msg='No matching devices found' + echo "$msg" >&2 + (( notify )) && notify-send "$msg" + exit 2 +fi + +for id in "${input_ids[@]}"; do + if should_disable "$id" "$force_enable" "$force_disable"; then + act_on_device "$print" "$notify" "$timeout" disable -e "$id" + else + act_on_device "$print" "$notify" "$timeout" enable -d "$id" + fi +done + +# We may have queued some timeout reversion jobs +wait From 3a929aab1472bf6ea8f750e85ead584fa5f4c576 Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 18 May 2024 18:40:01 -0700 Subject: [PATCH 075/126] chezmoiexternal --- .chezmoiexternal.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .chezmoiexternal.toml diff --git a/.chezmoiexternal.toml b/.chezmoiexternal.toml new file mode 100644 index 0000000..6df5d05 --- /dev/null +++ b/.chezmoiexternal.toml @@ -0,0 +1,4 @@ +[".tmux/plugins/tpm"] + type = "git-repo" + url = "https://github.com/tmux-plugins/tpm" + refreshPeriod = "168h" From f0510126bac8421e5fbd205ce4da1ebc99d4073f Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 18 May 2024 18:49:07 -0700 Subject: [PATCH 076/126] alacritty chezmoi --- dot_config/alacritty/alacritty.toml.tmpl | 131 +++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 dot_config/alacritty/alacritty.toml.tmpl diff --git a/dot_config/alacritty/alacritty.toml.tmpl b/dot_config/alacritty/alacritty.toml.tmpl new file mode 100644 index 0000000..c6cca03 --- /dev/null +++ b/dot_config/alacritty/alacritty.toml.tmpl @@ -0,0 +1,131 @@ +[bell] +color = "#ffffff" +duration = 200 + +[colors] +draw_bold_text_with_bright_colors = false + +[colors.bright] +black = "#565656" +blue = "#49a4f8" +cyan = "#99faf2" +green = "#c0e17d" +magenta = "#a47de9" +red = "#ec5357" +white = "#ffffff" +yellow = "#f9da6a" + +[colors.normal] +black = "#2e2e2e" +blue = "#47a0f3" +cyan = "#64dbed" +green = "#abe047" +magenta = "#7b5cb0" +red = "#eb4129" +white = "#e5e9f0" +yellow = "#f6c744" + +[colors.primary] +background = "#000000" +foreground = "#fffbf6" + +[env] +TERM = "xterm-256color" + +[font] +{{- if eq .chezmoi.hostname "mercutio" }} +size = 19.0 +{{- else }} +size = 20.0 +{{- end }} + +[font.bold] +style = "Semi-Condensed" +#style = "Regular" + +[font.bold_italic] +style = "Semi-Condensed Oblique" +#style = "Italic" + +[font.italic] +style = "Light Semi-Condensed Oblique" +#style = "Light Italic" + +[font.normal] +family = "Iosevka Berkeley" +style = "Light Semi-Condensed" +#style = "Light" + +[hints] +alphabet = "jfkdls;ahgurieowpq" + +[[hints.enabled]] +action = "Copy" +regex = "[a-f0-9]{7,}" + +[hints.enabled.binding] +key = "H" +mods = "Control|Shift" + +[[hints.enabled]] +action = "Copy" +regex = "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" + +[hints.enabled.binding] +key = "U" +mods = "Control|Shift" + +[[hints.enabled]] +command = "xdg-open" +post_processing = true +regex = "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" + +[hints.enabled.binding] +key = "L" +mods = "Control|Shift" + +[hints.enabled.mouse] +enabled = true +mods = "None" + +[[keyboard.bindings]] +action = "ToggleViMode" +key = "Q" +mode = "Vi|~Search" + +[[keyboard.bindings]] +action = "Paste" +key = "P" +mode = "Vi|~Search" + +[[keyboard.bindings]] +action = "ToggleFullscreen" +key = "Return" +mods = "Alt" + +[[keyboard.bindings]] +action = "ToggleFullscreen" +key = "Return" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u001B." +key = "Period" +mods = "Command" + +[scrolling] +history = 10000 +multiplier = 3 + +[window] +opacity = 0.88 +startup_mode = "Windowed" +#decorations = "None" + +[window.dimensions] +columns = 106 +lines = 24 + +[window.padding] +x = 3 +y = 3 From 7a7c647c221f8c9bd583e6373f6b183d3a0e201d Mon Sep 17 00:00:00 2001 From: Barak Michener <me@barakmich.com> Date: Sat, 18 May 2024 18:50:38 -0700 Subject: [PATCH 077/126] dot_vim --- .vim/after/ftplugin/go.vim | 1 - .vim/after/ftplugin/haskell.vim | 2 - .vim/after/ftplugin/qf.vim | 3 - .vim/after/syntax/cocoa_keywords.vim | 28 - .vim/after/syntax/objc_enhanced.vim | 59 - .vim/autoload/airline/themes/barak.vim | 61 - .vim/autoload/genutils.vim | 1954 ------------------- .vim/autoload/lookupfile.vim | 472 ----- .vim/autoload/objc/cocoacomplete.vim | 215 --- .vim/autoload/objc/man.vim | 160 -- .vim/autoload/objc/method_builder.vim | 124 -- .vim/autoload/objc/method_list.vim | 115 -- .vim/autoload/objc/pum_snippet.vim | 87 - .vim/autoload/pathogen.vim | 328 ---- .vim/autoload/plug.vim | 2812 ---------------------------- .vim/autoload/pythoncomplete.vim | 625 ------- .vim/autoload/rubycomplete.vim | 530 ------ .vim/autoload/snipMate.vim | 433 ----- .vim/buftabs.vim | 309 --- .vim/charm.vim | 18 - .vim/closetag.vim | 327 ---- .vim/coc-settings.json | 34 - .vim/colors/barak.vim | 110 -- .vim/colors/baraknew.vim | 434 ----- .vim/colors/dante.vim | 83 - .vim/colors/ir_black.vim | 212 --- .vim/colors/lucius.vim | 346 ---- .vim/colors/ps_color.vim | 469 ----- .vim/colors/zenburn.vim | 245 --- .vim/doc/NERD_tree.txt | 1077 ----------- .vim/doc/bufexplorer.txt | 442 ----- .vim/doc/cocoa.txt | 151 -- .vim/doc/matchit.txt | 406 ---- .vim/doc/project.txt | 710 ------- .vim/doc/ps_color.txt | 603 ------ .vim/doc/snipMate.txt | 286 --- .vim/doc/tags | 354 ---- .vim/doc/vcscommand.txt | 819 -------- .vim/filetype.vim | 147 -- .vim/ftdetect/proto.vim | 1 - .vim/ftdetect/scala.vim | 3 - .vim/ftplugin/html_snip_helper.vim | 10 - .vim/ftplugin/objc_cocoa_mappings.vim | 70 - .vim/indent/cpp.vim | 92 - .vim/indent/gohtmltmpl.vim | 54 - .vim/indent/haskell.vim | 96 - .vim/indent/javascript.vim | 330 ---- .vim/indent/mako.vim | 353 ---- .vim/indent/python.vim | 196 -- .vim/indent/scala.vim | 85 - .vim/init.vim | 3 - .vim/lua/lir_setup.lua | 88 - .vim/lua/lualine_setup.lua | 28 - .vim/markdown_cheatsheet.md | 376 ---- .vim/nvim.lua | 678 ------- .vim/plugin/AppleT.vim | 73 - .vim/plugin/a.vim | 840 --------- .vim/plugin/bclose.vim | 70 - .vim/plugin/camelcasemotion.vim | 449 ----- .vim/plugin/cocoa.vim | 16 - .vim/plugin/cscope_maps.vim | 166 -- .vim/plugin/cscopemenu.vim | 24 - .vim/plugin/genutils.vim | 996 ---------- .vim/plugin/gotags.vim | 27 - .vim/plugin/matchit.vim | 812 -------- .vim/plugin/vcsbzr.vim | 257 --- .vim/plugin/vcscommand.vim | 1402 -------------- .vim/plugin/vcscvs.vim | 445 ----- .vim/plugin/vcsgit.vim | 248 --- .vim/plugin/vcshg.vim | 273 --- .vim/plugin/vcssvk.vim | 258 --- .vim/plugin/vcssvn.vim | 283 --- .vim/plugin/vim-scmdiff/NEWS | 24 - .vim/plugin/vim-scmdiff/README | 22 - .vim/plugin/vim-scmdiff/TODO | 11 - .vim/plugin/vim-scmdiff/scmdiff.vim | 160 -- .vim/skeletons/svelte.skel | 9 - .vim/skeletons/vue.skel | 19 - .vim/syntax/c.vim | 377 ---- .vim/syntax/cvsannotate.vim | 45 - .vim/syntax/gitannotate.vim | 44 - .vim/syntax/haskell.vim | 355 ---- .vim/syntax/hgannotate.vim | 40 - .vim/syntax/java.vim | 9 - .vim/syntax/javascript.vim | 247 --- .vim/syntax/lilypond-words | 1040 ---------- .vim/syntax/lilypond-words.vim | 3 - .vim/syntax/lilypond.vim | 83 - .vim/syntax/mako.vim | 83 - .vim/syntax/mediawiki.vim | 304 --- .vim/syntax/mkd.vim | 104 - .vim/syntax/motd.vim | 23 - .vim/syntax/nvpscript.vim | 72 - .vim/syntax/proto.vim | 105 -- .vim/syntax/scala.vim | 153 -- .vim/syntax/snippet.vim | 19 - .vim/syntax/svkannotate.vim | 42 - .vim/syntax/svnannotate.vim | 40 - .vim/syntax/vcscommit.vim | 31 - .vim/syntax_checkers/go/golintc.vim | 42 - .vim/syntax_checkers/go/gonyet.vim | 49 - .vim/syntax_checkers/go/govetshadow.vim | 52 - .vim/tabbar.vim | 1646 ---------------- .vim/usnips/c.snippets | 87 - .vim/usnips/cpp.snippets | 27 - .vim/usnips/go.snippets | 565 ------ dot_vim/after/ftplugin/go.vim | 1 + dot_vim/after/ftplugin/haskell.vim | 2 + dot_vim/after/ftplugin/qf.vim | 3 + dot_vim/after/syntax/cocoa_keywords.vim | 28 + dot_vim/after/syntax/objc_enhanced.vim | 59 + dot_vim/autoload/airline/themes/barak.vim | 61 + dot_vim/autoload/genutils.vim | 1954 +++++++++++++++++++ dot_vim/autoload/lookupfile.vim | 472 +++++ dot_vim/autoload/objc/cocoacomplete.vim | 215 +++ dot_vim/autoload/objc/man.vim | 160 ++ dot_vim/autoload/objc/method_builder.vim | 124 ++ dot_vim/autoload/objc/method_list.vim | 115 ++ dot_vim/autoload/objc/pum_snippet.vim | 87 + dot_vim/autoload/pathogen.vim | 328 ++++ dot_vim/autoload/plug.vim | 2812 ++++++++++++++++++++++++++++ dot_vim/autoload/pythoncomplete.vim | 625 +++++++ dot_vim/autoload/rubycomplete.vim | 530 ++++++ dot_vim/autoload/snipMate.vim | 433 +++++ dot_vim/buftabs.vim | 309 +++ dot_vim/charm.vim | 18 + dot_vim/closetag.vim | 327 ++++ dot_vim/coc-settings.json | 34 + dot_vim/colors/barak.vim | 110 ++ dot_vim/colors/baraknew.vim | 434 +++++ dot_vim/colors/dante.vim | 83 + dot_vim/colors/ir_black.vim | 212 +++ dot_vim/colors/lucius.vim | 346 ++++ dot_vim/colors/ps_color.vim | 469 +++++ dot_vim/colors/zenburn.vim | 245 +++ dot_vim/doc/NERD_tree.txt | 1077 +++++++++++ dot_vim/doc/bufexplorer.txt | 442 +++++ dot_vim/doc/cocoa.txt | 151 ++ dot_vim/doc/matchit.txt | 406 ++++ dot_vim/doc/project.txt | 710 +++++++ dot_vim/doc/ps_color.txt | 603 ++++++ dot_vim/doc/snipMate.txt | 286 +++ dot_vim/doc/tags | 354 ++++ dot_vim/doc/vcscommand.txt | 819 ++++++++ dot_vim/filetype.vim | 147 ++ dot_vim/ftdetect/proto.vim | 1 + dot_vim/ftdetect/scala.vim | 3 + dot_vim/ftplugin/html_snip_helper.vim | 10 + dot_vim/ftplugin/objc_cocoa_mappings.vim | 70 + dot_vim/indent/cpp.vim | 92 + dot_vim/indent/gohtmltmpl.vim | 54 + dot_vim/indent/haskell.vim | 96 + dot_vim/indent/javascript.vim | 330 ++++ dot_vim/indent/mako.vim | 353 ++++ dot_vim/indent/python.vim | 196 ++ dot_vim/indent/scala.vim | 85 + dot_vim/init.vim | 3 + dot_vim/lua/lir_setup.lua | 88 + dot_vim/lua/lualine_setup.lua | 28 + dot_vim/markdown_cheatsheet.md | 376 ++++ dot_vim/nvim.lua | 678 +++++++ dot_vim/plugin/AppleT.vim | 73 + dot_vim/plugin/a.vim | 840 +++++++++ dot_vim/plugin/bclose.vim | 70 + dot_vim/plugin/camelcasemotion.vim | 449 +++++ dot_vim/plugin/cocoa.vim | 16 + dot_vim/plugin/cscope_maps.vim | 166 ++ dot_vim/plugin/cscopemenu.vim | 24 + dot_vim/plugin/genutils.vim | 996 ++++++++++ dot_vim/plugin/gotags.vim | 27 + dot_vim/plugin/matchit.vim | 812 ++++++++ dot_vim/plugin/vcsbzr.vim | 257 +++ dot_vim/plugin/vcscommand.vim | 1402 ++++++++++++++ dot_vim/plugin/vcscvs.vim | 445 +++++ dot_vim/plugin/vcsgit.vim | 248 +++ dot_vim/plugin/vcshg.vim | 273 +++ dot_vim/plugin/vcssvk.vim | 258 +++ dot_vim/plugin/vcssvn.vim | 283 +++ dot_vim/plugin/vim-scmdiff/NEWS | 24 + dot_vim/plugin/vim-scmdiff/README | 22 + dot_vim/plugin/vim-scmdiff/TODO | 11 + dot_vim/plugin/vim-scmdiff/scmdiff.vim | 160 ++ dot_vim/skeletons/svelte.skel | 9 + dot_vim/skeletons/vue.skel | 19 + dot_vim/syntax/c.vim | 377 ++++ dot_vim/syntax/cvsannotate.vim | 45 + dot_vim/syntax/gitannotate.vim | 44 + dot_vim/syntax/haskell.vim | 355 ++++ dot_vim/syntax/hgannotate.vim | 40 + dot_vim/syntax/java.vim | 9 + dot_vim/syntax/javascript.vim | 247 +++ dot_vim/syntax/lilypond-words | 1040 ++++++++++ dot_vim/syntax/lilypond-words.vim | 3 + dot_vim/syntax/lilypond.vim | 83 + dot_vim/syntax/mako.vim | 83 + dot_vim/syntax/mediawiki.vim | 304 +++ dot_vim/syntax/mkd.vim | 104 + dot_vim/syntax/motd.vim | 23 + dot_vim/syntax/nvpscript.vim | 72 + dot_vim/syntax/proto.vim | 105 ++ dot_vim/syntax/scala.vim | 153 ++ dot_vim/syntax/snippet.vim | 19 + dot_vim/syntax/svkannotate.vim | 42 + dot_vim/syntax/svnannotate.vim | 40 + dot_vim/syntax/vcscommit.vim | 31 + dot_vim/syntax_checkers/go/golintc.vim | 42 + dot_vim/syntax_checkers/go/gonyet.vim | 49 + dot_vim/syntax_checkers/go/govetshadow.vim | 52 + dot_vim/tabbar.vim | 1646 ++++++++++++++++ dot_vim/usnips/c.snippets | 87 + dot_vim/usnips/cpp.snippets | 27 + dot_vim/usnips/go.snippets | 565 ++++++ 212 files changed, 30625 insertions(+), 30625 deletions(-) delete mode 100644 .vim/after/ftplugin/go.vim delete mode 100644 .vim/after/ftplugin/haskell.vim delete mode 100644 .vim/after/ftplugin/qf.vim delete mode 100644 .vim/after/syntax/cocoa_keywords.vim delete mode 100644 .vim/after/syntax/objc_enhanced.vim delete mode 100644 .vim/autoload/airline/themes/barak.vim delete mode 100755 .vim/autoload/genutils.vim delete mode 100755 .vim/autoload/lookupfile.vim delete mode 100644 .vim/autoload/objc/cocoacomplete.vim delete mode 100644 .vim/autoload/objc/man.vim delete mode 100644 .vim/autoload/objc/method_builder.vim delete mode 100644 .vim/autoload/objc/method_list.vim delete mode 100644 .vim/autoload/objc/pum_snippet.vim delete mode 100644 .vim/autoload/pathogen.vim delete mode 100644 .vim/autoload/plug.vim delete mode 100644 .vim/autoload/pythoncomplete.vim delete mode 100644 .vim/autoload/rubycomplete.vim delete mode 100644 .vim/autoload/snipMate.vim delete mode 100644 .vim/buftabs.vim delete mode 100644 .vim/charm.vim delete mode 100644 .vim/closetag.vim delete mode 100644 .vim/coc-settings.json delete mode 100644 .vim/colors/barak.vim delete mode 100644 .vim/colors/baraknew.vim delete mode 100644 .vim/colors/dante.vim delete mode 100644 .vim/colors/ir_black.vim delete mode 100644 .vim/colors/lucius.vim delete mode 100644 .vim/colors/ps_color.vim delete mode 100644 .vim/colors/zenburn.vim delete mode 100644 .vim/doc/NERD_tree.txt delete mode 100644 .vim/doc/bufexplorer.txt delete mode 100644 .vim/doc/cocoa.txt delete mode 100644 .vim/doc/matchit.txt delete mode 100644 .vim/doc/project.txt delete mode 100644 .vim/doc/ps_color.txt delete mode 100644 .vim/doc/snipMate.txt delete mode 100644 .vim/doc/tags delete mode 100644 .vim/doc/vcscommand.txt delete mode 100644 .vim/filetype.vim delete mode 100644 .vim/ftdetect/proto.vim delete mode 100644 .vim/ftdetect/scala.vim delete mode 100644 .vim/ftplugin/html_snip_helper.vim delete mode 100644 .vim/ftplugin/objc_cocoa_mappings.vim delete mode 100644 .vim/indent/cpp.vim delete mode 100644 .vim/indent/gohtmltmpl.vim delete mode 100644 .vim/indent/haskell.vim delete mode 100644 .vim/indent/javascript.vim delete mode 100644 .vim/indent/mako.vim delete mode 100644 .vim/indent/python.vim delete mode 100644 .vim/indent/scala.vim delete mode 100644 .vim/init.vim delete mode 100644 .vim/lua/lir_setup.lua delete mode 100644 .vim/lua/lualine_setup.lua delete mode 100644 .vim/markdown_cheatsheet.md delete mode 100644 .vim/nvim.lua delete mode 100644 .vim/plugin/AppleT.vim delete mode 100644 .vim/plugin/a.vim delete mode 100644 .vim/plugin/bclose.vim delete mode 100644 .vim/plugin/camelcasemotion.vim delete mode 100644 .vim/plugin/cocoa.vim delete mode 100644 .vim/plugin/cscope_maps.vim delete mode 100644 .vim/plugin/cscopemenu.vim delete mode 100755 .vim/plugin/genutils.vim delete mode 100644 .vim/plugin/gotags.vim delete mode 100755 .vim/plugin/matchit.vim delete mode 100644 .vim/plugin/vcsbzr.vim delete mode 100644 .vim/plugin/vcscommand.vim delete mode 100644 .vim/plugin/vcscvs.vim delete mode 100644 .vim/plugin/vcsgit.vim delete mode 100755 .vim/plugin/vcshg.vim delete mode 100644 .vim/plugin/vcssvk.vim delete mode 100644 .vim/plugin/vcssvn.vim delete mode 100644 .vim/plugin/vim-scmdiff/NEWS delete mode 100644 .vim/plugin/vim-scmdiff/README delete mode 100644 .vim/plugin/vim-scmdiff/TODO delete mode 100644 .vim/plugin/vim-scmdiff/scmdiff.vim delete mode 100644 .vim/skeletons/svelte.skel delete mode 100644 .vim/skeletons/vue.skel delete mode 100644 .vim/syntax/c.vim delete mode 100644 .vim/syntax/cvsannotate.vim delete mode 100644 .vim/syntax/gitannotate.vim delete mode 100644 .vim/syntax/haskell.vim delete mode 100755 .vim/syntax/hgannotate.vim delete mode 100644 .vim/syntax/java.vim delete mode 100644 .vim/syntax/javascript.vim delete mode 100644 .vim/syntax/lilypond-words delete mode 100644 .vim/syntax/lilypond-words.vim delete mode 100644 .vim/syntax/lilypond.vim delete mode 100644 .vim/syntax/mako.vim delete mode 100644 .vim/syntax/mediawiki.vim delete mode 100644 .vim/syntax/mkd.vim delete mode 100644 .vim/syntax/motd.vim delete mode 100644 .vim/syntax/nvpscript.vim delete mode 100644 .vim/syntax/proto.vim delete mode 100644 .vim/syntax/scala.vim delete mode 100644 .vim/syntax/snippet.vim delete mode 100644 .vim/syntax/svkannotate.vim delete mode 100644 .vim/syntax/svnannotate.vim delete mode 100644 .vim/syntax/vcscommit.vim delete mode 100644 .vim/syntax_checkers/go/golintc.vim delete mode 100644 .vim/syntax_checkers/go/gonyet.vim delete mode 100644 .vim/syntax_checkers/go/govetshadow.vim delete mode 100644 .vim/tabbar.vim delete mode 100644 .vim/usnips/c.snippets delete mode 100644 .vim/usnips/cpp.snippets delete mode 100644 .vim/usnips/go.snippets create mode 100644 dot_vim/after/ftplugin/go.vim create mode 100644 dot_vim/after/ftplugin/haskell.vim create mode 100644 dot_vim/after/ftplugin/qf.vim create mode 100644 dot_vim/after/syntax/cocoa_keywords.vim create mode 100644 dot_vim/after/syntax/objc_enhanced.vim create mode 100644 dot_vim/autoload/airline/themes/barak.vim create mode 100755 dot_vim/autoload/genutils.vim create mode 100755 dot_vim/autoload/lookupfile.vim create mode 100644 dot_vim/autoload/objc/cocoacomplete.vim create mode 100644 dot_vim/autoload/objc/man.vim create mode 100644 dot_vim/autoload/objc/method_builder.vim create mode 100644 dot_vim/autoload/objc/method_list.vim create mode 100644 dot_vim/autoload/objc/pum_snippet.vim create mode 100644 dot_vim/autoload/pathogen.vim create mode 100644 dot_vim/autoload/plug.vim create mode 100644 dot_vim/autoload/pythoncomplete.vim create mode 100644 dot_vim/autoload/rubycomplete.vim create mode 100644 dot_vim/autoload/snipMate.vim create mode 100644 dot_vim/buftabs.vim create mode 100644 dot_vim/charm.vim create mode 100644 dot_vim/closetag.vim create mode 100644 dot_vim/coc-settings.json create mode 100644 dot_vim/colors/barak.vim create mode 100644 dot_vim/colors/baraknew.vim create mode 100644 dot_vim/colors/dante.vim create mode 100644 dot_vim/colors/ir_black.vim create mode 100644 dot_vim/colors/lucius.vim create mode 100644 dot_vim/colors/ps_color.vim create mode 100644 dot_vim/colors/zenburn.vim create mode 100644 dot_vim/doc/NERD_tree.txt create mode 100644 dot_vim/doc/bufexplorer.txt create mode 100644 dot_vim/doc/cocoa.txt create mode 100644 dot_vim/doc/matchit.txt create mode 100644 dot_vim/doc/project.txt create mode 100644 dot_vim/doc/ps_color.txt create mode 100644 dot_vim/doc/snipMate.txt create mode 100644 dot_vim/doc/tags create mode 100644 dot_vim/doc/vcscommand.txt create mode 100644 dot_vim/filetype.vim create mode 100644 dot_vim/ftdetect/proto.vim create mode 100644 dot_vim/ftdetect/scala.vim create mode 100644 dot_vim/ftplugin/html_snip_helper.vim create mode 100644 dot_vim/ftplugin/objc_cocoa_mappings.vim create mode 100644 dot_vim/indent/cpp.vim create mode 100644 dot_vim/indent/gohtmltmpl.vim create mode 100644 dot_vim/indent/haskell.vim create mode 100644 dot_vim/indent/javascript.vim create mode 100644 dot_vim/indent/mako.vim create mode 100644 dot_vim/indent/python.vim create mode 100644 dot_vim/indent/scala.vim create mode 100644 dot_vim/init.vim create mode 100644 dot_vim/lua/lir_setup.lua create mode 100644 dot_vim/lua/lualine_setup.lua create mode 100644 dot_vim/markdown_cheatsheet.md create mode 100644 dot_vim/nvim.lua create mode 100644 dot_vim/plugin/AppleT.vim create mode 100644 dot_vim/plugin/a.vim create mode 100644 dot_vim/plugin/bclose.vim create mode 100644 dot_vim/plugin/camelcasemotion.vim create mode 100644 dot_vim/plugin/cocoa.vim create mode 100644 dot_vim/plugin/cscope_maps.vim create mode 100644 dot_vim/plugin/cscopemenu.vim create mode 100755 dot_vim/plugin/genutils.vim create mode 100644 dot_vim/plugin/gotags.vim create mode 100755 dot_vim/plugin/matchit.vim create mode 100644 dot_vim/plugin/vcsbzr.vim create mode 100644 dot_vim/plugin/vcscommand.vim create mode 100644 dot_vim/plugin/vcscvs.vim create mode 100644 dot_vim/plugin/vcsgit.vim create mode 100755 dot_vim/plugin/vcshg.vim create mode 100644 dot_vim/plugin/vcssvk.vim create mode 100644 dot_vim/plugin/vcssvn.vim create mode 100644 dot_vim/plugin/vim-scmdiff/NEWS create mode 100644 dot_vim/plugin/vim-scmdiff/README create mode 100644 dot_vim/plugin/vim-scmdiff/TODO create mode 100644 dot_vim/plugin/vim-scmdiff/scmdiff.vim create mode 100644 dot_vim/skeletons/svelte.skel create mode 100644 dot_vim/skeletons/vue.skel create mode 100644 dot_vim/syntax/c.vim create mode 100644 dot_vim/syntax/cvsannotate.vim create mode 100644 dot_vim/syntax/gitannotate.vim create mode 100644 dot_vim/syntax/haskell.vim create mode 100755 dot_vim/syntax/hgannotate.vim create mode 100644 dot_vim/syntax/java.vim create mode 100644 dot_vim/syntax/javascript.vim create mode 100644 dot_vim/syntax/lilypond-words create mode 100644 dot_vim/syntax/lilypond-words.vim create mode 100644 dot_vim/syntax/lilypond.vim create mode 100644 dot_vim/syntax/mako.vim create mode 100644 dot_vim/syntax/mediawiki.vim create mode 100644 dot_vim/syntax/mkd.vim create mode 100644 dot_vim/syntax/motd.vim create mode 100644 dot_vim/syntax/nvpscript.vim create mode 100644 dot_vim/syntax/proto.vim create mode 100644 dot_vim/syntax/scala.vim create mode 100644 dot_vim/syntax/snippet.vim create mode 100644 dot_vim/syntax/svkannotate.vim create mode 100644 dot_vim/syntax/svnannotate.vim create mode 100644 dot_vim/syntax/vcscommit.vim create mode 100644 dot_vim/syntax_checkers/go/golintc.vim create mode 100644 dot_vim/syntax_checkers/go/gonyet.vim create mode 100644 dot_vim/syntax_checkers/go/govetshadow.vim create mode 100644 dot_vim/tabbar.vim create mode 100644 dot_vim/usnips/c.snippets create mode 100644 dot_vim/usnips/cpp.snippets create mode 100644 dot_vim/usnips/go.snippets diff --git a/.vim/after/ftplugin/go.vim b/.vim/after/ftplugin/go.vim deleted file mode 100644 index 8e50908..0000000 --- a/.vim/after/ftplugin/go.vim +++ /dev/null @@ -1 +0,0 @@ -setlocal tabstop=2 shiftwidth=2 nolist diff --git a/.vim/after/ftplugin/haskell.vim b/.vim/after/ftplugin/haskell.vim deleted file mode 100644 index bcf2803..0000000 --- a/.vim/after/ftplugin/haskell.vim +++ /dev/null @@ -1,2 +0,0 @@ -setlocal omnifunc=necoghc#omnifunc -let g:ycm_key_invoke_completion = '<Leader><TAB>' diff --git a/.vim/after/ftplugin/qf.vim b/.vim/after/ftplugin/qf.vim deleted file mode 100644 index 895d7ac..0000000 --- a/.vim/after/ftplugin/qf.vim +++ /dev/null @@ -1,3 +0,0 @@ -nmap <buffer> { <Plug>(qf_previous_file) -nmap <buffer> } <Plug>(qf_next_file) -nmap <buffer> dd <cmd>.Reject<cr> diff --git a/.vim/after/syntax/cocoa_keywords.vim b/.vim/after/syntax/cocoa_keywords.vim deleted file mode 100644 index 90a5427..0000000 --- a/.vim/after/syntax/cocoa_keywords.vim +++ /dev/null @@ -1,28 +0,0 @@ -" Description: Syntax highlighting for the cocoa.vim plugin. -" Adds highlighting for Cocoa keywords (classes, types, etc.). -" Last Generated: September 08, 2009 - -" Cocoa Functions -syn keyword cocoaFunction containedin=objcMessage NSAccessibilityActionDescription NSAccessibilityPostNotification NSAccessibilityRaiseBadArgumentException NSAccessibilityRoleDescription NSAccessibilityRoleDescriptionForUIElement NSAccessibilityUnignoredAncestor NSAccessibilityUnignoredChildren NSAccessibilityUnignoredChildrenForOnlyChild NSAccessibilityUnignoredDescendant NSAllHashTableObjects NSAllMapTableKeys NSAllMapTableValues NSAllocateCollectable NSAllocateMemoryPages NSAllocateObject NSApplicationLoad NSApplicationMain NSAvailableWindowDepths NSBeep NSBeginAlertSheet NSBeginCriticalAlertSheet NSBeginInformationalAlertSheet NSBestDepth NSBitsPerPixelFromDepth NSBitsPerSampleFromDepth NSClassFromString NSColorSpaceFromDepth NSCompareHashTables NSCompareMapTables NSContainsRect NSConvertGlyphsToPackedGlyphs NSConvertHostDoubleToSwapped NSConvertHostFloatToSwapped NSConvertSwappedDoubleToHost NSConvertSwappedFloatToHost NSCopyBits NSCopyHashTableWithZone NSCopyMapTableWithZone NSCopyMemoryPages NSCopyObject NSCountFrames NSCountHashTable NSCountMapTable NSCountWindows NSCountWindowsForContext NSCreateFileContentsPboardType NSCreateFilenamePboardType NSCreateHashTable NSCreateHashTableWithZone NSCreateMapTable NSCreateMapTableWithZone NSCreateZone NSDeallocateMemoryPages NSDeallocateObject NSDecimalAdd NSDecimalCompact NSDecimalCompare NSDecimalCopy NSDecimalDivide NSDecimalIsNotANumber NSDecimalMultiply NSDecimalMultiplyByPowerOf10 NSDecimalNormalize NSDecimalPower NSDecimalRound NSDecimalString NSDecimalSubtract NSDecrementExtraRefCountWasZero NSDefaultMallocZone NSDisableScreenUpdates NSDivideRect NSDottedFrameRect NSDrawBitmap NSDrawButton NSDrawColorTiledRects NSDrawDarkBezel NSDrawGrayBezel NSDrawGroove NSDrawLightBezel NSDrawNinePartImage NSDrawThreePartImage NSDrawTiledRects NSDrawWhiteBezel NSDrawWindowBackground NSEnableScreenUpdates NSEndHashTableEnumeration NSEndMapTableEnumeration NSEnumerateHashTable NSEnumerateMapTable NSEqualPoints NSEqualRanges NSEqualRects NSEqualSizes NSEraseRect NSEventMaskFromType NSExtraRefCount NSFileTypeForHFSTypeCode NSFrameAddress NSFrameRect NSFrameRectWithWidth NSFrameRectWithWidthUsingOperation NSFreeHashTable NSFreeMapTable NSFullUserName NSGetAlertPanel NSGetCriticalAlertPanel NSGetFileType NSGetFileTypes NSGetInformationalAlertPanel NSGetSizeAndAlignment NSGetUncaughtExceptionHandler NSGetWindowServerMemory NSHFSTypeCodeFromFileType NSHFSTypeOfFile NSHashGet NSHashInsert NSHashInsertIfAbsent NSHashInsertKnownAbsent NSHashRemove NSHeight NSHighlightRect NSHomeDirectory NSHomeDirectoryForUser NSHostByteOrder NSIncrementExtraRefCount NSInsetRect NSIntegralRect NSInterfaceStyleForKey NSIntersectionRange NSIntersectionRect NSIntersectsRect NSIsControllerMarker NSIsEmptyRect NSIsFreedObject NSJavaBundleCleanup NSJavaBundleSetup NSJavaClassesForBundle NSJavaClassesFromPath NSJavaNeedsToLoadClasses NSJavaNeedsVirtualMachine NSJavaObjectNamedInPath NSJavaProvidesClasses NSJavaSetup NSJavaSetupVirtualMachine NSLocationInRange NSLog NSLogPageSize NSLogv NSMakeCollectable NSMakePoint NSMakeRange NSMakeRect NSMakeSize NSMapGet NSMapInsert NSMapInsertIfAbsent NSMapInsertKnownAbsent NSMapMember NSMapRemove NSMaxRange NSMaxX NSMaxY NSMidX NSMidY NSMinX NSMinY NSMouseInRect NSNextHashEnumeratorItem NSNextMapEnumeratorPair NSNumberOfColorComponents NSOffsetRect NSOpenStepRootDirectory NSPageSize NSPerformService NSPlanarFromDepth NSPointFromCGPoint NSPointFromString NSPointInRect NSPointToCGPoint NSProtocolFromString NSRangeFromString NSReadPixel NSRealMemoryAvailable NSReallocateCollectable NSRecordAllocationEvent NSRectClip NSRectClipList NSRectFill NSRectFillList NSRectFillListUsingOperation NSRectFillListWithColors NSRectFillListWithColorsUsingOperation NSRectFillListWithGrays NSRectFillUsingOperation NSRectFromCGRect NSRectFromString NSRectToCGRect NSRecycleZone NSRegisterServicesProvider NSReleaseAlertPanel NSResetHashTable NSResetMapTable NSReturnAddress NSRoundDownToMultipleOfPageSize NSRoundUpToMultipleOfPageSize NSRunAlertPanel NSRunAlertPanelRelativeToWindow NSRunCriticalAlertPanel NSRunCriticalAlertPanelRelativeToWindow NSRunInformationalAlertPanel NSRunInformationalAlertPanelRelativeToWindow NSSearchPathForDirectoriesInDomains NSSelectorFromString NSSetFocusRingStyle NSSetShowsServicesMenuItem NSSetUncaughtExceptionHandler NSSetZoneName NSShouldRetainWithZone NSShowAnimationEffect NSShowsServicesMenuItem NSSizeFromCGSize NSSizeFromString NSSizeToCGSize NSStringFromCGAffineTransform NSStringFromCGPoint NSStringFromCGRect NSStringFromCGSize NSStringFromClass NSStringFromHashTable NSStringFromMapTable NSStringFromPoint NSStringFromProtocol NSStringFromRange NSStringFromRect NSStringFromSelector NSStringFromSize NSStringFromUIEdgeInsets NSSwapBigDoubleToHost NSSwapBigFloatToHost NSSwapBigIntToHost NSSwapBigLongLongToHost NSSwapBigLongToHost NSSwapBigShortToHost NSSwapDouble NSSwapFloat NSSwapHostDoubleToBig NSSwapHostDoubleToLittle NSSwapHostFloatToBig NSSwapHostFloatToLittle NSSwapHostIntToBig NSSwapHostIntToLittle NSSwapHostLongLongToBig NSSwapHostLongLongToLittle NSSwapHostLongToBig NSSwapHostLongToLittle NSSwapHostShortToBig NSSwapHostShortToLittle NSSwapInt NSSwapLittleDoubleToHost NSSwapLittleFloatToHost NSSwapLittleIntToHost NSSwapLittleLongLongToHost NSSwapLittleLongToHost NSSwapLittleShortToHost NSSwapLong NSSwapLongLong NSSwapShort NSTemporaryDirectory NSUnionRange NSUnionRect NSUnregisterServicesProvider NSUpdateDynamicServices NSUserName NSValue NSWidth NSWindowList NSWindowListForContext NSZoneCalloc NSZoneFree NSZoneFromPointer NSZoneMalloc NSZoneName NSZoneRealloc UIAccessibilityPostNotification UIApplicationMain UIEdgeInsetsEqualToEdgeInsets UIEdgeInsetsFromString UIEdgeInsetsInsetRect UIEdgeInsetsMake UIGraphicsBeginImageContext UIGraphicsEndImageContext UIGraphicsGetCurrentContext UIGraphicsGetImageFromCurrentImageContext UIGraphicsPopContext UIGraphicsPushContext UIImageJPEGRepresentation UIImagePNGRepresentation UIImageWriteToSavedPhotosAlbum UIRectClip UIRectFill UIRectFillUsingBlendMode UIRectFrame UIRectFrameUsingBlendMode NSAssert NSAssert1 NSAssert2 NSAssert3 NSAssert4 NSAssert5 NSCAssert NSCAssert1 NSCAssert2 NSCAssert3 NSCAssert4 NSCAssert5 NSCParameterAssert NSDecimalMaxSize NSGlyphInfoAtIndex NSLocalizedString NSLocalizedStringFromTable NSLocalizedStringFromTableInBundle NSLocalizedStringWithDefaultValue NSParameterAssert NSURLResponseUnknownLength NS_VALUERETURN UIDeviceOrientationIsLandscape UIDeviceOrientationIsPortrait UIDeviceOrientationIsValidInterfaceOrientation UIInterfaceOrientationIsLandscape UIInterfaceOrientationIsPortrait - -" Cocoa Classes -syn keyword cocoaClass containedin=objcMessage NSATSTypesetter NSActionCell NSAffineTransform NSAlert NSAnimation NSAnimationContext NSAppleEventDescriptor NSAppleEventManager NSAppleScript NSApplication NSArchiver NSArray NSArrayController NSAssertionHandler NSAtomicStore NSAtomicStoreCacheNode NSAttributeDescription NSAttributedString NSAutoreleasePool NSBezierPath NSBitmapImageRep NSBox NSBrowser NSBrowserCell NSBundle NSButton NSButtonCell NSCIImageRep NSCachedImageRep NSCachedURLResponse NSCalendar NSCalendarDate NSCell NSCharacterSet NSClassDescription NSClipView NSCloneCommand NSCloseCommand NSCoder NSCollectionView NSCollectionViewItem NSColor NSColorList NSColorPanel NSColorPicker NSColorSpace NSColorWell NSComboBox NSComboBoxCell NSComparisonPredicate NSCompoundPredicate NSCondition NSConditionLock NSConnection NSConstantString NSControl NSController NSCountCommand NSCountedSet NSCreateCommand NSCursor NSCustomImageRep NSData NSDate NSDateComponents NSDateFormatter NSDatePicker NSDatePickerCell NSDecimalNumber NSDecimalNumberHandler NSDeleteCommand NSDictionary NSDictionaryController NSDirectoryEnumerator NSDistantObject NSDistantObjectRequest NSDistributedLock NSDistributedNotificationCenter NSDockTile NSDocument NSDocumentController NSDrawer NSEPSImageRep NSEntityDescription NSEntityMapping NSEntityMigrationPolicy NSEnumerator NSError NSEvent NSException NSExistsCommand NSExpression NSFetchRequest NSFetchRequestExpression NSFetchedPropertyDescription NSFileHandle NSFileManager NSFileWrapper NSFont NSFontDescriptor NSFontManager NSFontPanel NSFormCell NSFormatter NSGarbageCollector NSGetCommand NSGlyphGenerator NSGlyphInfo NSGradient NSGraphicsContext NSHTTPCookie NSHTTPCookieStorage NSHTTPURLResponse NSHashTable NSHelpManager NSHost NSImage NSImageCell NSImageRep NSImageView NSIndexPath NSIndexSet NSIndexSpecifier NSInputManager NSInputServer NSInputStream NSInvocation NSInvocationOperation NSKeyedArchiver NSKeyedUnarchiver NSLayoutManager NSLevelIndicator NSLevelIndicatorCell NSLocale NSLock NSLogicalTest NSMachBootstrapServer NSMachPort NSManagedObject NSManagedObjectContext NSManagedObjectID NSManagedObjectModel NSMapTable NSMappingModel NSMatrix NSMenu NSMenuItem NSMenuItemCell NSMenuView NSMessagePort NSMessagePortNameServer NSMetadataItem NSMetadataQuery NSMetadataQueryAttributeValueTuple NSMetadataQueryResultGroup NSMethodSignature NSMiddleSpecifier NSMigrationManager NSMoveCommand NSMovie NSMovieView NSMutableArray NSMutableAttributedString NSMutableCharacterSet NSMutableData NSMutableDictionary NSMutableIndexSet NSMutableParagraphStyle NSMutableSet NSMutableString NSMutableURLRequest NSNameSpecifier NSNetService NSNetServiceBrowser NSNib NSNibConnector NSNibControlConnector NSNibOutletConnector NSNotification NSNotificationCenter NSNotificationQueue NSNull NSNumber NSNumberFormatter NSObject NSObjectController NSOpenGLContext NSOpenGLPixelBuffer NSOpenGLPixelFormat NSOpenGLView NSOpenPanel NSOperation NSOperationQueue NSOutlineView NSOutputStream NSPDFImageRep NSPICTImageRep NSPageLayout NSPanel NSParagraphStyle NSPasteboard NSPathCell NSPathComponentCell NSPathControl NSPersistentDocument NSPersistentStore NSPersistentStoreCoordinator NSPipe NSPointerArray NSPointerFunctions NSPopUpButton NSPopUpButtonCell NSPort NSPortCoder NSPortMessage NSPortNameServer NSPositionalSpecifier NSPredicate NSPredicateEditor NSPredicateEditorRowTemplate NSPreferencePane NSPrintInfo NSPrintOperation NSPrintPanel NSPrinter NSProcessInfo NSProgressIndicator NSPropertyDescription NSPropertyListSerialization NSPropertyMapping NSPropertySpecifier NSProtocolChecker NSProxy NSQuickDrawView NSQuitCommand NSRandomSpecifier NSRangeSpecifier NSRecursiveLock NSRelationshipDescription NSRelativeSpecifier NSResponder NSRuleEditor NSRulerMarker NSRulerView NSRunLoop NSSavePanel NSScanner NSScreen NSScriptClassDescription NSScriptCoercionHandler NSScriptCommand NSScriptCommandDescription NSScriptExecutionContext NSScriptObjectSpecifier NSScriptSuiteRegistry NSScriptWhoseTest NSScrollView NSScroller NSSearchField NSSearchFieldCell NSSecureTextField NSSecureTextFieldCell NSSegmentedCell NSSegmentedControl NSSet NSSetCommand NSShadow NSSimpleCString NSSimpleHorizontalTypesetter NSSlider NSSliderCell NSSocketPort NSSocketPortNameServer NSSortDescriptor NSSound NSSpecifierTest NSSpeechRecognizer NSSpeechSynthesizer NSSpellChecker NSSpellServer NSSplitView NSStatusBar NSStatusItem NSStepper NSStepperCell NSStream NSString NSTabView NSTabViewItem NSTableColumn NSTableHeaderCell NSTableHeaderView NSTableView NSTask NSText NSTextAttachment NSTextAttachmentCell NSTextBlock NSTextContainer NSTextField NSTextFieldCell NSTextList NSTextStorage NSTextTab NSTextTable NSTextTableBlock NSTextView NSThread NSTimeZone NSTimer NSTokenField NSTokenFieldCell NSToolbar NSToolbarItem NSToolbarItemGroup NSTrackingArea NSTreeController NSTreeNode NSTypesetter NSURL NSURLAuthenticationChallenge NSURLCache NSURLConnection NSURLCredential NSURLCredentialStorage NSURLDownload NSURLHandle NSURLProtectionSpace NSURLProtocol NSURLRequest NSURLResponse NSUnarchiver NSUndoManager NSUniqueIDSpecifier NSUserDefaults NSUserDefaultsController NSValue NSValueTransformer NSView NSViewAnimation NSViewController NSWhoseSpecifier NSWindow NSWindowController NSWorkspace NSXMLDTD NSXMLDTDNode NSXMLDocument NSXMLElement NSXMLNode NSXMLParser UIAcceleration UIAccelerometer UIAccessibilityElement UIActionSheet UIActivityIndicatorView UIAlertView UIApplication UIBarButtonItem UIBarItem UIButton UIColor UIControl UIDatePicker UIDevice UIEvent UIFont UIImage UIImagePickerController UIImageView UILabel UILocalizedIndexedCollation UIMenuController UINavigationBar UINavigationController UINavigationItem UIPageControl UIPasteboard UIPickerView UIProgressView UIResponder UIScreen UIScrollView UISearchBar UISearchDisplayController UISegmentedControl UISlider UISwitch UITabBar UITabBarController UITabBarItem UITableView UITableViewCell UITableViewController UITextField UITextView UIToolbar UITouch UIView UIViewController UIWebView UIWindow - -" Cocoa Protocol Classes -syn keyword cocoaProtocol containedin=objcProtocol NSAnimatablePropertyContainer NSChangeSpelling NSCoding NSColorPickingCustom NSColorPickingDefault NSCopying NSDecimalNumberBehaviors NSDraggingInfo NSFastEnumeration NSGlyphStorage NSIgnoreMisspelledWords NSInputServerMouseTracker NSInputServiceProvider NSLocking NSMenuItem NSMutableCopying NSObject NSPathCellDelegate NSPathControlDelegate NSPersistentStoreCoordinatorSyncing NSPrintPanelAccessorizing NSTextAttachmentCell NSTextInput NSTextInputClient NSToolbarItemValidations NSURLAuthenticationChallengeSender NSURLDownloadDelegate NSURLHandleClient NSURLProtocolClient NSUserInterfaceValidations NSValidatedToobarItem NSValidatedUserInterfaceItem UIAccelerometerDelegate UIActionSheetDelegate UIAlertViewDelegate UIApplicationDelegate UIImagePickerControllerDelegate UINavigationBarDelegate UINavigationControllerDelegate UIPickerViewDataSource UIPickerViewDelegate UIScrollViewDelegate UISearchBarDelegate UISearchDisplayDelegate UITabBarControllerDelegate UITabBarDelegate UITableViewDataSource UITableViewDelegate UITextFieldDelegate UITextInputTraits UITextSelecting UITextViewDelegate UIWebViewDelegate - -" Cocoa Types -syn keyword cocoaType containedin=objcMessage CGFloat NSAlertStyle NSAnimationBlockingMode NSAnimationCurve NSAnimationEffect NSAnimationProgress NSAppleEventManagerSuspensionID NSApplicationDelegateReply NSApplicationPrintReply NSApplicationTerminateReply NSAttributeType NSBackgroundStyle NSBackingStoreType NSBezelStyle NSBezierPathElement NSBitmapFormat NSBitmapImageFileType NSBorderType NSBoxType NSBrowserColumnResizingType NSBrowserDropOperation NSButtonType NSCalculationError NSCalendarUnit NSCellAttribute NSCellImagePosition NSCellStateValue NSCellType NSCharacterCollection NSColorPanelMode NSColorRenderingIntent NSColorSpaceModel NSComparisonPredicateModifier NSComparisonResult NSCompositingOperation NSCompoundPredicateType NSControlSize NSControlTint NSDateFormatterBehavior NSDateFormatterStyle NSDatePickerElementFlags NSDatePickerMode NSDatePickerStyle NSDeleteRule NSDocumentChangeType NSDragOperation NSDrawerState NSEntityMappingType NSEventType NSExpressionType NSFetchRequestResultType NSFindPanelAction NSFindPanelSubstringMatchType NSFocusRingPlacement NSFocusRingType NSFontAction NSFontFamilyClass NSFontRenderingMode NSFontSymbolicTraits NSFontTraitMask NSGlyph NSGlyphInscription NSGlyphLayoutMode NSGlyphRelation NSGradientDrawingOptions NSGradientType NSHTTPCookieAcceptPolicy NSHashEnumerator NSHashTableOptions NSImageAlignment NSImageCacheMode NSImageFrameStyle NSImageInterpolation NSImageLoadStatus NSImageRepLoadStatus NSImageScaling NSInsertionPosition NSInteger NSInterfaceStyle NSKeyValueChange NSKeyValueObservingOptions NSKeyValueSetMutationKind NSLayoutDirection NSLayoutStatus NSLevelIndicatorStyle NSLineBreakMode NSLineCapStyle NSLineJoinStyle NSLineMovementDirection NSLineSweepDirection NSMapEnumerator NSMapTableOptions NSMatrixMode NSModalSession NSMultibyteGlyphPacking NSNetServiceOptions NSNetServicesError NSNotificationCoalescing NSNotificationSuspensionBehavior NSNumberFormatterBehavior NSNumberFormatterPadPosition NSNumberFormatterRoundingMode NSNumberFormatterStyle NSOpenGLContextAuxiliary NSOpenGLPixelFormatAttribute NSOpenGLPixelFormatAuxiliary NSOperationQueuePriority NSPathStyle NSPoint NSPointerFunctionsOptions NSPointingDeviceType NSPopUpArrowPosition NSPostingStyle NSPredicateOperatorType NSPrintPanelOptions NSPrinterTableStatus NSPrintingOrientation NSPrintingPageOrder NSPrintingPaginationMode NSProgressIndicatorStyle NSProgressIndicatorThickness NSProgressIndicatorThreadInfo NSPropertyListFormat NSPropertyListMutabilityOptions NSQTMovieLoopMode NSRange NSRect NSRectEdge NSRelativePosition NSRequestUserAttentionType NSRoundingMode NSRuleEditorNestingMode NSRuleEditorRowType NSRulerOrientation NSSaveOperationType NSSaveOptions NSScreenAuxiliaryOpaque NSScrollArrowPosition NSScrollerArrow NSScrollerPart NSSearchPathDirectory NSSearchPathDomainMask NSSegmentStyle NSSegmentSwitchTracking NSSelectionAffinity NSSelectionDirection NSSelectionGranularity NSSize NSSliderType NSSocketNativeHandle NSSpeechBoundary NSSplitViewDividerStyle NSStreamEvent NSStreamStatus NSStringCompareOptions NSStringDrawingOptions NSStringEncoding NSStringEncodingConversionOptions NSSwappedDouble NSSwappedFloat NSTIFFCompression NSTabState NSTabViewType NSTableViewColumnAutoresizingStyle NSTableViewDropOperation NSTableViewSelectionHighlightStyle NSTestComparisonOperation NSTextAlignment NSTextBlockDimension NSTextBlockLayer NSTextBlockValueType NSTextBlockVerticalAlignment NSTextFieldBezelStyle NSTextTabType NSTextTableLayoutAlgorithm NSThreadPrivate NSTickMarkPosition NSTimeInterval NSTimeZoneNameStyle NSTitlePosition NSTokenStyle NSToolTipTag NSToolbarDisplayMode NSToolbarSizeMode NSTrackingAreaOptions NSTrackingRectTag NSTypesetterBehavior NSTypesetterControlCharacterAction NSTypesetterGlyphInfo NSUInteger NSURLCacheStoragePolicy NSURLCredentialPersistence NSURLHandleStatus NSURLRequestCachePolicy NSUsableScrollerParts NSWhoseSubelementIdentifier NSWindingRule NSWindowBackingLocation NSWindowButton NSWindowCollectionBehavior NSWindowDepth NSWindowOrderingMode NSWindowSharingType NSWorkspaceIconCreationOptions NSWorkspaceLaunchOptions NSWritingDirection NSXMLDTDNodeKind NSXMLDocumentContentKind NSXMLNodeKind NSXMLParserError NSZone UIAccelerationValue UIAccessibilityNotifications UIAccessibilityTraits UIControlEvents UIControlState UIDataDetectorTypes UIEdgeInsets UIImagePickerControllerSourceType UITableViewCellStateMask UIViewAutoresizing UIWebViewNavigationType UIWindowLevel - -" Cocoa Constants -syn keyword cocoaConstant containedin=objcMessage NSASCIIStringEncoding NSAWTEventType NSAboveBottom NSAboveTop NSAddEntityMappingType NSAddTraitFontAction NSAdminApplicationDirectory NSAdobeCNS1CharacterCollection NSAdobeGB1CharacterCollection NSAdobeJapan1CharacterCollection NSAdobeJapan2CharacterCollection NSAdobeKorea1CharacterCollection NSAggregateExpressionType NSAlertAlternateReturn NSAlertDefaultReturn NSAlertErrorReturn NSAlertFirstButtonReturn NSAlertOtherReturn NSAlertSecondButtonReturn NSAlertThirdButtonReturn NSAllApplicationsDirectory NSAllDomainsMask NSAllLibrariesDirectory NSAllPredicateModifier NSAllScrollerParts NSAlphaFirstBitmapFormat NSAlphaNonpremultipliedBitmapFormat NSAlphaShiftKeyMask NSAlternateKeyMask NSAnchoredSearch NSAndPredicateType NSAnimationBlocking NSAnimationEaseIn NSAnimationEaseInOut NSAnimationEaseOut NSAnimationEffectDisappearingItemDefault NSAnimationEffectPoof NSAnimationLinear NSAnimationNonblocking NSAnimationNonblockingThreaded NSAnyEventMask NSAnyPredicateModifier NSAnyType NSAppKitDefined NSAppKitDefinedMask NSApplicationActivatedEventType NSApplicationDeactivatedEventType NSApplicationDefined NSApplicationDefinedMask NSApplicationDelegateReplyCancel NSApplicationDelegateReplyFailure NSApplicationDelegateReplySuccess NSApplicationDirectory NSApplicationSupportDirectory NSArgumentEvaluationScriptError NSArgumentsWrongScriptError NSAscendingPageOrder NSAsciiWithDoubleByteEUCGlyphPacking NSAtBottom NSAtTop NSAtomicWrite NSAttachmentCharacter NSAutoPagination NSAutosaveOperation NSBMPFileType NSBackTabCharacter NSBackgroundStyleDark NSBackgroundStyleLight NSBackgroundStyleLowered NSBackgroundStyleRaised NSBackgroundTab NSBackingStoreBuffered NSBackingStoreNonretained NSBackingStoreRetained NSBackspaceCharacter NSBacktabTextMovement NSBackwardsSearch NSBeginFunctionKey NSBeginsWithComparison NSBeginsWithPredicateOperatorType NSBelowBottom NSBelowTop NSBetweenPredicateOperatorType NSBevelLineJoinStyle NSBezelBorder NSBlueControlTint NSBoldFontMask NSBorderlessWindowMask NSBottomTabsBezelBorder NSBoxCustom NSBoxOldStyle NSBoxPrimary NSBoxSecondary NSBoxSeparator NSBreakFunctionKey NSBrowserAutoColumnResizing NSBrowserNoColumnResizing NSBrowserUserColumnResizing NSBundleExecutableArchitectureI386 NSBundleExecutableArchitecturePPC NSBundleExecutableArchitecturePPC64 NSBundleExecutableArchitectureX86_64 NSButtLineCapStyle NSCMYKColorSpaceModel NSCMYKModeColorPanel NSCachesDirectory NSCalculationDivideByZero NSCalculationLossOfPrecision NSCalculationNoError NSCalculationOverflow NSCalculationUnderflow NSCancelButton NSCancelTextMovement NSCannotCreateScriptCommandError NSCarriageReturnCharacter NSCaseInsensitivePredicateOption NSCaseInsensitiveSearch NSCellAllowsMixedState NSCellChangesContents NSCellDisabled NSCellEditable NSCellHasImageHorizontal NSCellHasImageOnLeftOrBottom NSCellHasOverlappingImage NSCellHighlighted NSCellHitContentArea NSCellHitEditableTextArea NSCellHitNone NSCellHitTrackableArea NSCellIsBordered NSCellIsInsetButton NSCellLightsByBackground NSCellLightsByContents NSCellLightsByGray NSCellState NSCenterTabStopType NSCenterTextAlignment NSChangeAutosaved NSChangeBackgroundCell NSChangeBackgroundCellMask NSChangeCleared NSChangeDone NSChangeGrayCell NSChangeGrayCellMask NSChangeReadOtherContents NSChangeRedone NSChangeUndone NSCircularBezelStyle NSCircularSlider NSClearControlTint NSClearDisplayFunctionKey NSClearLineFunctionKey NSClipPagination NSClockAndCalendarDatePickerStyle NSClosableWindowMask NSClosePathBezierPathElement NSCollectorDisabledOption NSColorListModeColorPanel NSColorPanelAllModesMask NSColorPanelCMYKModeMask NSColorPanelColorListModeMask NSColorPanelCrayonModeMask NSColorPanelCustomPaletteModeMask NSColorPanelGrayModeMask NSColorPanelHSBModeMask NSColorPanelRGBModeMask NSColorPanelWheelModeMask NSColorRenderingIntentAbsoluteColorimetric NSColorRenderingIntentDefault NSColorRenderingIntentPerceptual NSColorRenderingIntentRelativeColorimetric NSColorRenderingIntentSaturation NSCommandKeyMask NSCompositeClear NSCompositeCopy NSCompositeDestinationAtop NSCompositeDestinationIn NSCompositeDestinationOut NSCompositeDestinationOver NSCompositeHighlight NSCompositePlusDarker NSCompositePlusLighter NSCompositeSourceAtop NSCompositeSourceIn NSCompositeSourceOut NSCompositeSourceOver NSCompositeXOR NSCompressedFontMask NSCondensedFontMask NSConstantValueExpressionType NSContainerSpecifierError NSContainsComparison NSContainsPredicateOperatorType NSContentsCellMask NSContinuousCapacityLevelIndicatorStyle NSControlGlyph NSControlKeyMask NSCopyEntityMappingType NSCoreDataError NSCoreServiceDirectory NSCrayonModeColorPanel NSCriticalAlertStyle NSCriticalRequest NSCursorPointingDevice NSCursorUpdate NSCursorUpdateMask NSCurveToBezierPathElement NSCustomEntityMappingType NSCustomPaletteModeColorPanel NSCustomSelectorPredicateOperatorType NSDateFormatterBehavior10_0 NSDateFormatterBehavior10_4 NSDateFormatterBehaviorDefault NSDateFormatterFullStyle NSDateFormatterLongStyle NSDateFormatterMediumStyle NSDateFormatterNoStyle NSDateFormatterShortStyle NSDayCalendarUnit NSDecimalTabStopType NSDefaultControlTint NSDefaultTokenStyle NSDeleteCharFunctionKey NSDeleteCharacter NSDeleteFunctionKey NSDeleteLineFunctionKey NSDemoApplicationDirectory NSDescendingPageOrder NSDesktopDirectory NSDeveloperApplicationDirectory NSDeveloperDirectory NSDeviceIndependentModifierFlagsMask NSDeviceNColorSpaceModel NSDiacriticInsensitivePredicateOption NSDiacriticInsensitiveSearch NSDirectPredicateModifier NSDirectSelection NSDisclosureBezelStyle NSDiscreteCapacityLevelIndicatorStyle NSDisplayWindowRunLoopOrdering NSDocModalWindowMask NSDocumentDirectory NSDocumentationDirectory NSDoubleType NSDownArrowFunctionKey NSDownTextMovement NSDownloadsDirectory NSDragOperationAll_Obsolete NSDragOperationCopy NSDragOperationDelete NSDragOperationEvery NSDragOperationGeneric NSDragOperationLink NSDragOperationMove NSDragOperationNone NSDragOperationPrivate NSDrawerClosedState NSDrawerClosingState NSDrawerOpenState NSDrawerOpeningState NSEndFunctionKey NSEndsWithComparison NSEndsWithPredicateOperatorType NSEnterCharacter NSEntityMigrationPolicyError NSEqualToComparison NSEqualToPredicateOperatorType NSEraCalendarUnit NSEraDatePickerElementFlag NSEraserPointingDevice NSEvaluatedObjectExpressionType NSEvenOddWindingRule NSEverySubelement NSExclude10_4ElementsIconCreationOption NSExcludeQuickDrawElementsIconCreationOption NSExecutableArchitectureMismatchError NSExecutableErrorMaximum NSExecutableErrorMinimum NSExecutableLinkError NSExecutableLoadError NSExecutableNotLoadableError NSExecutableRuntimeMismatchError NSExecuteFunctionKey NSExpandedFontMask NSF10FunctionKey NSF11FunctionKey NSF12FunctionKey NSF13FunctionKey NSF14FunctionKey NSF15FunctionKey NSF16FunctionKey NSF17FunctionKey NSF18FunctionKey NSF19FunctionKey NSF1FunctionKey NSF20FunctionKey NSF21FunctionKey NSF22FunctionKey NSF23FunctionKey NSF24FunctionKey NSF25FunctionKey NSF26FunctionKey NSF27FunctionKey NSF28FunctionKey NSF29FunctionKey NSF2FunctionKey NSF30FunctionKey NSF31FunctionKey NSF32FunctionKey NSF33FunctionKey NSF34FunctionKey NSF35FunctionKey NSF3FunctionKey NSF4FunctionKey NSF5FunctionKey NSF6FunctionKey NSF7FunctionKey NSF8FunctionKey NSF9FunctionKey NSFPCurrentField NSFPPreviewButton NSFPPreviewField NSFPRevertButton NSFPSetButton NSFPSizeField NSFPSizeTitle NSFetchRequestExpressionType NSFileErrorMaximum NSFileErrorMinimum NSFileHandlingPanelCancelButton NSFileHandlingPanelOKButton NSFileLockingError NSFileNoSuchFileError NSFileReadCorruptFileError NSFileReadInapplicableStringEncodingError NSFileReadInvalidFileNameError NSFileReadNoPermissionError NSFileReadNoSuchFileError NSFileReadTooLargeError NSFileReadUnknownError NSFileReadUnknownStringEncodingError NSFileReadUnsupportedSchemeError NSFileWriteInapplicableStringEncodingError NSFileWriteInvalidFileNameError NSFileWriteNoPermissionError NSFileWriteOutOfSpaceError NSFileWriteUnknownError NSFileWriteUnsupportedSchemeError NSFindFunctionKey NSFindPanelActionNext NSFindPanelActionPrevious NSFindPanelActionReplace NSFindPanelActionReplaceAll NSFindPanelActionReplaceAllInSelection NSFindPanelActionReplaceAndFind NSFindPanelActionSelectAll NSFindPanelActionSelectAllInSelection NSFindPanelActionSetFindString NSFindPanelActionShowFindPanel NSFindPanelSubstringMatchTypeContains NSFindPanelSubstringMatchTypeEndsWith NSFindPanelSubstringMatchTypeFullWord NSFindPanelSubstringMatchTypeStartsWith NSFitPagination NSFixedPitchFontMask NSFlagsChanged NSFlagsChangedMask NSFloatType NSFloatingPointSamplesBitmapFormat NSFocusRingAbove NSFocusRingBelow NSFocusRingOnly NSFocusRingTypeDefault NSFocusRingTypeExterior NSFocusRingTypeNone NSFontAntialiasedIntegerAdvancementsRenderingMode NSFontAntialiasedRenderingMode NSFontBoldTrait NSFontClarendonSerifsClass NSFontCollectionApplicationOnlyMask NSFontCondensedTrait NSFontDefaultRenderingMode NSFontExpandedTrait NSFontFamilyClassMask NSFontFreeformSerifsClass NSFontIntegerAdvancementsRenderingMode NSFontItalicTrait NSFontModernSerifsClass NSFontMonoSpaceTrait NSFontOldStyleSerifsClass NSFontOrnamentalsClass NSFontPanelAllEffectsModeMask NSFontPanelAllModesMask NSFontPanelCollectionModeMask NSFontPanelDocumentColorEffectModeMask NSFontPanelFaceModeMask NSFontPanelShadowEffectModeMask NSFontPanelSizeModeMask NSFontPanelStandardModesMask NSFontPanelStrikethroughEffectModeMask NSFontPanelTextColorEffectModeMask NSFontPanelUnderlineEffectModeMask NSFontSansSerifClass NSFontScriptsClass NSFontSlabSerifsClass NSFontSymbolicClass NSFontTransitionalSerifsClass NSFontUIOptimizedTrait NSFontUnknownClass NSFontVerticalTrait NSForcedOrderingSearch NSFormFeedCharacter NSFormattingError NSFormattingErrorMaximum NSFormattingErrorMinimum NSFourByteGlyphPacking NSFunctionExpressionType NSFunctionKeyMask NSGIFFileType NSGlyphAbove NSGlyphAttributeBidiLevel NSGlyphAttributeElastic NSGlyphAttributeInscribe NSGlyphAttributeSoft NSGlyphBelow NSGlyphInscribeAbove NSGlyphInscribeBase NSGlyphInscribeBelow NSGlyphInscribeOverBelow NSGlyphInscribeOverstrike NSGlyphLayoutAgainstAPoint NSGlyphLayoutAtAPoint NSGlyphLayoutWithPrevious NSGradientConcaveStrong NSGradientConcaveWeak NSGradientConvexStrong NSGradientConvexWeak NSGradientDrawsAfterEndingLocation NSGradientDrawsBeforeStartingLocation NSGradientNone NSGraphiteControlTint NSGrayColorSpaceModel NSGrayModeColorPanel NSGreaterThanComparison NSGreaterThanOrEqualToComparison NSGreaterThanOrEqualToPredicateOperatorType NSGreaterThanPredicateOperatorType NSGrooveBorder NSHPUXOperatingSystem NSHSBModeColorPanel NSHTTPCookieAcceptPolicyAlways NSHTTPCookieAcceptPolicyNever NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain NSHUDWindowMask NSHashTableCopyIn NSHashTableObjectPointerPersonality NSHashTableStrongMemory NSHashTableZeroingWeakMemory NSHeavierFontAction NSHelpButtonBezelStyle NSHelpFunctionKey NSHelpKeyMask NSHighlightModeMatrix NSHomeFunctionKey NSHorizontalRuler NSHourCalendarUnit NSHourMinuteDatePickerElementFlag NSHourMinuteSecondDatePickerElementFlag NSISO2022JPStringEncoding NSISOLatin1StringEncoding NSISOLatin2StringEncoding NSIdentityMappingCharacterCollection NSIllegalTextMovement NSImageAbove NSImageAlignBottom NSImageAlignBottomLeft NSImageAlignBottomRight NSImageAlignCenter NSImageAlignLeft NSImageAlignRight NSImageAlignTop NSImageAlignTopLeft NSImageAlignTopRight NSImageBelow NSImageCacheAlways NSImageCacheBySize NSImageCacheDefault NSImageCacheNever NSImageCellType NSImageFrameButton NSImageFrameGrayBezel NSImageFrameGroove NSImageFrameNone NSImageFramePhoto NSImageInterpolationDefault NSImageInterpolationHigh NSImageInterpolationLow NSImageInterpolationNone NSImageLeft NSImageLoadStatusCancelled NSImageLoadStatusCompleted NSImageLoadStatusInvalidData NSImageLoadStatusReadError NSImageLoadStatusUnexpectedEOF NSImageOnly NSImageOverlaps NSImageRepLoadStatusCompleted NSImageRepLoadStatusInvalidData NSImageRepLoadStatusReadingHeader NSImageRepLoadStatusUnexpectedEOF NSImageRepLoadStatusUnknownType NSImageRepLoadStatusWillNeedAllData NSImageRepMatchesDevice NSImageRight NSImageScaleAxesIndependently NSImageScaleNone NSImageScaleProportionallyDown NSImageScaleProportionallyUpOrDown NSInPredicateOperatorType NSIndexSubelement NSIndexedColorSpaceModel NSInformationalAlertStyle NSInformationalRequest NSInsertCharFunctionKey NSInsertFunctionKey NSInsertLineFunctionKey NSIntType NSInternalScriptError NSInternalSpecifierError NSIntersectSetExpressionType NSInvalidIndexSpecifierError NSItalicFontMask NSJPEG2000FileType NSJPEGFileType NSJapaneseEUCGlyphPacking NSJapaneseEUCStringEncoding NSJustifiedTextAlignment NSKeyDown NSKeyDownMask NSKeyPathExpressionType NSKeySpecifierEvaluationScriptError NSKeyUp NSKeyUpMask NSKeyValueChangeInsertion NSKeyValueChangeRemoval NSKeyValueChangeReplacement NSKeyValueChangeSetting NSKeyValueIntersectSetMutation NSKeyValueMinusSetMutation NSKeyValueObservingOptionInitial NSKeyValueObservingOptionNew NSKeyValueObservingOptionOld NSKeyValueObservingOptionPrior NSKeyValueSetSetMutation NSKeyValueUnionSetMutation NSKeyValueValidationError NSLABColorSpaceModel NSLandscapeOrientation NSLayoutCantFit NSLayoutDone NSLayoutLeftToRight NSLayoutNotDone NSLayoutOutOfGlyphs NSLayoutRightToLeft NSLeftArrowFunctionKey NSLeftMouseDown NSLeftMouseDownMask NSLeftMouseDragged NSLeftMouseDraggedMask NSLeftMouseUp NSLeftMouseUpMask NSLeftTabStopType NSLeftTabsBezelBorder NSLeftTextAlignment NSLeftTextMovement NSLessThanComparison NSLessThanOrEqualToComparison NSLessThanOrEqualToPredicateOperatorType NSLessThanPredicateOperatorType NSLibraryDirectory NSLighterFontAction NSLikePredicateOperatorType NSLineBorder NSLineBreakByCharWrapping NSLineBreakByClipping NSLineBreakByTruncatingHead NSLineBreakByTruncatingMiddle NSLineBreakByTruncatingTail NSLineBreakByWordWrapping NSLineDoesntMove NSLineMovesDown NSLineMovesLeft NSLineMovesRight NSLineMovesUp NSLineSeparatorCharacter NSLineSweepDown NSLineSweepLeft NSLineSweepRight NSLineSweepUp NSLineToBezierPathElement NSLinearSlider NSListModeMatrix NSLiteralSearch NSLocalDomainMask NSMACHOperatingSystem NSMacOSRomanStringEncoding NSMachPortDeallocateNone NSMachPortDeallocateReceiveRight NSMachPortDeallocateSendRight NSMacintoshInterfaceStyle NSManagedObjectContextLockingError NSManagedObjectExternalRelationshipError NSManagedObjectIDResultType NSManagedObjectMergeError NSManagedObjectReferentialIntegrityError NSManagedObjectResultType NSManagedObjectValidationError NSMapTableCopyIn NSMapTableObjectPointerPersonality NSMapTableStrongMemory NSMapTableZeroingWeakMemory NSMappedRead NSMatchesPredicateOperatorType NSMaxXEdge NSMaxYEdge NSMenuFunctionKey NSMiddleSubelement NSMigrationCancelledError NSMigrationError NSMigrationManagerDestinationStoreError NSMigrationManagerSourceStoreError NSMigrationMissingMappingModelError NSMigrationMissingSourceModelError NSMinXEdge NSMinYEdge NSMiniaturizableWindowMask NSMinusSetExpressionType NSMinuteCalendarUnit NSMiterLineJoinStyle NSMixedState NSModeSwitchFunctionKey NSMomentaryChangeButton NSMomentaryLight NSMomentaryLightButton NSMomentaryPushButton NSMomentaryPushInButton NSMonthCalendarUnit NSMouseEntered NSMouseEnteredMask NSMouseEventSubtype NSMouseExited NSMouseExitedMask NSMouseMoved NSMouseMovedMask NSMoveToBezierPathElement NSNEXTSTEPStringEncoding NSNarrowFontMask NSNativeShortGlyphPacking NSNaturalTextAlignment NSNetServiceNoAutoRename NSNetServicesActivityInProgress NSNetServicesBadArgumentError NSNetServicesCancelledError NSNetServicesCollisionError NSNetServicesInvalidError NSNetServicesNotFoundError NSNetServicesTimeoutError NSNetServicesUnknownError NSNetworkDomainMask NSNewlineCharacter NSNextFunctionKey NSNextStepInterfaceStyle NSNoBorder NSNoCellMask NSNoFontChangeAction NSNoImage NSNoInterfaceStyle NSNoModeColorPanel NSNoScriptError NSNoScrollerParts NSNoSpecifierError NSNoSubelement NSNoTabsBezelBorder NSNoTabsLineBorder NSNoTabsNoBorder NSNoTitle NSNoTopLevelContainersSpecifierError NSNoUnderlineStyle NSNonLossyASCIIStringEncoding NSNonStandardCharacterSetFontMask NSNonZeroWindingRule NSNonactivatingPanelMask NSNotEqualToPredicateOperatorType NSNotPredicateType NSNotificationCoalescingOnName NSNotificationCoalescingOnSender NSNotificationDeliverImmediately NSNotificationNoCoalescing NSNotificationPostToAllSessions NSNotificationSuspensionBehaviorCoalesce NSNotificationSuspensionBehaviorDeliverImmediately NSNotificationSuspensionBehaviorDrop NSNotificationSuspensionBehaviorHold NSNullCellType NSNullGlyph NSNumberFormatterBehavior10_0 NSNumberFormatterBehavior10_4 NSNumberFormatterBehaviorDefault NSNumberFormatterCurrencyStyle NSNumberFormatterDecimalStyle NSNumberFormatterNoStyle NSNumberFormatterPadAfterPrefix NSNumberFormatterPadAfterSuffix NSNumberFormatterPadBeforePrefix NSNumberFormatterPadBeforeSuffix NSNumberFormatterPercentStyle NSNumberFormatterRoundCeiling NSNumberFormatterRoundDown NSNumberFormatterRoundFloor NSNumberFormatterRoundHalfDown NSNumberFormatterRoundHalfEven NSNumberFormatterRoundHalfUp NSNumberFormatterRoundUp NSNumberFormatterScientificStyle NSNumberFormatterSpellOutStyle NSNumericPadKeyMask NSNumericSearch NSOKButton NSOSF1OperatingSystem NSObjCArrayType NSObjCBitfield NSObjCBoolType NSObjCCharType NSObjCDoubleType NSObjCFloatType NSObjCLongType NSObjCLonglongType NSObjCNoType NSObjCObjectType NSObjCPointerType NSObjCSelectorType NSObjCShortType NSObjCStringType NSObjCStructType NSObjCUnionType NSObjCVoidType NSOffState NSOnOffButton NSOnState NSOneByteGlyphPacking NSOnlyScrollerArrows NSOpenGLGOClearFormatCache NSOpenGLGOFormatCacheSize NSOpenGLGOResetLibrary NSOpenGLGORetainRenderers NSOpenGLPFAAccelerated NSOpenGLPFAAccumSize NSOpenGLPFAAllRenderers NSOpenGLPFAAllowOfflineRenderers NSOpenGLPFAAlphaSize NSOpenGLPFAAuxBuffers NSOpenGLPFAAuxDepthStencil NSOpenGLPFABackingStore NSOpenGLPFAClosestPolicy NSOpenGLPFAColorFloat NSOpenGLPFAColorSize NSOpenGLPFACompliant NSOpenGLPFADepthSize NSOpenGLPFADoubleBuffer NSOpenGLPFAFullScreen NSOpenGLPFAMPSafe NSOpenGLPFAMaximumPolicy NSOpenGLPFAMinimumPolicy NSOpenGLPFAMultiScreen NSOpenGLPFAMultisample NSOpenGLPFANoRecovery NSOpenGLPFAOffScreen NSOpenGLPFAPixelBuffer NSOpenGLPFARendererID NSOpenGLPFARobust NSOpenGLPFASampleAlpha NSOpenGLPFASampleBuffers NSOpenGLPFASamples NSOpenGLPFAScreenMask NSOpenGLPFASingleRenderer NSOpenGLPFAStencilSize NSOpenGLPFAStereo NSOpenGLPFASupersample NSOpenGLPFAVirtualScreenCount NSOpenGLPFAWindow NSOpenStepUnicodeReservedBase NSOperationNotSupportedForKeyScriptError NSOperationNotSupportedForKeySpecifierError NSOperationQueueDefaultMaxConcurrentOperationCount NSOperationQueuePriorityHigh NSOperationQueuePriorityLow NSOperationQueuePriorityNormal NSOperationQueuePriorityVeryHigh NSOperationQueuePriorityVeryLow NSOrPredicateType NSOtherMouseDown NSOtherMouseDownMask NSOtherMouseDragged NSOtherMouseDraggedMask NSOtherMouseUp NSOtherMouseUpMask NSOtherTextMovement NSPNGFileType NSPageDownFunctionKey NSPageUpFunctionKey NSParagraphSeparatorCharacter NSPathStyleNavigationBar NSPathStylePopUp NSPathStyleStandard NSPatternColorSpaceModel NSPauseFunctionKey NSPenLowerSideMask NSPenPointingDevice NSPenTipMask NSPenUpperSideMask NSPeriodic NSPeriodicMask NSPersistentStoreCoordinatorLockingError NSPersistentStoreIncompatibleSchemaError NSPersistentStoreIncompatibleVersionHashError NSPersistentStoreIncompleteSaveError NSPersistentStoreInvalidTypeError NSPersistentStoreOpenError NSPersistentStoreOperationError NSPersistentStoreSaveError NSPersistentStoreTimeoutError NSPersistentStoreTypeMismatchError NSPlainTextTokenStyle NSPointerFunctionsCStringPersonality NSPointerFunctionsCopyIn NSPointerFunctionsIntegerPersonality NSPointerFunctionsMachVirtualMemory NSPointerFunctionsMallocMemory NSPointerFunctionsObjectPersonality NSPointerFunctionsObjectPointerPersonality NSPointerFunctionsOpaqueMemory NSPointerFunctionsOpaquePersonality NSPointerFunctionsStrongMemory NSPointerFunctionsStructPersonality NSPointerFunctionsZeroingWeakMemory NSPopUpArrowAtBottom NSPopUpArrowAtCenter NSPopUpNoArrow NSPortraitOrientation NSPositionAfter NSPositionBefore NSPositionBeginning NSPositionEnd NSPositionReplace NSPositiveDoubleType NSPositiveFloatType NSPositiveIntType NSPostASAP NSPostNow NSPostWhenIdle NSPosterFontMask NSPowerOffEventType NSPressedTab NSPrevFunctionKey NSPrintFunctionKey NSPrintPanelShowsCopies NSPrintPanelShowsOrientation NSPrintPanelShowsPageRange NSPrintPanelShowsPageSetupAccessory NSPrintPanelShowsPaperSize NSPrintPanelShowsPreview NSPrintPanelShowsScaling NSPrintScreenFunctionKey NSPrinterTableError NSPrinterTableNotFound NSPrinterTableOK NSPrintingCancelled NSPrintingFailure NSPrintingReplyLater NSPrintingSuccess NSProgressIndicatorBarStyle NSProgressIndicatorPreferredAquaThickness NSProgressIndicatorPreferredLargeThickness NSProgressIndicatorPreferredSmallThickness NSProgressIndicatorPreferredThickness NSProgressIndicatorSpinningStyle NSPropertyListBinaryFormat_v1_0 NSPropertyListImmutable NSPropertyListMutableContainers NSPropertyListMutableContainersAndLeaves NSPropertyListOpenStepFormat NSPropertyListXMLFormat_v1_0 NSProprietaryStringEncoding NSPushInCell NSPushInCellMask NSPushOnPushOffButton NSQTMovieLoopingBackAndForthPlayback NSQTMovieLoopingPlayback NSQTMovieNormalPlayback NSRGBColorSpaceModel NSRGBModeColorPanel NSRadioButton NSRadioModeMatrix NSRandomSubelement NSRangeDateMode NSRatingLevelIndicatorStyle NSReceiverEvaluationScriptError NSReceiversCantHandleCommandScriptError NSRecessedBezelStyle NSRedoFunctionKey NSRegularControlSize NSRegularSquareBezelStyle NSRelativeAfter NSRelativeBefore NSRelevancyLevelIndicatorStyle NSRemoveEntityMappingType NSRemoveTraitFontAction NSRequiredArgumentsMissingScriptError NSResetCursorRectsRunLoopOrdering NSResetFunctionKey NSResizableWindowMask NSReturnTextMovement NSRightArrowFunctionKey NSRightMouseDown NSRightMouseDownMask NSRightMouseDragged NSRightMouseDraggedMask NSRightMouseUp NSRightMouseUpMask NSRightTabStopType NSRightTabsBezelBorder NSRightTextAlignment NSRightTextMovement NSRoundBankers NSRoundDown NSRoundLineCapStyle NSRoundLineJoinStyle NSRoundPlain NSRoundRectBezelStyle NSRoundUp NSRoundedBezelStyle NSRoundedDisclosureBezelStyle NSRoundedTokenStyle NSRuleEditorNestingModeCompound NSRuleEditorNestingModeList NSRuleEditorNestingModeSimple NSRuleEditorNestingModeSingle NSRuleEditorRowTypeCompound NSRuleEditorRowTypeSimple NSRunAbortedResponse NSRunContinuesResponse NSRunStoppedResponse NSSQLiteError NSSaveAsOperation NSSaveOperation NSSaveOptionsAsk NSSaveOptionsNo NSSaveOptionsYes NSSaveToOperation NSScaleNone NSScaleProportionally NSScaleToFit NSScannedOption NSScreenChangedEventType NSScrollLockFunctionKey NSScrollWheel NSScrollWheelMask NSScrollerArrowsDefaultSetting NSScrollerArrowsMaxEnd NSScrollerArrowsMinEnd NSScrollerArrowsNone NSScrollerDecrementArrow NSScrollerDecrementLine NSScrollerDecrementPage NSScrollerIncrementArrow NSScrollerIncrementLine NSScrollerIncrementPage NSScrollerKnob NSScrollerKnobSlot NSScrollerNoPart NSSecondCalendarUnit NSSegmentStyleAutomatic NSSegmentStyleCapsule NSSegmentStyleRoundRect NSSegmentStyleRounded NSSegmentStyleSmallSquare NSSegmentStyleTexturedRounded NSSegmentStyleTexturedSquare NSSegmentSwitchTrackingMomentary NSSegmentSwitchTrackingSelectAny NSSegmentSwitchTrackingSelectOne NSSelectByCharacter NSSelectByParagraph NSSelectByWord NSSelectFunctionKey NSSelectedTab NSSelectingNext NSSelectingPrevious NSSelectionAffinityDownstream NSSelectionAffinityUpstream NSServiceApplicationLaunchFailedError NSServiceApplicationNotFoundError NSServiceErrorMaximum NSServiceErrorMinimum NSServiceInvalidPasteboardDataError NSServiceMalformedServiceDictionaryError NSServiceMiscellaneousError NSServiceRequestTimedOutError NSShadowlessSquareBezelStyle NSShiftJISStringEncoding NSShiftKeyMask NSShowControlGlyphs NSShowInvisibleGlyphs NSSingleDateMode NSSingleUnderlineStyle NSSizeDownFontAction NSSizeUpFontAction NSSmallCapsFontMask NSSmallControlSize NSSmallIconButtonBezelStyle NSSmallSquareBezelStyle NSSolarisOperatingSystem NSSpecialPageOrder NSSpeechImmediateBoundary NSSpeechSentenceBoundary NSSpeechWordBoundary NSSpellingStateGrammarFlag NSSpellingStateSpellingFlag NSSplitViewDividerStyleThick NSSplitViewDividerStyleThin NSSquareLineCapStyle NSStopFunctionKey NSStreamEventEndEncountered NSStreamEventErrorOccurred NSStreamEventHasBytesAvailable NSStreamEventHasSpaceAvailable NSStreamEventNone NSStreamEventOpenCompleted NSStreamStatusAtEnd NSStreamStatusClosed NSStreamStatusError NSStreamStatusNotOpen NSStreamStatusOpen NSStreamStatusOpening NSStreamStatusReading NSStreamStatusWriting NSStringDrawingDisableScreenFontSubstitution NSStringDrawingOneShot NSStringDrawingTruncatesLastVisibleLine NSStringDrawingUsesDeviceMetrics NSStringDrawingUsesFontLeading NSStringDrawingUsesLineFragmentOrigin NSStringEncodingConversionAllowLossy NSStringEncodingConversionExternalRepresentation NSSubqueryExpressionType NSSunOSOperatingSystem NSSwitchButton NSSymbolStringEncoding NSSysReqFunctionKey NSSystemDefined NSSystemDefinedMask NSSystemDomainMask NSSystemFunctionKey NSTIFFCompressionCCITTFAX3 NSTIFFCompressionCCITTFAX4 NSTIFFCompressionJPEG NSTIFFCompressionLZW NSTIFFCompressionNEXT NSTIFFCompressionNone NSTIFFCompressionOldJPEG NSTIFFCompressionPackBits NSTIFFFileType NSTabCharacter NSTabTextMovement NSTableColumnAutoresizingMask NSTableColumnNoResizing NSTableColumnUserResizingMask NSTableViewFirstColumnOnlyAutoresizingStyle NSTableViewGridNone NSTableViewLastColumnOnlyAutoresizingStyle NSTableViewNoColumnAutoresizing NSTableViewReverseSequentialColumnAutoresizingStyle NSTableViewSelectionHighlightStyleRegular NSTableViewSelectionHighlightStyleSourceList NSTableViewSequentialColumnAutoresizingStyle NSTableViewSolidHorizontalGridLineMask NSTableViewSolidVerticalGridLineMask NSTableViewUniformColumnAutoresizingStyle NSTabletPoint NSTabletPointEventSubtype NSTabletPointMask NSTabletProximity NSTabletProximityEventSubtype NSTabletProximityMask NSTerminateCancel NSTerminateLater NSTerminateNow NSTextBlockAbsoluteValueType NSTextBlockBaselineAlignment NSTextBlockBorder NSTextBlockBottomAlignment NSTextBlockHeight NSTextBlockMargin NSTextBlockMaximumHeight NSTextBlockMaximumWidth NSTextBlockMiddleAlignment NSTextBlockMinimumHeight NSTextBlockMinimumWidth NSTextBlockPadding NSTextBlockPercentageValueType NSTextBlockTopAlignment NSTextBlockWidth NSTextCellType NSTextFieldAndStepperDatePickerStyle NSTextFieldDatePickerStyle NSTextFieldRoundedBezel NSTextFieldSquareBezel NSTextListPrependEnclosingMarker NSTextReadInapplicableDocumentTypeError NSTextReadWriteErrorMaximum NSTextReadWriteErrorMinimum NSTextStorageEditedAttributes NSTextStorageEditedCharacters NSTextTableAutomaticLayoutAlgorithm NSTextTableFixedLayoutAlgorithm NSTextWriteInapplicableDocumentTypeError NSTexturedBackgroundWindowMask NSTexturedRoundedBezelStyle NSTexturedSquareBezelStyle NSThickSquareBezelStyle NSThickerSquareBezelStyle NSTickMarkAbove NSTickMarkBelow NSTickMarkLeft NSTickMarkRight NSTimeZoneDatePickerElementFlag NSTimeZoneNameStyleDaylightSaving NSTimeZoneNameStyleShortDaylightSaving NSTimeZoneNameStyleShortStandard NSTimeZoneNameStyleStandard NSTitledWindowMask NSToggleButton NSToolbarItemVisibilityPriorityHigh NSToolbarItemVisibilityPriorityLow NSToolbarItemVisibilityPriorityStandard NSToolbarItemVisibilityPriorityUser NSTopTabsBezelBorder NSTrackModeMatrix NSTrackingActiveAlways NSTrackingActiveInActiveApp NSTrackingActiveInKeyWindow NSTrackingActiveWhenFirstResponder NSTrackingAssumeInside NSTrackingCursorUpdate NSTrackingEnabledDuringMouseDrag NSTrackingInVisibleRect NSTrackingMouseEnteredAndExited NSTrackingMouseMoved NSTransformEntityMappingType NSTwoByteGlyphPacking NSTypesetterBehavior_10_2 NSTypesetterBehavior_10_2_WithCompatibility NSTypesetterBehavior_10_3 NSTypesetterBehavior_10_4 NSTypesetterContainerBreakAction NSTypesetterHorizontalTabAction NSTypesetterLatestBehavior NSTypesetterLineBreakAction NSTypesetterOriginalBehavior NSTypesetterParagraphBreakAction NSTypesetterWhitespaceAction NSTypesetterZeroAdvancementAction NSURLCredentialPersistenceForSession NSURLCredentialPersistenceNone NSURLCredentialPersistencePermanent NSURLHandleLoadFailed NSURLHandleLoadInProgress NSURLHandleLoadSucceeded NSURLHandleNotLoaded NSUTF16BigEndianStringEncoding NSUTF16LittleEndianStringEncoding NSUTF16StringEncoding NSUTF32BigEndianStringEncoding NSUTF32LittleEndianStringEncoding NSUTF32StringEncoding NSUTF8StringEncoding NSUnboldFontMask NSUncachedRead NSUndefinedDateComponent NSUndefinedEntityMappingType NSUnderlinePatternDash NSUnderlinePatternDashDot NSUnderlinePatternDashDotDot NSUnderlinePatternDot NSUnderlinePatternSolid NSUnderlineStyleDouble NSUnderlineStyleNone NSUnderlineStyleSingle NSUnderlineStyleThick NSUndoCloseGroupingRunLoopOrdering NSUndoFunctionKey NSUnicodeStringEncoding NSUnifiedTitleAndToolbarWindowMask NSUnionSetExpressionType NSUnitalicFontMask NSUnknownColorSpaceModel NSUnknownKeyScriptError NSUnknownKeySpecifierError NSUnknownPageOrder NSUnknownPointingDevice NSUnscaledWindowMask NSUpArrowFunctionKey NSUpTextMovement NSUpdateWindowsRunLoopOrdering NSUserCancelledError NSUserDirectory NSUserDomainMask NSUserFunctionKey NSUtilityWindowMask NSValidationDateTooLateError NSValidationDateTooSoonError NSValidationErrorMaximum NSValidationErrorMinimum NSValidationInvalidDateError NSValidationMissingMandatoryPropertyError NSValidationMultipleErrorsError NSValidationNumberTooLargeError NSValidationNumberTooSmallError NSValidationRelationshipDeniedDeleteError NSValidationRelationshipExceedsMaximumCountError NSValidationRelationshipLacksMinimumCountError NSValidationStringPatternMatchingError NSValidationStringTooLongError NSValidationStringTooShortError NSVariableExpressionType NSVerticalRuler NSViaPanelFontAction NSViewHeightSizable NSViewMaxXMargin NSViewMaxYMargin NSViewMinXMargin NSViewMinYMargin NSViewNotSizable NSViewWidthSizable NSWantsBidiLevels NSWarningAlertStyle NSWeekCalendarUnit NSWeekdayCalendarUnit NSWeekdayOrdinalCalendarUnit NSWheelModeColorPanel NSWidthInsensitiveSearch NSWindowAbove NSWindowBackingLocationDefault NSWindowBackingLocationMainMemory NSWindowBackingLocationVideoMemory NSWindowBelow NSWindowCloseButton NSWindowCollectionBehaviorCanJoinAllSpaces NSWindowCollectionBehaviorDefault NSWindowCollectionBehaviorMoveToActiveSpace NSWindowDocumentIconButton NSWindowExposedEventType NSWindowMiniaturizeButton NSWindowMovedEventType NSWindowOut NSWindowSharingNone NSWindowSharingReadOnly NSWindowSharingReadWrite NSWindowToolbarButton NSWindowZoomButton NSWindows95InterfaceStyle NSWindows95OperatingSystem NSWindowsCP1250StringEncoding NSWindowsCP1251StringEncoding NSWindowsCP1252StringEncoding NSWindowsCP1253StringEncoding NSWindowsCP1254StringEncoding NSWindowsNTOperatingSystem NSWorkspaceLaunchAllowingClassicStartup NSWorkspaceLaunchAndHide NSWorkspaceLaunchAndHideOthers NSWorkspaceLaunchAndPrint NSWorkspaceLaunchAsync NSWorkspaceLaunchDefault NSWorkspaceLaunchInhibitingBackgroundOnly NSWorkspaceLaunchNewInstance NSWorkspaceLaunchPreferringClassic NSWorkspaceLaunchWithoutActivation NSWorkspaceLaunchWithoutAddingToRecents NSWrapCalendarComponents NSWritingDirectionLeftToRight NSWritingDirectionNatural NSWritingDirectionRightToLeft NSXMLAttributeCDATAKind NSXMLAttributeDeclarationKind NSXMLAttributeEntitiesKind NSXMLAttributeEntityKind NSXMLAttributeEnumerationKind NSXMLAttributeIDKind NSXMLAttributeIDRefKind NSXMLAttributeIDRefsKind NSXMLAttributeKind NSXMLAttributeNMTokenKind NSXMLAttributeNMTokensKind NSXMLAttributeNotationKind NSXMLCommentKind NSXMLDTDKind NSXMLDocumentHTMLKind NSXMLDocumentIncludeContentTypeDeclaration NSXMLDocumentKind NSXMLDocumentTextKind NSXMLDocumentTidyHTML NSXMLDocumentTidyXML NSXMLDocumentValidate NSXMLDocumentXHTMLKind NSXMLDocumentXInclude NSXMLDocumentXMLKind NSXMLElementDeclarationAnyKind NSXMLElementDeclarationElementKind NSXMLElementDeclarationEmptyKind NSXMLElementDeclarationKind NSXMLElementDeclarationMixedKind NSXMLElementDeclarationUndefinedKind NSXMLElementKind NSXMLEntityDeclarationKind NSXMLEntityGeneralKind NSXMLEntityParameterKind NSXMLEntityParsedKind NSXMLEntityPredefined NSXMLEntityUnparsedKind NSXMLInvalidKind NSXMLNamespaceKind NSXMLNodeCompactEmptyElement NSXMLNodeExpandEmptyElement NSXMLNodeIsCDATA NSXMLNodeOptionsNone NSXMLNodePreserveAll NSXMLNodePreserveAttributeOrder NSXMLNodePreserveCDATA NSXMLNodePreserveCharacterReferences NSXMLNodePreserveDTD NSXMLNodePreserveEmptyElements NSXMLNodePreserveEntities NSXMLNodePreserveNamespaceOrder NSXMLNodePreservePrefixes NSXMLNodePreserveQuotes NSXMLNodePreserveWhitespace NSXMLNodePrettyPrint NSXMLNodeUseDoubleQuotes NSXMLNodeUseSingleQuotes NSXMLNotationDeclarationKind NSXMLParserAttributeHasNoValueError NSXMLParserAttributeListNotFinishedError NSXMLParserAttributeListNotStartedError NSXMLParserAttributeNotFinishedError NSXMLParserAttributeNotStartedError NSXMLParserAttributeRedefinedError NSXMLParserCDATANotFinishedError NSXMLParserCharacterRefAtEOFError NSXMLParserCharacterRefInDTDError NSXMLParserCharacterRefInEpilogError NSXMLParserCharacterRefInPrologError NSXMLParserCommentContainsDoubleHyphenError NSXMLParserCommentNotFinishedError NSXMLParserConditionalSectionNotFinishedError NSXMLParserConditionalSectionNotStartedError NSXMLParserDOCTYPEDeclNotFinishedError NSXMLParserDelegateAbortedParseError NSXMLParserDocumentStartError NSXMLParserElementContentDeclNotFinishedError NSXMLParserElementContentDeclNotStartedError NSXMLParserEmptyDocumentError NSXMLParserEncodingNotSupportedError NSXMLParserEntityBoundaryError NSXMLParserEntityIsExternalError NSXMLParserEntityIsParameterError NSXMLParserEntityNotFinishedError NSXMLParserEntityNotStartedError NSXMLParserEntityRefAtEOFError NSXMLParserEntityRefInDTDError NSXMLParserEntityRefInEpilogError NSXMLParserEntityRefInPrologError NSXMLParserEntityRefLoopError NSXMLParserEntityReferenceMissingSemiError NSXMLParserEntityReferenceWithoutNameError NSXMLParserEntityValueRequiredError NSXMLParserEqualExpectedError NSXMLParserExternalStandaloneEntityError NSXMLParserExternalSubsetNotFinishedError NSXMLParserExtraContentError NSXMLParserGTRequiredError NSXMLParserInternalError NSXMLParserInvalidCharacterError NSXMLParserInvalidCharacterInEntityError NSXMLParserInvalidCharacterRefError NSXMLParserInvalidConditionalSectionError NSXMLParserInvalidDecimalCharacterRefError NSXMLParserInvalidEncodingError NSXMLParserInvalidEncodingNameError NSXMLParserInvalidHexCharacterRefError NSXMLParserInvalidURIError NSXMLParserLTRequiredError NSXMLParserLTSlashRequiredError NSXMLParserLessThanSymbolInAttributeError NSXMLParserLiteralNotFinishedError NSXMLParserLiteralNotStartedError NSXMLParserMisplacedCDATAEndStringError NSXMLParserMisplacedXMLDeclarationError NSXMLParserMixedContentDeclNotFinishedError NSXMLParserMixedContentDeclNotStartedError NSXMLParserNAMERequiredError NSXMLParserNMTOKENRequiredError NSXMLParserNamespaceDeclarationError NSXMLParserNoDTDError NSXMLParserNotWellBalancedError NSXMLParserNotationNotFinishedError NSXMLParserNotationNotStartedError NSXMLParserOutOfMemoryError NSXMLParserPCDATARequiredError NSXMLParserParsedEntityRefAtEOFError NSXMLParserParsedEntityRefInEpilogError NSXMLParserParsedEntityRefInInternalError NSXMLParserParsedEntityRefInInternalSubsetError NSXMLParserParsedEntityRefInPrologError NSXMLParserParsedEntityRefMissingSemiError NSXMLParserParsedEntityRefNoNameError NSXMLParserPrematureDocumentEndError NSXMLParserProcessingInstructionNotFinishedError NSXMLParserProcessingInstructionNotStartedError NSXMLParserPublicIdentifierRequiredError NSXMLParserSeparatorRequiredError NSXMLParserSpaceRequiredError NSXMLParserStandaloneValueError NSXMLParserStringNotClosedError NSXMLParserStringNotStartedError NSXMLParserTagNameMismatchError NSXMLParserURIFragmentError NSXMLParserURIRequiredError NSXMLParserUndeclaredEntityError NSXMLParserUnfinishedTagError NSXMLParserUnknownEncodingError NSXMLParserUnparsedEntityError NSXMLParserXMLDeclNotFinishedError NSXMLParserXMLDeclNotStartedError NSXMLProcessingInstructionKind NSXMLTextKind NSYearCalendarUnit NSYearMonthDatePickerElementFlag NSYearMonthDayDatePickerElementFlag UIActionSheetStyleAutomatic UIActionSheetStyleBlackOpaque UIActionSheetStyleBlackTranslucent UIActionSheetStyleDefault UIActivityIndicatorViewStyleGray UIActivityIndicatorViewStyleWhite UIActivityIndicatorViewStyleWhiteLarge UIBarButtonItemStyleBordered UIBarButtonItemStyleDone UIBarButtonItemStylePlain UIBarButtonSystemItemAction UIBarButtonSystemItemAdd UIBarButtonSystemItemBookmarks UIBarButtonSystemItemCamera UIBarButtonSystemItemCancel UIBarButtonSystemItemCompose UIBarButtonSystemItemDone UIBarButtonSystemItemEdit UIBarButtonSystemItemFastForward UIBarButtonSystemItemFixedSpace UIBarButtonSystemItemFlexibleSpace UIBarButtonSystemItemOrganize UIBarButtonSystemItemPause UIBarButtonSystemItemPlay UIBarButtonSystemItemRedo UIBarButtonSystemItemRefresh UIBarButtonSystemItemReply UIBarButtonSystemItemRewind UIBarButtonSystemItemSave UIBarButtonSystemItemSearch UIBarButtonSystemItemStop UIBarButtonSystemItemTrash UIBarButtonSystemItemUndo UIBarStyleBlack UIBarStyleBlackOpaque UIBarStyleBlackTranslucent UIBarStyleDefault UIBaselineAdjustmentAlignBaselines UIBaselineAdjustmentAlignCenters UIBaselineAdjustmentNone UIButtonTypeContactAdd UIButtonTypeCustom UIButtonTypeDetailDisclosure UIButtonTypeInfoDark UIButtonTypeInfoLight UIButtonTypeRoundedRect UIControlContentHorizontalAlignmentCenter UIControlContentHorizontalAlignmentFill UIControlContentHorizontalAlignmentLeft UIControlContentHorizontalAlignmentRight UIControlContentVerticalAlignmentBottom UIControlContentVerticalAlignmentCenter UIControlContentVerticalAlignmentFill UIControlContentVerticalAlignmentTop UIControlEventAllEditingEvents UIControlEventAllEvents UIControlEventAllTouchEvents UIControlEventApplicationReserved UIControlEventEditingChanged UIControlEventEditingDidBegin UIControlEventEditingDidEnd UIControlEventEditingDidEndOnExit UIControlEventSystemReserved UIControlEventTouchCancel UIControlEventTouchDown UIControlEventTouchDownRepeat UIControlEventTouchDragEnter UIControlEventTouchDragExit UIControlEventTouchDragInside UIControlEventTouchDragOutside UIControlEventTouchUpInside UIControlEventTouchUpOutside UIControlEventValueChanged UIControlStateApplication UIControlStateDisabled UIControlStateHighlighted UIControlStateNormal UIControlStateReserved UIControlStateSelected UIDataDetectorTypeAll UIDataDetectorTypeLink UIDataDetectorTypeNone UIDataDetectorTypePhoneNumber UIDatePickerModeCountDownTimer UIDatePickerModeDate UIDatePickerModeDateAndTime UIDatePickerModeTime UIDeviceBatteryStateCharging UIDeviceBatteryStateFull UIDeviceBatteryStateUnknown UIDeviceBatteryStateUnplugged UIDeviceOrientationFaceDown UIDeviceOrientationFaceUp UIDeviceOrientationLandscapeLeft UIDeviceOrientationLandscapeRight UIDeviceOrientationPortrait UIDeviceOrientationPortraitUpsideDown UIDeviceOrientationUnknown UIEventSubtypeMotionShake UIEventSubtypeNone UIEventTypeMotion UIEventTypeTouches UIImageOrientationDown UIImageOrientationDownMirrored UIImageOrientationLeft UIImageOrientationLeftMirrored UIImageOrientationRight UIImageOrientationRightMirrored UIImageOrientationUp UIImageOrientationUpMirrored UIImagePickerControllerSourceTypeCamera UIImagePickerControllerSourceTypePhotoLibrary UIImagePickerControllerSourceTypeSavedPhotosAlbum UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIKeyboardAppearanceAlert UIKeyboardAppearanceDefault UIKeyboardTypeASCIICapable UIKeyboardTypeAlphabet UIKeyboardTypeDefault UIKeyboardTypeEmailAddress UIKeyboardTypeNamePhonePad UIKeyboardTypeNumberPad UIKeyboardTypeNumbersAndPunctuation UIKeyboardTypePhonePad UIKeyboardTypeURL UILineBreakModeCharacterWrap UILineBreakModeClip UILineBreakModeHeadTruncation UILineBreakModeMiddleTruncation UILineBreakModeTailTruncation UILineBreakModeWordWrap UIModalTransitionStyleCoverVertical UIModalTransitionStyleCrossDissolve UIModalTransitionStyleFlipHorizontal UIProgressViewStyleBar UIProgressViewStyleDefault UIRemoteNotificationTypeAlert UIRemoteNotificationTypeBadge UIRemoteNotificationTypeNone UIRemoteNotificationTypeSound UIReturnKeyDefault UIReturnKeyDone UIReturnKeyEmergencyCall UIReturnKeyGo UIReturnKeyGoogle UIReturnKeyJoin UIReturnKeyNext UIReturnKeyRoute UIReturnKeySearch UIReturnKeySend UIReturnKeyYahoo UIScrollViewIndicatorStyleBlack UIScrollViewIndicatorStyleDefault UIScrollViewIndicatorStyleWhite UISegmentedControlNoSegment UISegmentedControlStyleBar UISegmentedControlStyleBordered UISegmentedControlStylePlain UIStatusBarStyleBlackOpaque UIStatusBarStyleBlackTranslucent UIStatusBarStyleDefault UITabBarSystemItemBookmarks UITabBarSystemItemContacts UITabBarSystemItemDownloads UITabBarSystemItemFavorites UITabBarSystemItemFeatured UITabBarSystemItemHistory UITabBarSystemItemMore UITabBarSystemItemMostRecent UITabBarSystemItemMostViewed UITabBarSystemItemRecents UITabBarSystemItemSearch UITabBarSystemItemTopRated UITableViewCellAccessoryCheckmark UITableViewCellAccessoryDetailDisclosureButton UITableViewCellAccessoryDisclosureIndicator UITableViewCellAccessoryNone UITableViewCellEditingStyleDelete UITableViewCellEditingStyleInsert UITableViewCellEditingStyleNone UITableViewCellSelectionStyleBlue UITableViewCellSelectionStyleGray UITableViewCellSelectionStyleNone UITableViewCellSeparatorStyleNone UITableViewCellSeparatorStyleSingleLine UITableViewCellStateDefaultMask UITableViewCellStateShowingDeleteConfirmationMask UITableViewCellStateShowingEditControlMask UITableViewCellStyleDefault UITableViewCellStyleSubtitle UITableViewCellStyleValue1 UITableViewCellStyleValue2 UITableViewRowAnimationBottom UITableViewRowAnimationFade UITableViewRowAnimationLeft UITableViewRowAnimationNone UITableViewRowAnimationRight UITableViewRowAnimationTop UITableViewScrollPositionBottom UITableViewScrollPositionMiddle UITableViewScrollPositionNone UITableViewScrollPositionTop UITableViewStyleGrouped UITableViewStylePlain UITextAlignmentCenter UITextAlignmentLeft UITextAlignmentRight UITextAutocapitalizationTypeAllCharacters UITextAutocapitalizationTypeNone UITextAutocapitalizationTypeSentences UITextAutocapitalizationTypeWords UITextAutocorrectionTypeDefault UITextAutocorrectionTypeNo UITextAutocorrectionTypeYes UITextBorderStyleBezel UITextBorderStyleLine UITextBorderStyleNone UITextBorderStyleRoundedRect UITextFieldViewModeAlways UITextFieldViewModeNever UITextFieldViewModeUnlessEditing UITextFieldViewModeWhileEditing UITouchPhaseBegan UITouchPhaseCancelled UITouchPhaseEnded UITouchPhaseMoved UITouchPhaseStationary UIViewAnimationCurveEaseIn UIViewAnimationCurveEaseInOut UIViewAnimationCurveEaseOut UIViewAnimationCurveLinear UIViewAnimationTransitionCurlDown UIViewAnimationTransitionCurlUp UIViewAnimationTransitionFlipFromLeft UIViewAnimationTransitionFlipFromRight UIViewAnimationTransitionNone UIViewAutoresizingFlexibleBottomMargin UIViewAutoresizingFlexibleHeight UIViewAutoresizingFlexibleLeftMargin UIViewAutoresizingFlexibleRightMargin UIViewAutoresizingFlexibleTopMargin UIViewAutoresizingFlexibleWidth UIViewAutoresizingNone UIViewContentModeBottom UIViewContentModeBottomLeft UIViewContentModeBottomRight UIViewContentModeCenter UIViewContentModeLeft UIViewContentModeRedraw UIViewContentModeRight UIViewContentModeScaleAspectFill UIViewContentModeScaleAspectFit UIViewContentModeScaleToFill UIViewContentModeTop UIViewContentModeTopLeft UIViewContentModeTopRight UIWebViewNavigationTypeBackForward UIWebViewNavigationTypeFormResubmitted UIWebViewNavigationTypeFormSubmitted UIWebViewNavigationTypeLinkClicked UIWebViewNavigationTypeOther UIWebViewNavigationTypeReload - -" Cocoa Notifications -syn keyword cocoaNotification containedin=objcMessage NSAntialiasThresholdChangedNotification NSAppleEventManagerWillProcessFirstEventNotification NSApplicationDidBecomeActiveNotification NSApplicationDidChangeScreenParametersNotification NSApplicationDidFinishLaunchingNotification NSApplicationDidHideNotification NSApplicationDidResignActiveNotification NSApplicationDidUnhideNotification NSApplicationDidUpdateNotification NSApplicationWillBecomeActiveNotification NSApplicationWillFinishLaunchingNotification NSApplicationWillHideNotification NSApplicationWillResignActiveNotification NSApplicationWillTerminateNotification NSApplicationWillUnhideNotification NSApplicationWillUpdateNotification NSClassDescriptionNeededForClassNotification NSColorListDidChangeNotification NSColorPanelColorDidChangeNotification NSComboBoxSelectionDidChangeNotification NSComboBoxSelectionIsChangingNotification NSComboBoxWillDismissNotification NSComboBoxWillPopUpNotification NSContextHelpModeDidActivateNotification NSContextHelpModeDidDeactivateNotification NSControlTextDidBeginEditingNotification NSControlTextDidChangeNotification NSControlTextDidEndEditingNotification NSControlTintDidChangeNotification NSDrawerDidCloseNotification NSDrawerDidOpenNotification NSDrawerWillCloseNotification NSDrawerWillOpenNotification NSFontSetChangedNotification NSImageRepRegistryDidChangeNotification NSMenuDidAddItemNotification NSMenuDidBeginTrackingNotification NSMenuDidChangeItemNotification NSMenuDidEndTrackingNotification NSMenuDidRemoveItemNotification NSMenuDidSendActionNotification NSMenuWillSendActionNotification NSOutlineViewColumnDidMoveNotification NSOutlineViewColumnDidResizeNotification NSOutlineViewItemDidCollapseNotification NSOutlineViewItemDidExpandNotification NSOutlineViewItemWillCollapseNotification NSOutlineViewItemWillExpandNotification NSOutlineViewSelectionDidChangeNotification NSOutlineViewSelectionIsChangingNotification NSPopUpButtonCellWillPopUpNotification NSPopUpButtonWillPopUpNotification NSPreferencePaneCancelUnselectNotification NSPreferencePaneDoUnselectNotification NSSplitViewDidResizeSubviewsNotification NSSplitViewWillResizeSubviewsNotification NSSystemColorsDidChangeNotification NSTableViewColumnDidMoveNotification NSTableViewColumnDidResizeNotification NSTableViewSelectionDidChangeNotification NSTableViewSelectionIsChangingNotification NSTextDidBeginEditingNotification NSTextDidChangeNotification NSTextDidEndEditingNotification NSTextStorageDidProcessEditingNotification NSTextStorageWillProcessEditingNotification NSTextViewDidChangeSelectionNotification NSTextViewDidChangeTypingAttributesNotification NSTextViewWillChangeNotifyingTextViewNotification NSToolbarDidRemoveItemNotification NSToolbarWillAddItemNotification NSViewBoundsDidChangeNotification NSViewDidUpdateTrackingAreasNotification NSViewFocusDidChangeNotification NSViewFrameDidChangeNotification NSViewGlobalFrameDidChangeNotification NSWindowDidBecomeKeyNotification NSWindowDidBecomeMainNotification NSWindowDidChangeScreenNotification NSWindowDidChangeScreenProfileNotification NSWindowDidDeminiaturizeNotification NSWindowDidEndSheetNotification NSWindowDidExposeNotification NSWindowDidMiniaturizeNotification NSWindowDidMoveNotification NSWindowDidResignKeyNotification NSWindowDidResignMainNotification NSWindowDidResizeNotification NSWindowDidUpdateNotification NSWindowWillBeginSheetNotification NSWindowWillCloseNotification NSWindowWillMiniaturizeNotification NSWindowWillMoveNotification NSWorkspaceDidLaunchApplicationNotification NSWorkspaceDidMountNotification NSWorkspaceDidPerformFileOperationNotification NSWorkspaceDidTerminateApplicationNotification NSWorkspaceDidUnmountNotification NSWorkspaceDidWakeNotification NSWorkspaceSessionDidBecomeActiveNotification NSWorkspaceSessionDidResignActiveNotification NSWorkspaceWillLaunchApplicationNotification NSWorkspaceWillPowerOffNotification NSWorkspaceWillSleepNotification NSWorkspaceWillUnmountNotification - -hi link cocoaFunction Keyword -hi link cocoaClass Special -hi link cocoaProtocol cocoaClass -hi link cocoaType Type -hi link cocoaConstant Constant -hi link cocoaNotification Constant \ No newline at end of file diff --git a/.vim/after/syntax/objc_enhanced.vim b/.vim/after/syntax/objc_enhanced.vim deleted file mode 100644 index 6883171..0000000 --- a/.vim/after/syntax/objc_enhanced.vim +++ /dev/null @@ -1,59 +0,0 @@ -" Author: Michael Sanders (msanders42 [at] gmail [dot] com) -" Description: Better syntax highlighting for Objective-C files (part of the -" cocoa.vim plugin). -" Last Updated: June 23, 2009 - -" NOTE: This next file (cocoa_keywords.vim) is rather large and may slow -" things down. Loading it seems to take less than 0.5 microseconds -" on my machine, but I'm not sure of the consequences; if it is slow -" for you, just comment out the next line. -ru after/syntax/cocoa_keywords.vim - -syn match objcDirective '@synthesize\|@property' display -syn keyword objcType IBOutlet IBAction Method -syn keyword objcConstant YES NO TRUE FALSE - -syn region objcImp start='@implementation' end='@end' transparent -syn region objcHeader start='@interface' end='@end' transparent - -" I make this typo sometimes so it's nice to have it highlighted. -syn match objcError '\v(NSLogv=\(\s*)@<=[^@]=["'].*'me=e-1 - -syn match objcSubclass '\(@implementation\|@interface\)\@<=\s*\k\+' display contained containedin=objcImp,objcHeader -syn match objcSuperclass '\(@\(implementation\|interface\)\s*\k\+\s*:\)\@<=\s*\k*' display contained containedin=objcImp,objcHeader - -" Matches "- (void) foo: (int) bar and: (float) foobar" -syn match objcMethod '^\s*[-+]\s*\_.\{-}[\{;]'me=e-1 transparent contains=cParen,objcInstMethod,objcFactMethod -" Matches "bar & foobar" in above -syn match objcMethodArg ')\@<=\s*\k\+' contained containedin=objcMethod -" Matches "foo:" & "and:" in above -syn match objcMethodName '\(^\s*[-+]\s*(\_[^)]*)\)\@<=\_\s*\_\k\+' contained containedin=objcMethod -syn match objcMethodColon '\k\+\s*:' contained containedin=objcMethod -" Don't match these groups in cParen "(...)" -syn cluster cParenGroup add=objcMethodName,objcMethodArg,objcMethodColon -" This fixes a bug with completion inside parens (e.g. if ([NSString ])) -syn cluster cParenGroup remove=objcMessage - -" Matches "bar" in "[NSObject bar]" or "bar" in "[[NSObject foo: baz] bar]", -" but NOT "bar" in "[NSObject foo: bar]". -syn match objcMessageName '\(\[\s*\k\+\s\+\|\]\s*\)\@<=\k*\s*\]'me=e-1 display contained containedin=objcMessage -" Matches "foo:" in "[NSObject foo: bar]" or "[[NSObject new] foo: bar]" -syn match objcMessageColon '\(\_\S\+\_\s\+\)\@<=\k\+\s*:' display contained containedin=objcMessage - -" Don't match these in this strange group for edge cases... -syn cluster cMultiGroup add=objcMessageColon,objcMessageName,objcMethodName,objcMethodArg,objcMethodColon - -" You may want to customize this one. I couldn't find a default group to suit -" it, but you can modify your colorscheme to make this a different color. -hi link objcMethodName Special -hi link objcMethodColon objcMethodName - -hi link objcMethodArg Identifier - -hi link objcMessageName objcMethodArg -hi link objcMessageColon objcMessageName - -hi link objcSubclass objcMethodName -hi link objcSuperclass String - -hi link objcError Error diff --git a/.vim/autoload/airline/themes/barak.vim b/.vim/autoload/airline/themes/barak.vim deleted file mode 100644 index 056fc45..0000000 --- a/.vim/autoload/airline/themes/barak.vim +++ /dev/null @@ -1,61 +0,0 @@ -" vim-airline companion theme of Ubaryd -" (https://github.com/Donearm/Ubaryd) - -" Normal mode -let s:N1 = [ '#141413' , '#b3b3b3' , 232 , 252 ] " blackestgravel & bleaksand -let s:N2 = [ '#b3b3b3' , '#414141' , 252, 238 ] " bleaksand & deepgravel -let s:N3 = [ '#e0e0e0' , '#363636' , 254, 237 ] " toffee & darkgravel -let s:N4 = [ '#363946' , 237 ] " gravel - -" Insert mode -let s:I1 = [ '#1a1a18' , '#fade3e' , 232 , 221 ] " blackestgravel & warmcorn -let s:I2 = [ '#c7b386' , '#45413b' , 252 , 238 ] " bleaksand & deepgravel -let s:I3 = [ '#f4cf86' , '#242321' , 222 , 235 ] " lighttannedskin & darkgravel - -" Visual mode -let s:V1 = [ '#1c1b1a' , '#9a4820' , 233 , 88 ] " blackgravel & warmadobe -let s:V2 = [ '#000000' , '#88633f' , 16 , 95 ] " coal & cappuccino -let s:V3 = [ '#88633f' , '#c7b386' , 95 , 252 ] " cappuccino & bleaksand -let s:V4 = [ '#c14c3d' , 160 ] " tannedumbrella - -" Replace mode -let s:RE = [ '#c7915b' , 173 ] " nut - -" Paste mode -let s:PA = [ '#f9ef6d' , 154 ] " bleaklemon - -let s:file = [ '#ff7400' , '' , 196 , '' , '' ] -let s:IA = [ '#767986', '#363946', 244, 237, '' ] - -let g:airline#themes#barak#palette = {} -let g:airline#themes#barak#palette.inactive = { - \ 'airline_a' : [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ] } - -let g:airline#themes#barak#palette.accents = { - \ 'red': [ '#ff7400' , '' , 196 , '' , '' ], - \ } - -let g:airline#themes#barak#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) -let g:airline#themes#barak#palette.normal_modified = { - \ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] , - \ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] } - - -let g:airline#themes#barak#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) -let g:airline#themes#barak#palette.insert_modified = { - \ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] } -let g:airline#themes#barak#palette.insert_paste = { - \ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] } - - -let g:airline#themes#barak#palette.replace = copy(airline#themes#barak#palette.insert) -let g:airline#themes#barak#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ] -let g:airline#themes#barak#palette.replace_modified = g:airline#themes#barak#palette.insert_modified - - -let g:airline#themes#barak#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) -let g:airline#themes#barak#palette.visual_modified = { - \ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] } - -let g:airline#themes#barak#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) - diff --git a/.vim/autoload/genutils.vim b/.vim/autoload/genutils.vim deleted file mode 100755 index c28a25c..0000000 --- a/.vim/autoload/genutils.vim +++ /dev/null @@ -1,1954 +0,0 @@ -" genutils.vim: Please see plugin/genutils.vim -" -" TODO: -" - Vim7: redir can be used with a variable. -" - fnamemodify() on Unix doesn't expand to full name if the filename doesn't -" really exist on the filesystem. -" - Is setting 'scrolloff' and 'sidescrolloff' to 0 required while moving the -" cursor? -" - http://www.vim.org/tips/tip.php?tip_id=1379 -" -" - EscapeCommand() didn't work for David Fishburn. -" - Save/RestoreWindowSettings doesn't work well. -" -" Vim7: -" - Save/RestoreWindowSettings can use winsave/restview() functions. -" - -" Make sure line-continuations won't cause any problem. This will be restored -" at the end -let s:save_cpo = &cpo -set cpo&vim - - -let g:makeArgumentString = 'exec genutils#MakeArgumentString()' -let g:makeArgumentList = 'exec genutils#MakeArgumentList()' - -let s:makeArgumentString = '' -function! genutils#MakeArgumentString(...) - if s:makeArgumentString == '' - let s:makeArgumentString = genutils#ExtractFuncListing(s:SNR(). - \ '_makeArgumentString', 0, 0) - endif - if a:0 > 0 && a:1 != '' - return substitute(s:makeArgumentString, '\<argumentString\>', a:1, 'g') - else - return s:makeArgumentString - endif -endfunction - - -let s:makeArgumentList = '' -function! genutils#MakeArgumentList(...) - if s:makeArgumentList == '' - let s:makeArgumentList = genutils#ExtractFuncListing(s:SNR(). - \ '_makeArgumentList', 0, 0) - endif - if a:0 > 0 && a:1 != '' - let mkArgLst = substitute(s:makeArgumentList, '\<argumentList\>', a:1, 'g') - if a:0 > 1 && a:2 != '' - let mkArgLst = substitute(s:makeArgumentList, - \ '\(\s\+let __argSeparator = \)[^'."\n".']*', "\\1'".a:2."'", '') - endif - return mkArgLst - else - return s:makeArgumentList - endif -endfunction - -function! genutils#ExtractFuncListing(funcName, hLines, tLines) - let listing = genutils#GetVimCmdOutput('func '.a:funcName) - let listing = substitute(listing, - \ '^\%(\s\|'."\n".'\)*function '.a:funcName.'([^)]*)'."\n", '', '') - "let listing = substitute(listing, '\%(\s\|'."\n".'\)*endfunction\%(\s\|'."\n".'\)*$', '', '') - " Leave the last newline character. - let listing = substitute(listing, '\%('."\n".'\)\@<=\s*endfunction\s*$', '', '') - let listing = substitute(listing, '\(\%(^\|'."\n".'\)\s*\)\@<=\d\+', - \ '', 'g') - if a:hLines > 0 - let listing = substitute(listing, '^\%([^'."\n".']*'."\n".'\)\{'. - \ a:hLines.'}', '', '') - endif - if a:tLines > 0 - let listing = substitute(listing, '\%([^'."\n".']*'."\n".'\)\{'. - \ a:tLines.'}$', '', '') - endif - return listing -endfunction - -function! genutils#CreateArgString(argList, sep, ...) - let sep = (a:0 == 0) ? a:sep : a:1 " This is no longer used. - " Matching multvals functionality means, we need to ignore the trailing - " separator. - let argList = split(substitute(a:argList, a:sep.'$', '', ''), a:sep, 1) - let argString = "'" - for nextArg in argList - " FIXME: I think this check is not required. If "'" is the separator, we - " don't expect to see them in the elements. - if a:sep != "'" - let nextArg = substitute(nextArg, "'", "' . \"'\" . '", 'g') - endif - let argString = argString . nextArg . "', '" - endfor - let argString = strpart(argString, 0, strlen(argString) - 3) - return argString -endfunction - -" {{{ -function! s:_makeArgumentString() - let __argCounter = 1 - let argumentString = '' - while __argCounter <= a:0 - if type(a:{__argCounter}) - let __nextArg = "'" . - \ substitute(a:{__argCounter}, "'", "' . \"'\" . '", "g") . "'" - else - let __nextArg = a:{__argCounter} - endif - let argumentString = argumentString. __nextArg . - \ ((__argCounter == a:0) ? '' : ', ') - let __argCounter = __argCounter + 1 - endwhile - unlet __argCounter - if exists('__nextArg') - unlet __nextArg - endif -endfunction - -function! s:_makeArgumentList() - let __argCounter = 1 - let __argSeparator = ',' - let argumentList = '' - while __argCounter <= a:0 - let argumentList = argumentList . a:{__argCounter} - if __argCounter != a:0 - let argumentList = argumentList . __argSeparator - endif - let __argCounter = __argCounter + 1 - endwhile - unlet __argCounter - unlet __argSeparator -endfunction -" }}} - - -function! genutils#DebugShowArgs(...) - let i = 0 - let argString = '' - while i < a:0 - let argString = argString . a:{i + 1} . ', ' - let i = i + 1 - endwhile - let argString = strpart(argString, 0, strlen(argString) - 2) - call input("Args: " . argString) -endfunction - -" Window related functions {{{ - -function! genutils#NumberOfWindows() - let i = 1 - while winbufnr(i) != -1 - let i = i+1 - endwhile - return i - 1 -endfunction - -" Find the window number for the buffer passed. -" The fileName argument is treated literally, unlike the bufnr() which treats -" the argument as a regex pattern. -function! genutils#FindWindowForBuffer(bufferName, checkUnlisted) - return bufwinnr(genutils#FindBufferForName(a:bufferName)) -endfunction - -function! genutils#FindBufferForName(fileName) - " The name could be having extra backslashes to protect certain chars (such - " as '#' and '%'), so first expand them. - return s:FindBufferForName(genutils#UnEscape(a:fileName, '#%')) -endfunction - -function! s:FindBufferForName(fileName) - let fileName = genutils#Escape(a:fileName, '[?,{') - let _isf = &isfname - try - set isfname-=\ - set isfname-=[ - let i = bufnr('^' . fileName . '$') - finally - let &isfname = _isf - endtry - return i -endfunction - -function! genutils#GetBufNameForAu(bufName) - let bufName = a:bufName - " Autocommands always require forward-slashes. - let bufName = substitute(bufName, "\\\\", '/', 'g') - let bufName = escape(bufName, '*?,{}[ ') - return bufName -endfunction - -function! genutils#MoveCursorToWindow(winno) - if genutils#NumberOfWindows() != 1 - execute a:winno . " wincmd w" - endif -endfunction - -function! genutils#MoveCurLineToWinLine(n) - normal! zt - if a:n == 1 - return - endif - let _wrap = &l:wrap - setl nowrap - let n = a:n - if n >= winheight(0) - let n = winheight(0) - endif - let n = n - 1 - execute "normal! " . n . "\<C-Y>" - let &l:wrap = _wrap -endfunction - -function! genutils#CloseWindow(win, force) - let _eventignore = &eventignore - try - set eventignore=all - call genutils#MarkActiveWindow() - - let &eventignore = _eventignore - exec a:win 'wincmd w' - exec 'close'.(a:force ? '!' : '') - set eventignore=all - - if a:win < t:curWinnr - let t:curWinnr = t:curWinnr - 1 - endif - if a:win < t:prevWinnr - let t:prevWinnr = t:prevWinnr - 1 - endif - finally - call genutils#RestoreActiveWindow() - let &eventignore = _eventignore - endtry -endfunction - -function! genutils#MarkActiveWindow() - let t:curWinnr = winnr() - " We need to restore the previous-window also at the end. - silent! wincmd p - let t:prevWinnr = winnr() - silent! wincmd p -endfunction - -function! genutils#RestoreActiveWindow() - if !exists('t:curWinnr') - return - endif - - " Restore the original window. - if winnr() != t:curWinnr - exec t:curWinnr'wincmd w' - endif - if t:curWinnr != t:prevWinnr - exec t:prevWinnr'wincmd w' - wincmd p - endif -endfunction - -function! genutils#IsOnlyVerticalWindow() - let onlyVertWin = 1 - let _eventignore = &eventignore - - try - "set eventignore+=WinEnter,WinLeave - set eventignore=all - call genutils#MarkActiveWindow() - - wincmd j - if winnr() != t:curWinnr - let onlyVertWin = 0 - else - wincmd k - if winnr() != t:curWinnr - let onlyVertWin = 0 - endif - endif - finally - call genutils#RestoreActiveWindow() - let &eventignore = _eventignore - endtry - return onlyVertWin -endfunction - -function! genutils#IsOnlyHorizontalWindow() - let onlyHorizWin = 1 - let _eventignore = &eventignore - try - set eventignore=all - call genutils#MarkActiveWindow() - wincmd l - if winnr() != t:curWinnr - let onlyHorizWin = 0 - else - wincmd h - if winnr() != t:curWinnr - let onlyHorizWin = 0 - endif - endif - finally - call genutils#RestoreActiveWindow() - let &eventignore = _eventignore - endtry - return onlyHorizWin -endfunction - -function! genutils#MoveCursorToNextInWinStack(dir) - let newwin = genutils#GetNextWinnrInStack(a:dir) - if newwin != 0 - exec newwin 'wincmd w' - endif -endfunction - -function! genutils#GetNextWinnrInStack(dir) - let newwin = winnr() - let _eventignore = &eventignore - try - set eventignore=all - call genutils#MarkActiveWindow() - let newwin = s:GetNextWinnrInStack(a:dir) - finally - call genutils#RestoreActiveWindow() - let &eventignore = _eventignore - endtry - return newwin -endfunction - -function! genutils#MoveCursorToLastInWinStack(dir) - let newwin = genutils#GetLastWinnrInStack(a:dir) - if newwin != 0 - exec newwin 'wincmd w' - endif -endfunction - -function! genutils#GetLastWinnrInStack(dir) - let newwin = winnr() - let _eventignore = &eventignore - try - set eventignore=all - call genutils#MarkActiveWindow() - while 1 - let wn = s:GetNextWinnrInStack(a:dir) - if wn != 0 - let newwin = wn - exec newwin 'wincmd w' - else - break - endif - endwhile - finally - call genutils#RestoreActiveWindow() - let &eventignore = _eventignore - endtry - return newwin -endfunction - -" Based on the WinStackMv() function posted by Charles E. Campbell, Jr. on vim -" mailing list on Jul 14, 2004. -function! s:GetNextWinnrInStack(dir) - "call Decho("genutils#MoveCursorToNextInWinStack(dir<".a:dir.">)") - - let isHorizontalMov = (a:dir ==# 'h' || a:dir ==# 'l') ? 1 : 0 - - let orgwin = winnr() - let orgdim = s:GetWinDim(a:dir, orgwin) - - let _winwidth = &winwidth - let _winheight = &winheight - try - set winwidth=1 - set winheight=1 - exec 'wincmd' a:dir - let newwin = winnr() - if orgwin == newwin - " No more windows in this direction. - "call Decho("newwin=".newwin." stopped".winheight(newwin)."x".winwidth(newwin)) - return 0 - endif - if s:GetWinDim(a:dir, newwin) != orgdim - " Window dimension has changed, indicates a move across window stacks. - "call Decho("newwin=".newwin." height changed".winheight(newwin)."x".winwidth(newwin)) - return 0 - endif - " Determine if changing original window height affects current window - " height. - exec orgwin 'wincmd w' - try - if orgdim == 1 - exec 'wincmd' (isHorizontalMov ? '_' : '|') - else - exec 'wincmd' (isHorizontalMov ? '-' : '<') - endif - if s:GetWinDim(a:dir, newwin) != s:GetWinDim(a:dir, orgwin) - "call Decho("newwin=".newwin." different row".winheight(newwin)."x".winwidth(newwin)) - return 0 - endif - "call Decho("newwin=".newwin." same row".winheight(newwin)."x".winwidth(newwin)) - finally - exec (isHorizontalMov ? '' : 'vert') 'resize' orgdim - endtry - - "call Decho("genutils#MoveCursorToNextInWinStack") - - return newwin - finally - let &winwidth = _winwidth - let &winheight = _winheight - endtry -endfunction - -function! s:GetWinDim(dir, win) - return (a:dir ==# 'h' || a:dir ==# 'l') ? winheight(a:win) : winwidth(a:win) -endfunction - -function! genutils#OpenWinNoEa(winOpenCmd) - call s:ExecWinCmdNoEa(a:winOpenCmd) -endfunction - -function! genutils#CloseWinNoEa(winnr, force) - call s:ExecWinCmdNoEa(a:winnr.'wincmd w | close'.(a:force?'!':'')) -endfunction - -function! s:ExecWinCmdNoEa(winCmd) - let _eventignore = &eventignore - try - set eventignore=all - call genutils#MarkActiveWindow() - windo let w:_winfixheight = &winfixheight - windo set winfixheight - call genutils#RestoreActiveWindow() - - let &eventignore = _eventignore - exec a:winCmd - set eventignore=all - - call genutils#MarkActiveWindow() - silent! windo let &winfixheight = w:_winfixheight - silent! windo unlet w:_winfixheight - call genutils#RestoreActiveWindow() - finally - let &eventignore = _eventignore - endtry -endfunction - -" Window related functions }}} - -function! genutils#SetupScratchBuffer() - setlocal nobuflisted - setlocal noswapfile - setlocal buftype=nofile - " Just in case, this will make sure we are always hidden. - setlocal bufhidden=delete - setlocal nolist - setlocal nonumber - setlocal foldcolumn=0 nofoldenable - setlocal noreadonly -endfunction - -function! genutils#CleanDiffOptions() - setlocal nodiff - setlocal noscrollbind - setlocal scrollopt-=hor - setlocal wrap - setlocal foldmethod=manual - setlocal foldcolumn=0 - normal zE -endfunction - -function! genutils#ArrayVarExists(varName, index) - try - exec "let test = " . a:varName . "{a:index}" - catch /^Vim\%((\a\+)\)\=:E121/ - return 0 - endtry - return 1 -endfunction - -function! genutils#Escape(str, chars) - return substitute(a:str, '\\\@<!\(\%(\\\\\)*\)\([' . a:chars .']\)', '\1\\\2', - \ 'g') -endfunction - -function! genutils#UnEscape(str, chars) - return substitute(a:str, '\\\@<!\(\\\\\)*\\\([' . a:chars . ']\)', - \ '\1\2', 'g') -endfunction - -function! genutils#DeEscape(str) - let str = a:str - let str = substitute(str, '\\\(\\\|[^\\]\)', '\1', 'g') - return str -endfunction - -" - For windoze+native, use double-quotes to sorround the arguments and for -" embedded double-quotes, just double them. -" - For windoze+sh, use single-quotes to sorround the aruments and for embedded -" single-quotes, just replace them with '""'""' (if 'shq' or 'sxq' is a -" double-quote) and just '"'"' otherwise. Embedded double-quotes also need -" to be doubled. -" - For Unix+sh, use single-quotes to sorround the arguments and for embedded -" single-quotes, just replace them with '"'"'. -function! genutils#EscapeCommand(cmd, args, pipe) - if type(a:args) == 3 - let args = copy(a:args) - else - let args = split(a:args, genutils#CrUnProtectedCharsPattern(' ')) - endif - " I am only worried about passing arguments with spaces as they are to the - " external commands, I currently don't care about back-slashes - " (backslashes are normally expected only on windows when 'shellslash' - " option is set, but even then the 'shell' is expected to take care of - " them.). However, for cygwin bash, there is a loss of one level - " of the back-slashes somewhere in the chain of execution (most probably - " between CreateProcess() and cygwin?), so we need to double them. - let shellEnvType = genutils#GetShellEnvType() - if shellEnvType ==# g:ST_WIN_CMD - let quoteChar = '"' - " genutils#Escape the existing double-quotes (by doubling them). - call map(args, "substitute(v:val, '\"', '\"\"', 'g')") - else - let quoteChar = "'" - if shellEnvType ==# g:ST_WIN_SH - " genutils#Escape the existing double-quotes (by doubling them). - call map(args, "substitute(v:val, '\"', '\"\"', 'g')") - endif - " Take care of existing single-quotes (by exposing them, as you can't have - " single-quotes inside a single-quoted string). - if &shellquote == '"' || &shellxquote == '"' - let squoteRepl = "'\"\"'\"\"'" - else - let squoteRepl = "'\"'\"'" - endif - call map(args, "substitute(v:val, \"'\", squoteRepl, 'g')") - endif - - " Now sorround the arguments with quotes, considering the protected - " spaces. Skip the && or || construct from doing this. - call map(args, 'v:val=~"^[&|]\\{2}$"?(v:val):(quoteChar.v:val.quoteChar)') - let fullCmd = join(args, ' ') - " We delay adding pipe part so that we can avoid the above processing. - let pipe = '' - if type(a:pipe) == 3 && len(a:pipe) > 0 - let pipe = join(a:pipe, ' ') - elseif type(a:pipe) == 1 && a:pipe !~# '^\s*$' - let pipe = a:pipe - endif - if pipe != '' - let fullCmd = fullCmd . ' ' . a:pipe - endif - if a:cmd !~# '^\s*$' - let fullCmd = a:cmd . ' ' . fullCmd - endif - if shellEnvType ==# g:ST_WIN_SH && &shell =~# '\<bash\>' - let fullCmd = substitute(fullCmd, '\\', '\\\\', 'g') - endif - return fullCmd -endfunction - -let g:ST_WIN_CMD = 0 | let g:ST_WIN_SH = 1 | let g:ST_UNIX = 2 -function! genutils#GetShellEnvType() - " When 'shellslash' option is available, then the platform must be one of - " those that support '\' as a pathsep. - if exists('+shellslash') - if stridx(&shell, 'cmd.exe') != -1 || - \ stridx(&shell, 'command.com') != -1 - return g:ST_WIN_CMD - else - return g:ST_WIN_SH - endif - else - return g:ST_UNIX - endif -endfunction - -function! genutils#ExpandStr(str) - let str = substitute(a:str, '"', '\\"', 'g') - exec "let str = \"" . str . "\"" - return str -endfunction - -function! genutils#QuoteStr(str) - return "'".substitute(a:str, "'", "'.\"'\".'", 'g')."'" -endfunction - -function! genutils#GetPreviewWinnr() - let _eventignore = &eventignore - let curWinNr = winnr() - let winnr = -1 - try - set eventignore=all - exec "wincmd P" - let winnr = winnr() - catch /^Vim\%((\a\+)\)\=:E441/ - " Ignore, winnr is already set to -1. - finally - if winnr() != curWinNr - exec curWinNr.'wincmd w' - endif - let &eventignore = _eventignore - endtry - return winnr -endfunction - -" Save/Restore window settings {{{ -function! genutils#SaveWindowSettings() - call genutils#SaveWindowSettings2('SaveWindowSettings', 1) -endfunction - -function! genutils#RestoreWindowSettings() - call genutils#RestoreWindowSettings2('SaveWindowSettings') -endfunction - - -function! genutils#ResetWindowSettings() - call genutils#ResetWindowSettings2('SaveWindowSettings') -endfunction - -function! genutils#SaveWindowSettings2(id, overwrite) - if genutils#ArrayVarExists("t:winSettings", a:id) && ! a:overwrite - return - endif - - let t:winSettings{a:id} = [] - call add(t:winSettings{a:id}, genutils#NumberOfWindows()) - call add(t:winSettings{a:id}, &lines) - call add(t:winSettings{a:id}, &columns) - call add(t:winSettings{a:id}, winnr()) - let i = 1 - while winbufnr(i) != -1 - call add(t:winSettings{a:id}, winheight(i)) - call add(t:winSettings{a:id}, winwidth(i)) - let i = i + 1 - endwhile - "let g:savedWindowSettings = t:winSettings{a:id} " Debug. -endfunction - -function! genutils#RestoreWindowSettings2(id) - " Calling twice fixes most of the resizing issues. This seems to be how the - " :mksession with "winsize" in 'sesionoptions' seems to work. - call s:RestoreWindowSettings2(a:id) - call s:RestoreWindowSettings2(a:id) -endfunction - -function! s:RestoreWindowSettings2(id) - "if ! exists("t:winSettings" . a:id) - if ! genutils#ArrayVarExists("t:winSettings", a:id) - return - endif - - let nWindows = t:winSettings{a:id}[0] - if nWindows != genutils#NumberOfWindows() - unlet t:winSettings{a:id} - return - endif - let orgLines = t:winSettings{a:id}[1] - let orgCols = t:winSettings{a:id}[2] - let activeWindow = t:winSettings{a:id}[3] - let mainWinSizeSame = (orgLines == &lines && orgCols == &columns) - - let winNo = 1 - let i = 4 - while i < len(t:winSettings{a:id}) - let height = t:winSettings{a:id}[i] - let width = t:winSettings{a:id}[i+1] - let height = (mainWinSizeSame ? height : - \ ((&lines * height + (orgLines / 2)) / orgLines)) - let width = (mainWinSizeSame ? width : - \ ((&columns * width + (orgCols / 2)) / orgCols)) - if winheight(winnr()) != height - exec winNo'resize' height - endif - if winwidth(winnr()) != width - exec 'vert' winNo 'resize' width - endif - let winNo = winNo + 1 - let i = i + 2 - endwhile - - " Restore the current window. - call genutils#MoveCursorToWindow(activeWindow) - "unlet g:savedWindowSettings -endfunction - - -function! genutils#ResetWindowSettings2(id) - if genutils#ArrayVarExists("t:winSettings", a:id) - unlet t:winSettings{a:id} - endif -endfunction - -" Save/Restore window settings }}} - -" Save/Restore selection {{{ - -function! genutils#SaveVisualSelection(id) - let curmode = mode() - if curmode == 'n' - normal! gv - endif - let s:vismode{a:id} = mode() - let s:firstline{a:id} = line("'<") - let s:lastline{a:id} = line("'>") - let s:firstcol{a:id} = col("'<") - let s:lastcol{a:id} = col("'>") - if curmode !=# s:vismode{a:id} - exec "normal \<Esc>" - endif -endfunction - -function! genutils#RestoreVisualSelection(id) - if mode() !=# 'n' - exec "normal \<Esc>" - endif - if exists('s:vismode{id}') - exec 'normal' s:firstline{a:id}.'gg'.s:firstcol{a:id}.'|'. - \ s:vismode{a:id}.(s:lastline{a:id}-s:firstline{a:id}).'j'. - \ (s:lastcol{a:id}-s:firstcol{a:id}).'l' - endif -endfunction -" Save/Restore selection }}} - -function! genutils#CleanupFileName(fileName) - return genutils#CleanupFileName2(a:fileName, '') -endfunction - -function! genutils#CleanupFileName2(fileName, win32ProtectedChars) - let fileName = substitute(a:fileName, '^\s\+\|\s\+$', '', 'g') - - " Expand relative paths and paths containing relative components (takes care - " of ~ also). - if ! genutils#PathIsAbsolute(fileName) - let fileName = fnamemodify(fileName, ':p') - endif - - " I think we can have UNC paths on UNIX, if samba is installed. - if genutils#OnMS() && (match(fileName, '^//') == 0 || - \ match(fileName, '^\\\\') == 0) - let uncPath = 1 - else - let uncPath = 0 - endif - - " Remove multiple path separators. - if has('win32') - if a:win32ProtectedChars != '' - let fileName=substitute(fileName, '\\['.a:win32ProtectedChars.']\@!', '/', - \ 'g') - else - let fileName=substitute(fileName, '\\', '/', 'g') - endif - elseif genutils#OnMS() - " On non-win32 systems, the forward-slash is not supported, so leave - " back-slash. - let fileName=substitute(fileName, '\\\{2,}', '\', 'g') - endif - let fileName=substitute(fileName, '/\{2,}', '/', 'g') - - " Remove ending extra path separators. - let fileName=substitute(fileName, '/$', '', '') - let fileName=substitute(fileName, '\\$', '', '') - - " If it was an UNC path, add back an extra slash. - if uncPath - let fileName = '/'.fileName - endif - - if genutils#OnMS() - let fileName=substitute(fileName, '^[A-Z]:', '\L&', '') - - " Add drive letter if missing (just in case). - if !uncPath && match(fileName, '^/') == 0 - let curDrive = substitute(getcwd(), '^\([a-zA-Z]:\).*$', '\L\1', '') - let fileName = curDrive . fileName - endif - endif - return fileName -endfunction -"echo genutils#CleanupFileName('\\a///b/c\') -"echo genutils#CleanupFileName('C:\a/b/c\d') -"echo genutils#CleanupFileName('a/b/c\d') -"echo genutils#CleanupFileName('~/a/b/c\d') -"echo genutils#CleanupFileName('~/a/b/../c\d') - -function! genutils#OnMS() - return has('win32') || has('dos32') || has('win16') || has('dos16') || - \ has('win95') -endfunction - -function! genutils#PathIsAbsolute(path) - let absolute=0 - if has('unix') || genutils#OnMS() - if match(a:path, '^/') == 0 - let absolute=1 - endif - endif - if (! absolute) && genutils#OnMS() - if match(a:path, "^\\") == 0 - let absolute=1 - endif - endif - if (! absolute) && genutils#OnMS() - if match(a:path, "^[A-Za-z]:") == 0 - let absolute=1 - endif - endif - return absolute -endfunction - -function! genutils#PathIsFileNameOnly(path) - return (match(a:path, "\\") < 0) && (match(a:path, "/") < 0) -endfunction - -let s:mySNR = '' -function! s:SNR() - if s:mySNR == '' - let s:mySNR = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeSNR$') - endif - return s:mySNR -endfun - - -"" --- START save/restore position. {{{ - -function! genutils#SaveSoftPosition(id) - let b:sp_startline_{a:id} = getline(".") - call genutils#SaveHardPosition(a:id) -endfunction - -function! genutils#RestoreSoftPosition(id) - 0 - call genutils#RestoreHardPosition(a:id) - let stLine = b:sp_startline_{a:id} - if getline('.') !=# stLine - if ! search('\V\^'.escape(stLine, "\\").'\$', 'W') - call search('\V\^'.escape(stLine, "\\").'\$', 'bW') - endif - endif - call genutils#MoveCurLineToWinLine(b:sp_winline_{a:id}) -endfunction - -function! genutils#ResetSoftPosition(id) - unlet b:sp_startline_{a:id} -endfunction - -" A synonym for genutils#SaveSoftPosition. -function! genutils#SaveHardPositionWithContext(id) - call genutils#SaveSoftPosition(a:id) -endfunction - -" A synonym for genutils#RestoreSoftPosition. -function! genutils#RestoreHardPositionWithContext(id) - call genutils#RestoreSoftPosition(a:id) -endfunction - -" A synonym for genutils#ResetSoftPosition. -function! genutils#ResetHardPositionWithContext(id) - call genutils#ResetSoftPosition(a:id) -endfunction - -function! genutils#SaveHardPosition(id) - let b:sp_col_{a:id} = virtcol(".") - let b:sp_lin_{a:id} = line(".") - " Avoid accounting for wrapped lines. - let _wrap = &l:wrap - try - setl nowrap - let b:sp_winline_{a:id} = winline() - finally - let &l:wrap = _wrap - endtry -endfunction - -function! genutils#RestoreHardPosition(id) - " This doesn't take virtual column. - "call cursor(b:sp_lin_{a:id}, b:sp_col_{a:id}) - " Vim7 generates E16 if line number is invalid. - " TODO: Why is this leaving cursor on the last-but-one line when the - " condition meets? - execute ((line('$') < b:sp_lin_{a:id}) ? line('$') : - \ b:sp_lin_{a:id}) - "execute b:sp_lin_{a:id} - execute ((line('$') < b:sp_lin_{a:id}) ? line('$') : - \ b:sp_lin_{a:id}) - "execute b:sp_lin_{a:id} - execute "normal!" b:sp_col_{a:id} . "|" - call genutils#MoveCurLineToWinLine(b:sp_winline_{a:id}) -endfunction - -function! genutils#ResetHardPosition(id) - unlet b:sp_col_{a:id} - unlet b:sp_lin_{a:id} - unlet b:sp_winline_{a:id} -endfunction - -function! genutils#GetLinePosition(id) - return b:sp_lin_{a:id} -endfunction - -function! genutils#GetColPosition(id) - return b:sp_col_{a:id} -endfunction - -function! genutils#IsPositionSet(id) - return exists('b:sp_col_' . a:id) -endfunction - -"" --- END save/restore position. }}} - - - -"" -"" --- START: Notify window close -- {{{ -"" - -let s:notifyWindow = {} -function! genutils#AddNotifyWindowClose(windowTitle, functionName) - let bufName = a:windowTitle - - let s:notifyWindow[bufName] = a:functionName - - "let g:notifyWindow = s:notifyWindow " Debug. - - " Start listening to events. - aug NotifyWindowClose - au! - au WinEnter * :call genutils#CheckWindowClose() - au BufEnter * :call genutils#CheckWindowClose() - aug END -endfunction - -function! genutils#RemoveNotifyWindowClose(windowTitle) - let bufName = a:windowTitle - - if has_key(s:notifyWindow, bufName) - call remove(s:notifyWindow, bufName) - if len(s:notifyWindow) == 0 - "unlet g:notifyWindow " Debug. - - aug NotifyWindowClose - au! - aug END - endif - endif -endfunction - -function! genutils#CheckWindowClose() - if !exists('s:notifyWindow') - return - endif - - " Now iterate over all the registered window titles and see which one's are - " closed. - for nextWin in keys(s:notifyWindow) - if bufwinnr(s:FindBufferForName(nextWin)) == -1 - let funcName = s:notifyWindow[nextWin] - " Remove this entry as these are going to be processed. The caller can add - " them back if needed. - unlet s:notifyWindow[nextWin] - "call input("cmd: " . cmd) - call call(funcName, [nextWin]) - endif - endfor -endfunction - -"function! NotifyWindowCloseF(title) -" call input(a:title . " closed") -"endfunction -" -"function! RunNotifyWindowCloseTest() -" call input("Creating three windows, 'ABC', 'XYZ' and 'b':") -" split ABC -" split X Y Z -" split b -" redraw -" call genutils#AddNotifyWindowClose("ABC", "NotifyWindowCloseF") -" call genutils#AddNotifyWindowClose("X Y Z", "NotifyWindowCloseF") -" call input("notifyWindow: " . string(s:notifyWindow)) -" au NotifyWindowClose WinEnter -" call input("Added notifications for 'ABC' and 'XYZ'\n". -" \ "Now closing the windows, you should see ONLY two notifications:") -" quit -" quit -" quit -"endfunction - -"" -"" --- END: Notify window close -- }}} -"" - -" TODO: For large ranges, the cmd can become too big, so make it one cmd per -" line. -function! genutils#ShowLinesWithSyntax() range - " This makes sure we start (subsequent) echo's on the first line in the - " command-line area. - " - echo '' - - let cmd = '' - let prev_group = ' x ' " Something that won't match any syntax group. - - let show_line = a:firstline - let isMultiLine = ((a:lastline - a:firstline) > 1) - while show_line <= a:lastline - let cmd = '' - let length = strlen(getline(show_line)) - let column = 1 - - while column <= length - let group = synIDattr(synID(show_line, column, 1), 'name') - if group != prev_group - if cmd != '' - let cmd = cmd . "'|" - endif - let cmd = cmd . 'echohl ' . (group == '' ? 'NONE' : group) . "|echon '" - let prev_group = group - endif - let char = strpart(getline(show_line), column - 1, 1) - if char == "'" - let char = "'."'".'" - endif - let cmd = cmd . char - let column = column + 1 - endwhile - - try - exec cmd."\n'" - catch - echo '' - endtry - let show_line = show_line + 1 - endwhile - echohl NONE -endfunction - - -function! genutils#AlignWordWithWordInPreviousLine() - "First go to the first col in the word. - if getline('.')[col('.') - 1] =~ '\s' - normal! w - else - normal! "_yiw - endif - let orgVcol = virtcol('.') - let prevLnum = prevnonblank(line('.') - 1) - if prevLnum == -1 - return - endif - let prevLine = getline(prevLnum) - - " First get the column to align with. - if prevLine[orgVcol - 1] =~ '\s' - " column starts from 1 where as index starts from 0. - let nonSpaceStrInd = orgVcol " column starts from 1 where as index starts from 0. - while prevLine[nonSpaceStrInd] =~ '\s' - let nonSpaceStrInd = nonSpaceStrInd + 1 - endwhile - else - if strlen(prevLine) < orgVcol - let nonSpaceStrInd = strlen(prevLine) - 1 - else - let nonSpaceStrInd = orgVcol - 1 - endif - - while prevLine[nonSpaceStrInd - 1] !~ '\s' && nonSpaceStrInd > 0 - let nonSpaceStrInd = nonSpaceStrInd - 1 - endwhile - endif - let newVcol = nonSpaceStrInd + 1 " Convert to column number. - - if orgVcol > newVcol " We need to reduce the spacing. - let sub = strpart(getline('.'), newVcol - 1, (orgVcol - newVcol)) - if sub =~ '^\s\+$' - " Remove the excess space. - exec 'normal! ' . newVcol . '|' - exec 'normal! ' . (orgVcol - newVcol) . 'x' - endif - elseif orgVcol < newVcol " We need to insert spacing. - exec 'normal! ' . orgVcol . '|' - exec 'normal! ' . (newVcol - orgVcol) . 'i ' - endif -endfunction - -function! genutils#ShiftWordInSpace(dir) - if a:dir == 1 " forward. - " If currently on <Space>... - if getline(".")[col(".") - 1] == " " - let move1 = 'wf ' - else - " If next col is a - "if getline(".")[col(".") + 1] - let move1 = 'f ' - endif - let removeCommand = "x" - let pasteCommand = "bi " - let move2 = 'w' - let offset = 0 - else " backward. - " If currently on <Space>... - if getline(".")[col(".") - 1] == " " - let move1 = 'w' - else - let move1 = '"_yiW' - endif - let removeCommand = "hx" - let pasteCommand = 'h"_yiwEa ' - let move2 = 'b' - let offset = -3 - endif - - let savedCol = col(".") - exec "normal!" move1 - let curCol = col(".") - let possible = 0 - " Check if there is a space at the end. - if col("$") == (curCol + 1) " Works only for forward case, as expected. - let possible = 1 - elseif getline(".")[curCol + offset] == " " - " Remove the space from here. - exec "normal!" removeCommand - let possible = 1 - endif - - " Move back into the word. - "exec "normal!" savedCol . "|" - if possible == 1 - exec "normal!" pasteCommand - exec "normal!" move2 - else - " Move to the original location. - exec "normal!" savedCol . "|" - endif -endfunction - - -function! genutils#CenterWordInSpace() - let line = getline('.') - let orgCol = col('.') - " If currently on <Space>... - if line[orgCol - 1] == " " - let matchExpr = ' *\%'. orgCol . 'c *\w\+ \+' - else - let matchExpr = ' \+\(\w*\%' . orgCol . 'c\w*\) \+' - endif - let matchInd = match(line, matchExpr) - if matchInd == -1 - return - endif - let matchStr = matchstr(line, matchExpr) - let nSpaces = strlen(substitute(matchStr, '[^ ]', '', 'g')) - let word = substitute(matchStr, ' ', '', 'g') - let middle = nSpaces / 2 - let left = nSpaces - middle - let newStr = '' - while middle > 0 - let newStr = newStr . ' ' - let middle = middle - 1 - endwhile - let newStr = newStr . word - while left > 0 - let newStr = newStr . ' ' - let left = left - 1 - endwhile - - let newLine = strpart(line, 0, matchInd) - let newLine = newLine . newStr - let newLine = newLine . strpart (line, matchInd + strlen(matchStr)) - silent! keepjumps call setline(line('.'), newLine) -endfunction - -function! genutils#MapAppendCascaded(lhs, rhs, mapMode) - - " Determine the map mode from the map command. - let mapChar = strpart(a:mapMode, 0, 1) - - " Check if this is already mapped. - let oldrhs = maparg(a:lhs, mapChar) - if oldrhs != "" - let self = oldrhs - else - let self = a:lhs - endif - "echomsg a:mapMode . "oremap" . " " . a:lhs . " " . self . a:rhs - exec a:mapMode . "oremap" a:lhs self . a:rhs -endfunction - -" smartSlash simply says whether to depend on shellslash and ArgLead for -" determining path separator. If it shouldn't depend, it will always assume -" that the required pathsep is forward-slash. -function! genutils#UserFileComplete(ArgLead, CmdLine, CursorPos, smartSlash, - \ searchPath) - let glob = '' - let opathsep = "\\" - let npathsep = '/' - if exists('+shellslash') && ! &shellslash && a:smartSlash && - \ stridx(a:ArgLead, "\\") != -1 - let opathsep = '/' - let npathsep = "\\" - endif - if a:searchPath !=# '' - for nextPath in split(a:searchPath, genutils#CrUnProtectedCharsPattern(',')) - let nextPath = genutils#CleanupFileName(nextPath) - let matches = glob(nextPath.'/'.a:ArgLead.'*') - if matches !~# '^\_s*$' - let matches = s:FixPathSep(matches, opathsep, npathsep) - let nextPath = substitute(nextPath, opathsep, npathsep, 'g') - let matches = substitute(matches, '\V'.escape(nextPath.npathsep, "\\"), - \ '', 'g') - let glob = glob . matches . "\n" - endif - endfor - else - let glob = s:FixPathSep(glob(a:ArgLead.'*'), opathsep, npathsep) - endif - " FIXME: Need an option to control if ArgLead should also be returned or - " not. - return glob."\n".a:ArgLead -endfunction - -command! -complete=file -nargs=* GUDebugEcho :echo <q-args> -function! genutils#UserFileExpand(fileArgs) - return substitute(genutils#GetVimCmdOutput( - \ 'GUDebugEcho ' . a:fileArgs), '^\_s\+\|\_s\+$', '', 'g') -endfunction - -function! s:FixPathSep(matches, opathsep, npathsep) - let matches = a:matches - let matches = substitute(matches, a:opathsep, a:npathsep, 'g') - let matches = substitute(matches, "\\([^\n]\\+\\)", '\=submatch(1).'. - \ '(isdirectory(submatch(1)) ? a:npathsep : "")', 'g') - return matches -endfunction - -function! genutils#GetVimCmdOutput(cmd) - let v:errmsg = '' - let output = '' - let _z = @z - let _shortmess = &shortmess - try - set shortmess= - redir @z - silent exec a:cmd - catch /.*/ - let v:errmsg = substitute(v:exception, '^[^:]\+:', '', '') - finally - redir END - let &shortmess = _shortmess - if v:errmsg == '' - let output = @z - endif - let @z = _z - endtry - return output -endfunction - -function! genutils#OptClearBuffer() - " Go as far as possible in the undo history to conserve Vim resources. - let _modifiable = &l:modifiable - let _undolevels = &undolevels - try - setl modifiable - set undolevels=-1 - silent! keepjumps 0,$delete _ - finally - let &undolevels = _undolevels - let &l:modifiable = _modifiable - endtry -endfunction - - -"" START: Sorting support. {{{ -"" - -" -" Comapare functions. -" - -function! genutils#CmpByLineLengthNname(line1, line2, ...) - let direction = (a:0?a:1:1) - let cmp = genutils#CmpByLength(a:line1, a:line2, direction) - if cmp == 0 - let cmp = genutils#CmpByString(a:line1, a:line2, direction) - endif - return cmp -endfunction - -function! genutils#CmpByLength(line1, line2, ...) - let direction = (a:0?a:1:1) - let len1 = strlen(a:line1) - let len2 = strlen(a:line2) - return direction * (len1 - len2) -endfunction - -" Compare first by name and then by length. -" Useful for sorting Java imports. -function! genutils#CmpJavaImports(line1, line2, ...) - let direction = (a:0?a:1:1) - " FIXME: Simplify this. - if stridx(a:line1, '.') == -1 - let pkg1 = '' - let cls1 = substitute(a:line1, '.* \(^[ ]\+\)', '\1', '') - else - let pkg1 = substitute(a:line1, '.*import\s\+\(.*\)\.[^. ;]\+.*$', '\1', '') - let cls1 = substitute(a:line1, '^.*\.\([^. ;]\+\).*$', '\1', '') - endif - if stridx(a:line2, '.') == -1 - let pkg2 = '' - let cls2 = substitute(a:line2, '.* \(^[ ]\+\)', '\1', '') - else - let pkg2 = substitute(a:line2, '.*import\s\+\(.*\)\.[^. ;]\+.*$', '\1', '') - let cls2 = substitute(a:line2, '^.*\.\([^. ;]\+\).*$', '\1', '') - endif - - let cmp = genutils#CmpByString(pkg1, pkg2, direction) - if cmp == 0 - let cmp = genutils#CmpByLength(cls1, cls2, direction) - endif - return cmp -endfunction - -function! genutils#CmpByString(line1, line2, ...) - let direction = (a:0?a:1:1) - if a:line1 < a:line2 - return -direction - elseif a:line1 > a:line2 - return direction - else - return 0 - endif -endfunction - -function! genutils#CmpByStringIgnoreCase(line1, line2, ...) - let direction = (a:0?a:1:1) - if a:line1 <? a:line2 - return -direction - elseif a:line1 >? a:line2 - return direction - else - return 0 - endif -endfunction - -function! genutils#CmpByNumber(line1, line2, ...) - let direction = (a:0 ? a:1 :1) - let num1 = a:line1 + 0 - let num2 = a:line2 + 0 - - if num1 < num2 - return -direction - elseif num1 > num2 - return direction - else - return 0 - endif -endfunction - -function! genutils#QSort(cmp, direction) range - call s:QSortR(a:firstline, a:lastline, a:cmp, a:direction, - \ 's:BufLineAccessor', 's:BufLineSwapper', '') -endfunction - -function! genutils#QSort2(start, end, cmp, direction, accessor, swapper, context) - call s:QSortR(a:start, a:end, a:cmp, a:direction, a:accessor, a:swapper, - \ a:context) -endfunction - -" The default swapper that swaps lines in the current buffer. -function! s:BufLineSwapper(line1, line2, context) - let str2 = getline(a:line1) - silent! keepjumps call setline(a:line1, getline(a:line2)) - silent! keepjumps call setline(a:line2, str2) -endfunction - -" The default accessor that returns lines from the current buffer. -function! s:BufLineAccessor(line, context) - return getline(a:line) -endfunction - -" The default mover that moves lines from one place to another in the current -" buffer. -function! s:BufLineMover(from, to, context) - let line = getline(a:from) - exec a:from.'d_' - call append(a:to, line) -endfunction - -" -" Sort lines. QSortR() is called recursively. -" -function! s:QSortR(start, end, cmp, direction, accessor, swapper, context) - if a:end > a:start - let low = a:start - let high = a:end - - " Arbitrarily establish partition element at the midpoint of the data. - let midStr = {a:accessor}(((a:start + a:end) / 2), a:context) - - " Loop through the data until indices cross. - while low <= high - - " Find the first element that is greater than or equal to the partition - " element starting from the left Index. - while low < a:end - let result = {a:cmp}({a:accessor}(low, a:context), midStr, a:direction) - if result < 0 - let low = low + 1 - else - break - endif - endwhile - - " Find an element that is smaller than or equal to the partition element - " starting from the right Index. - while high > a:start - let result = {a:cmp}({a:accessor}(high, a:context), midStr, a:direction) - if result > 0 - let high = high - 1 - else - break - endif - endwhile - - " If the indexes have not crossed, swap. - if low <= high - " Swap lines low and high. - call {a:swapper}(high, low, a:context) - let low = low + 1 - let high = high - 1 - endif - endwhile - - " If the right index has not reached the left side of data must now sort - " the left partition. - if a:start < high - call s:QSortR(a:start, high, a:cmp, a:direction, a:accessor, a:swapper, - \ a:context) - endif - - " If the left index has not reached the right side of data must now sort - " the right partition. - if low < a:end - call s:QSortR(low, a:end, a:cmp, a:direction, a:accessor, a:swapper, - \ a:context) - endif - endif -endfunction - -function! genutils#BinSearchForInsert(start, end, line, cmp, direction) - return genutils#BinSearchForInsert2(a:start, a:end, a:line, a:cmp, - \ a:direction, 's:BufLineAccessor', '') -endfunction - -function! genutils#BinSearchForInsert2(start, end, line, cmp, direction, - \ accessor, context) - let start = a:start - 1 - let end = a:end - while start < end - let middle = (start + end + 1) / 2 - " Support passing both Funcref's as well as names. - if type(a:cmp) == 2 - if type(a:accessor) == 2 - let result = a:cmp(a:accessor(middle, a:context), a:line, a:direction) - else - let result = a:cmp({a:accessor}(middle, a:context), a:line, a:direction) - endif - else - if type(a:accessor) == 2 - let result = {a:cmp}(a:accessor(middle, a:context), a:line, a:direction) - else - let result = {a:cmp}({a:accessor}(middle, a:context), a:line, a:direction) - endif - endif - if result < 0 - let start = middle - else - let end = middle - 1 - endif - endwhile - return start -endfunction - -function! genutils#BinSearchList(list, start, end, item, cmp) - let start = a:start - 1 - let end = a:end - while start < end - let middle = (start + end + 1) / 2 - let result = call(a:cmp, [get(a:list, middle), a:item]) - if result < 0 - let start = middle - else - let end = middle - 1 - endif - endwhile - return start -endfunction - -function! genutils#BinInsertSort(cmp, direction) range - call genutils#BinInsertSort2(a:firstline, a:lastline, a:cmp, a:direction, - \ 's:BufLineAccessor', 's:BufLineMover', '') -endfunction - -function! genutils#BinInsertSort2(start, end, cmp, direction, accessor, mover, context) - let i = a:start + 1 - while i <= a:end - let low = s:BinSearchToAppend2(a:start, i, {a:accessor}(i, a:context), - \ a:cmp, a:direction, a:accessor, a:context) - " Move the object. - if low < i - call {a:mover}(i, low - 1, a:context) - endif - let i = i + 1 - endwhile -endfunction - -function! s:BinSearchToAppend(start, end, line, cmp, direction) - return s:BinSearchToAppend2(a:start, a:end, a:line, a:cmp, a:direction, - \ 's:BufLineAccessor', '') -endfunction - -function! s:BinSearchToAppend2(start, end, line, cmp, direction, accessor, - \ context) - let low = a:start - let high = a:end - while low < high - let mid = (low + high) / 2 - let diff = {a:cmp}({a:accessor}(mid, a:context), a:line, a:direction) - if diff > 0 - let high = mid - else - let low = mid + 1 - if diff == 0 - break - endif - endif - endwhile - return low -endfunction - -""" END: Sorting support. }}} - - -" Eats character if it matches the given pattern. -" -" Originally, -" From: Benji Fisher <fisherbb@bc.edu> -" Date: Mon, 25 Mar 2002 15:05:14 -0500 -" -" Based on Bram's idea of eating a character while type <Space> to expand an -" abbreviation. This solves the problem with abbreviations, where we are -" left with an extra space after the expansion. -" Ex: -" inoreabbr \stdout\ System.out.println("");<Left><Left><Left><C-R>=genutils#EatChar('\s')<CR> -function! genutils#EatChar(pat) - let c = nr2char(getchar()) - "call input('Pattern: '.a:pat.' '. - " \ ((c =~ a:pat) ? 'Returning empty' : 'Returning: '.char2nr(c))) - return (c =~ a:pat) ? '' : c -endfun - - -" Can return a spacer from 0 to 80 characters width. -let s:spacer= " ". - \ " " -function! genutils#GetSpacer(width) - return strpart(s:spacer, 0, a:width) -endfunction - -function! genutils#SilentSubstitute(pat, cmd) - call genutils#SaveHardPosition('SilentSubstitute') - let _search = @/ - try - let @/ = a:pat - keepjumps silent! exec a:cmd - finally - let @/ = _search - call genutils#RestoreHardPosition('SilentSubstitute') - call genutils#ResetHardPosition('SilentSubstitute') - endtry -endfunction - -function! genutils#SilentDelete(arg1, ...) - " For backwards compatibility. - if a:0 - let range = a:arg1 - let pat = a:1 - else - let range = '' - let pat = a:arg1 - endif - let _search = @/ - call genutils#SaveHardPosition('SilentDelete') - try - let @/ = pat - keepjumps silent! exec range'g//d _' - finally - let @/ = _search - call genutils#RestoreHardPosition('SilentDelete') - call genutils#ResetHardPosition('SilentDelete') - endtry -endfunction - -" START: genutils#Roman2Decimal {{{ -let s:I = 1 -let s:V = 5 -let s:X = 10 -let s:L = 50 -let s:C = 100 -let s:D = 500 -let s:M = 1000 - -function! s:Char2Num(c) - " A bit of magic on empty strings - if a:c == "" - return 0 - endif - exec 'let n = s:' . toupper(a:c) - return n -endfun - -function! genutils#Roman2Decimal(str) - if a:str !~? '^[IVXLCDM]\+$' - return a:str - endif - let sum = 0 - let i = 0 - let n0 = s:Char2Num(a:str[i]) - let len = strlen(a:str) - while i < len - let i = i + 1 - let n1 = s:Char2Num(a:str[i]) - " Magic: n1=0 when i exceeds len - if n1 > n0 - let sum = sum - n0 - else - let sum = sum + n0 - endif - let n0 = n1 - endwhile - return sum -endfun -" END: genutils#Roman2Decimal }}} - - -" BEGIN: Relative path {{{ -function! genutils#CommonPath(path1, path2, ...) - let path1 = genutils#CleanupFileName(a:path1) . ((a:0 > 0 ? a:1 : 0) ? '/' : '') - let path2 = genutils#CleanupFileName(a:path2) . ((a:0 > 1 ? a:2 : 0) ? '/' : '') - return genutils#CommonString(path1, path2) -endfunction - -function! genutils#CommonString(str1, str2) - let str1 = a:str1 - let str2 = a:str2 - if str1 == str2 - return str1 - endif - let n = 0 - while str1[n] == str2[n] - let n = n+1 - endwhile - return strpart(str1, 0, n) -endfunction - -function! genutils#RelPathFromFile(srcFile, tgtFile) - return genutils#RelPathFromDir(fnamemodify(a:srcFile, ':h'), a:tgtFile) -endfunction - -function! genutils#RelPathFromDir(srcDir, tgtFile) - let cleanDir = genutils#CleanupFileName(a:srcDir).'/' - let cleanFile = genutils#CleanupFileName(a:tgtFile) - let cmnPath = genutils#CommonPath(cleanDir, cleanFile, 1) - let relDirFromCmnPath = strpart(cleanDir, strlen(cmnPath)) - if relDirFromCmnPath == '/' " This means the file is under the srcDir. - let relDirFromCmnPath = '' - endif - let relFileFromCmnPath = strpart(cleanFile, strlen(cmnPath)) - return substitute(relDirFromCmnPath, '[^/]\+', '..', 'g') . - \ relFileFromCmnPath -endfunction - -" END: Relative path }}} - - -" BEGIN: Persistent settings {{{ -if ! exists("g:genutilsNoPersist") || ! g:genutilsNoPersist - " Make sure the '!' option to store global variables that are upper cased are - " stored in viminfo file. - " Make sure it is the first option, so that it will not interfere with the - " 'n' option ("Todd J. Cosgrove" (todd dot cosgrove at softechnics dot - " com)). - " Also take care of empty value, when 'compatible' mode is on (Bram - " Moolenar) - if &viminfo == '' - set viminfo=!,'20,"50,h - else - set viminfo^=! - endif -endif - -function! genutils#PutPersistentVar(pluginName, persistentVar, value) - if ! exists("g:genutilsNoPersist") || ! g:genutilsNoPersist - let globalVarName = s:PersistentVarName(a:pluginName, a:persistentVar) - exec 'let ' . globalVarName . " = '" . a:value . "'" - endif -endfunction - -function! genutils#GetPersistentVar(pluginName, persistentVar, default) - if ! exists("g:genutilsNoPersist") || ! g:genutilsNoPersist - let globalVarName = s:PersistentVarName(a:pluginName, a:persistentVar) - if (exists(globalVarName)) - exec 'let value = ' . globalVarName - exec 'unlet ' . globalVarName - else - let value = a:default - endif - return value - else - return default - endif -endfunction - -function! s:PersistentVarName(pluginName, persistentVar) - return 'g:GU_' . toupper(a:pluginName) . '_' . toupper(a:persistentVar) -endfunction -" END: Persistent settings }}} - - -" FileChangedShell handling {{{ -if !exists('s:fcShellPreFuncs') - let s:fcShellPreFuncs = {} -endif - -function! genutils#AddToFCShellPre(funcName) - let s:fcShellPreFuncs[a:funcName] = a:funcName -endfunction - -function! genutils#RemoveFromFCShellPre(funcName) - if has_key(s:fcShellPreFuncs, a:funcName) - unlet s:fcShellPreFuncs[a:funcName] - endif -endfunction - -let s:defFCShellInstalled = 0 -function! genutils#DefFCShellInstall() - if ! s:defFCShellInstalled - aug DefFCShell - au! - au FileChangedShell * nested call genutils#DefFileChangedShell() - aug END - endif - let s:defFCShellInstalled = s:defFCShellInstalled + 1 -endfunction - -function! genutils#DefFCShellUninstall() - if s:defFCShellInstalled <= 0 - return - endif - let s:defFCShellInstalled = s:defFCShellInstalled - 1 - if ! s:defFCShellInstalled - aug DefFCShell - au! - aug END - endif -endfunction - -function! genutils#DefFileChangedShell() - let autoread = s:InvokeFuncs(s:fcShellPreFuncs) - let bufNo = expand('<abuf>') + 0 - let fName = expand('<afile>') - let msg = '' - let v:fcs_choice = '' - if getbufvar(bufNo, '&modified') - let v:fcs_choice = 'ask' - elseif ! autoread - let v:fcs_choice = 'ask' - else - let v:fcs_choice = 'reload' - endif - return -endfunction - -function! s:InvokeFuncs(funcList) - let autoread = &autoread - if len(a:funcList) != 0 - for nextFunc in keys(a:funcList) - let result = call(nextFunc, []) - if result != -1 - let autoread = autoread || result - endif - endfor - endif - return autoread -endfunction -" FileChangedShell handling }}} - - -" Sign related utilities {{{ -function! genutils#CurLineHasSign() - let signs = genutils#GetVimCmdOutput('sign place buffer=' . bufnr('%'), 1) - return (match(signs, - \ 'line=' . line('.') . '\s\+id=\d\+\s\+name=VimBreakPt') != -1) -endfunction - -function! genutils#ClearAllSigns() - let signs = genutils#GetVimCmdOutput('sign place buffer=' . bufnr('%'), 1) - let curIdx = 0 - let pat = 'line=\d\+\s\+id=\zs\d\+\ze\s\+name=VimBreakPt' - let id = 0 - while curIdx != -1 && curIdx < strlen(signs) - let id = matchstr(signs, pat, curIdx) - if id != '' - exec 'sign unplace ' . id . ' buffer=' . bufnr('%') - endif - let curIdx = matchend(signs, pat, curIdx) - endwhile -endfunction -" }}} - -let s:UNPROTECTED_CHAR_PRFX = '\%(\%([^\\]\|^\)\\\%(\\\\\)*\)\@<!' " Doesn't eat slashes. -"let s:UNPROTECTED_CHAR_PRFX = '\\\@<!\%(\\\\\)*' " Eats slashes. -function! genutils#CrUnProtectedCharsPattern(chars, ...) - let capture = (a:0 > 0?1:0) - let regex = s:UNPROTECTED_CHAR_PRFX - let chars = a:chars - if strlen(chars) > 1 - let chars = '['.chars.']' - endif - if capture - let chars = '\('.chars.'\)' - endif - return regex.chars -endfunction - -function! genutils#PromptForElement(array, default, msg, skip, useDialog, - \ nCols) - let nCols = a:nCols - let index = 0 - let line = "" - let element = "" - let optionsMsg = "" - let colWidth = &columns / nCols - 1 " Leave a margin of one column as a gap. - let curCol = 1 - let nElements = len(a:array) - let newArray = [] " Without the skip element. - if index(a:array, a:skip) != -1 - let nElements = nElements - 1 - endif - for element in a:array - if element ==# a:skip - continue - endif - call add(newArray, element) - let element = strpart(index." ", 0, 4) . element - let eleColWidth = (strlen(element) - 1) / colWidth + 1 - " Fill up the spacer for the rest of the partial column. - let element = element . genutils#GetSpacer( - \ eleColWidth * (colWidth + 1) - strlen(element) - 1) - let wouldBeLength = strlen(line) + strlen(element) + 1 - if wouldBeLength > (curCol * (colWidth + eleColWidth)) && - \ wouldBeLength > &columns - let splitLine = 2 " Split before adding the new element. - elseif curCol == nCols - let splitLine = 1 " Split after adding the new element. - else - let splitLine = 0 - endif - if splitLine == 2 - if strlen(line) == &columns - " Remove the last space as it otherwise results in an extra empty line - " on the screen. - let line = strpart(line, 0, strlen(line) - 1) - endif - let optionsMsg = optionsMsg . line . "\n" - let line = element . ' ' - let curCol = strlen(element) / (colWidth + 1) - else - let line = line . element . ' ' - if splitLine == 1 - if strlen(line) == &columns - " Remove the last space as it otherwise results in an extra empty line - " on the screen. - let line = strpart(line, 0, strlen(line) - 1) - endif - let curCol = 0 " Reset col count. - let optionsMsg = optionsMsg . line . "\n" - let line = "" - endif - endif - let curCol = curCol + 1 - let index = index + 1 - endfor - " Finally if there is anything left in line, then append that too. - if line.'' != '' - let optionsMsg = optionsMsg . line . "\n" - let line = "" - endif - - " Default index or empty string. - let default = '' - if type(a:default) == 0 - let default = a:default - elseif a:default.'' != '' - let default = index(a:array, a:default) - endif - if a:default == -1 - let default = '' - endif - - while !exists("selectedElement") - if a:useDialog - let s:selection = inputdialog(optionsMsg . a:msg, default) - else - let s:selection = input(optionsMsg . a:msg, default) - endif - if s:selection.'' == '' - let selectedElement = '' - let s:selection = -1 - else - let s:selection = (s:selection !~# '^\d\+$') ? -1 : (s:selection + 0) - if s:selection >= 0 && s:selection < nElements - let selectedElement = newArray[s:selection] - else - echohl ERROR | echo "\nInvalid selection, please try again" | - \ echohl NONE - endif - endif - echo "\n" - endwhile - return selectedElement -endfunction - -let s:selection = -1 -function! genutils#GetSelectedIndex() - return s:selection -endfunction - -" Always match() with 'ignorecase' and 'smartcase' off. -function! s:Match(expr, pat, start) - let _ic = &ignorecase - let _scs = &smartcase - let result = -1 - try - set noignorecase - set nosmartcase - let result = match(a:expr, a:pat, a:start) - finally - let &ignorecase = _ic - let &smartcase = _scs - endtry - return result -endfunction - -" Restore cpo. -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim6:fdm=marker et diff --git a/.vim/autoload/lookupfile.vim b/.vim/autoload/lookupfile.vim deleted file mode 100755 index 0f6332c..0000000 --- a/.vim/autoload/lookupfile.vim +++ /dev/null @@ -1,472 +0,0 @@ -" lookupfile.vim: See plugin/lookupfile.vim - -" Make sure line-continuations won't cause any problem. This will be restored -" at the end -let s:save_cpo = &cpo -set cpo&vim - -" Some onetime initialization of variables -if !exists('s:myBufNum') - let s:windowName = '[Lookup File]' - let s:myBufNum = -1 - let s:popupIsHidden = 0 -endif -let g:lookupfile#lastPattern = "" -let g:lookupfile#lastResults = [] -let g:lookupfile#lastStatsMsg = [] -let g:lookupfile#recentFiles = [] - -function! lookupfile#OpenWindow(bang, initPat) - let origWinnr = winnr() - let _isf = &isfname - let _splitbelow = &splitbelow - set nosplitbelow - try - if s:myBufNum == -1 - " Temporarily modify isfname to avoid treating the name as a pattern. - set isfname-=\ - set isfname-=[ - if exists('+shellslash') - call genutils#OpenWinNoEa("1sp \\\\". escape(s:windowName, ' ')) - else - call genutils#OpenWinNoEa("1sp \\". escape(s:windowName, ' ')) - endif - let s:myBufNum = bufnr('%') - else - let winnr = bufwinnr(s:myBufNum) - if winnr == -1 - call genutils#OpenWinNoEa('1sb '. s:myBufNum) - else - let wasVisible = 1 - exec winnr 'wincmd w' - endif - endif - finally - let &isfname = _isf - let &splitbelow = _splitbelow - endtry - - call s:SetupBuf() - let initPat = '' - if a:bang != '' - let initPat = '' - elseif a:initPat != '' - let initPat = a:initPat - elseif g:lookupfile#lastPattern != '' && g:LookupFile_PreserveLastPattern - let initPat = g:lookupfile#lastPattern - endif - $ - if getline('.') !=# initPat - silent! put='' - call setline('.', initPat) - endif - startinsert! - if !g:LookupFile_OnCursorMovedI - " This is a hack to bring up the popup immediately, while reopening the - " window, just for a better response. - aug LookupFileCursorHoldImm - au! - au CursorMovedI <buffer> nested exec 'doautocmd LookupFile CursorHoldI' | - \ au! LookupFileCursorHoldImm - aug END - endif - call s:LookupFileSet() - aug LookupFileReset - au! - au CursorMovedI <buffer> call <SID>LookupFileSet() - au CursorMoved <buffer> call <SID>LookupFileSet() - au WinEnter <buffer> call <SID>LookupFileSet() - au TabEnter <buffer> call <SID>LookupFileSet() - au WinEnter * call <SID>LookupFileReset(0) - au TabEnter * call <SID>LookupFileReset(0) - au CursorMoved * call <SID>LookupFileReset(0) - " Better be safe than sorry. - au BufHidden <buffer> call <SID>LookupFileReset(1) - aug END -endfunction - -function! lookupfile#CloseWindow() - if bufnr('%') != s:myBufNum - return - endif - - call s:LookupFileReset(1) - close -endfunction - -function! lookupfile#ClearCache() - let g:lookupfile#lastPattern = "" - let g:lookupfile#lastResults = [] -endfunction - -function! s:LookupFileSet() - if bufnr('%') != s:myBufNum || exists('s:_backspace') - return - endif - let s:_backspace = &backspace - set backspace=start - let s:_completeopt = &completeopt - set completeopt+=menuone - let s:_updatetime = &updatetime - let &updatetime = g:LookupFile_UpdateTime -endfunction - -function! s:LookupFileReset(force) - if a:force - aug LookupFileReset - au! - aug END - endif - " Ignore the event while in the same buffer. - if exists('s:_backspace') && (a:force || (bufnr('%') != s:myBufNum)) - let &backspace = s:_backspace - let &completeopt = s:_completeopt - let &updatetime = s:_updatetime - unlet s:_backspace s:_completeopt s:_updatetime - endif -endfunction - -function! s:HidePopup() - let s:popupIsHidden = 1 - return "\<C-E>" -endfunction - -function! lookupfile#IsPopupHidden() - return s:popupIsHidden -endfunction - -function! s:SetupBuf() - call genutils#SetupScratchBuffer() - resize 1 - setlocal wrap - setlocal bufhidden=hide - setlocal winfixheight - setlocal wrapmargin=0 - setlocal textwidth=0 - setlocal completefunc=lookupfile#Complete - syn clear - set ft=lookupfile - " Setup maps to open the file. - inoremap <silent> <buffer> <expr> <C-E> <SID>HidePopup() - inoremap <silent> <buffer> <expr> <CR> <SID>AcceptFile(0, "\<CR>") - inoremap <silent> <buffer> <expr> <C-O> <SID>AcceptFile(1, "\<C-O>") - " This prevents the "Whole line completion" from getting triggered with <BS>, - " however this might make the dropdown kind of flash. - inoremap <buffer> <expr> <BS> pumvisible()?"\<C-E>\<BS>":"\<BS>" - inoremap <buffer> <expr> <S-BS> pumvisible()?"\<C-E>\<BS>":"\<BS>" - " Make <C-Y> behave just like <CR> - imap <buffer> <C-Y> <CR> - if g:LookupFile_EscCancelsPopup - inoremap <buffer> <expr> <Esc> pumvisible()?"\<C-E>\<C-C>":"\<Esc>" - endif - inoremap <buffer> <expr> <silent> <Down> <SID>GetCommand(1, 1, "\<C-N>", - \ "\"\\<Lt>C-N>\"") - inoremap <buffer> <expr> <silent> <Up> <SID>GetCommand(1, 1, "\<C-P>", - \ "\"\\<Lt>C-P>\"") - inoremap <buffer> <expr> <silent> <PageDown> <SID>GetCommand(1, 0, - \ "\<PageDown>", '') - inoremap <buffer> <expr> <silent> <PageUp> <SID>GetCommand(1, 0, - \ "\<PageUp>", '') - nnoremap <silent> <buffer> o :OpenFile<CR> - nnoremap <silent> <buffer> O :OpenFile!<CR> - command! -buffer -nargs=0 -bang OpenFile - \ :call <SID>OpenCurFile('<bang>' != '') - command! -buffer -nargs=0 -bang AddPattern :call <SID>AddPattern() - nnoremap <buffer> <silent> <Plug>LookupFile :call lookupfile#CloseWindow()<CR> - inoremap <buffer> <silent> <Plug>LookupFile <C-E><C-C>:call lookupfile#CloseWindow()<CR> - - aug LookupFile - au! - if g:LookupFile_ShowFiller - exec 'au' (g:LookupFile_OnCursorMovedI ? 'CursorMovedI' : 'CursorHoldI') - \ '<buffer> call <SID>ShowFiller()' - endif - exec 'au' (g:LookupFile_OnCursorMovedI ? 'CursorMovedI' : 'CursorHoldI') - \ '<buffer> call lookupfile#LookupFile(0)' - aug END -endfunction - -function! s:GetCommand(withPopupTrigger, withSkipPat, actCmd, innerCmd) - let cmd = '' - if a:withPopupTrigger && !pumvisible() - let cmd .= "\<C-X>\<C-U>" - endif - let cmd .= a:actCmd. "\<C-R>=(getline('.') == lookupfile#lastPattern) ? ". - \ a:innerCmd." : ''\<CR>" - return cmd -endfunction - -function! s:AddPattern() - if g:LookupFile_PreservePatternHistory - silent! put! =g:lookupfile#lastPattern - $ - endif -endfunction - -function! s:AcceptFile(splitWin, key) - if s:popupIsHidden - return a:key - endif - if !pumvisible() - call lookupfile#LookupFile(0, 1) - endif - let acceptCmd = '' - if type(g:LookupFile_LookupAcceptFunc) == 2 || - \ (type(g:LookupFile_LookupAcceptFunc) == 1 && - \ substitute(g:LookupFile_LookupAcceptFunc, '\s', '', 'g') != '') - let acceptCmd = call(g:LookupFile_LookupAcceptFunc, [a:splitWin, a:key]) - else - let acceptCmd = lookupfile#AcceptFile(a:splitWin, a:key) - endif - - return (!pumvisible() ? "\<C-X>\<C-U>" : '').acceptCmd -endfunction - -function! s:IsValid(fileName) - if bufnr('%') != s:myBufNum || a:fileName == '' - return 0 - endif - if !filereadable(a:fileName) && !isdirectory(a:fileName) - if g:LookupFile_AllowNewFiles - " Check if the parent directory exists, then we can create a new buffer - " (Ido feature) - let parent = fnamemodify(a:fileName, ':h') - if parent == '' || (parent != '' && !isdirectory(parent)) - return 1 - endif - endif - return 0 - endif - return 1 -endfunction - -function! lookupfile#AcceptFile(splitWin, key) - if len(g:lookupfile#lastResults) == 0 && !s:IsValid(getline('.')) - return "\<C-O>:echohl ErrorMsg | echo 'No such file or directory' | echohl NONE\<CR>" - endif - - " Skip the first match, which is essentially the same as pattern. - let nextCmd = "\<C-N>\<C-R>=(getline('.') == lookupfile#lastPattern)?\"\\<C-N>\":''\<CR>" - let acceptCmd = "\<C-Y>\<Esc>:AddPattern\<CR>:OpenFile".(a:splitWin?'!':''). - \ "\<CR>" - if getline('.') ==# g:lookupfile#lastPattern - if len(g:lookupfile#lastResults) == 0 - " FIXME: shouldn't this be an error? - let acceptCmd = acceptCmd - elseif len(g:lookupfile#lastResults) == 1 || g:LookupFile_AlwaysAcceptFirst - " If there is only one file, we will also select it (if not already - " selected) - let acceptCmd = nextCmd.acceptCmd - else - let acceptCmd = nextCmd - endif - endif - - return acceptCmd -endfunction - -function! s:OpenCurFile(splitWin) - let fileName = getline('.') - if fileName =~ '^\s*$' - return - endif - if !s:IsValid(fileName) - echohl ErrorMsg | echo 'No such file or directory' | echohl NONE - endif - - if type(g:LookupFile_LookupNotifyFunc) == 2 || - \ (type(g:LookupFile_LookupNotifyFunc) == 1 && - \ substitute(g:LookupFile_LookupNotifyFunc, '\s', '', 'g') != '') - call call(g:LookupFile_LookupNotifyFunc, []) - endif - call lookupfile#CloseWindow() - - " Update the recent files list. - if g:LookupFile_RecentFileListSize > 0 - let curPos = index(g:lookupfile#recentFiles, fileName) - call add(g:lookupfile#recentFiles, fileName) - if curPos != -1 - call remove(g:lookupfile#recentFiles, curPos) - elseif len(g:lookupfile#recentFiles) > g:LookupFile_RecentFileListSize - let g:lookupfile#recentFiles = g:lookupfile#recentFiles[ - \ -g:LookupFile_RecentFileListSize :] - endif - endif - - let bufnr = genutils#FindBufferForName(fileName) - let winnr = bufwinnr(bufnr) - if winnr == -1 && g:LookupFile_SearchForBufsInTabs - for i in range(tabpagenr('$')) - if index(tabpagebuflist(i+1), bufnr) != -1 - " Switch to the tab and set winnr. - exec 'tabnext' (i+1) - let winnr = bufwinnr(bufnr) - endif - endfor - endif - if winnr != -1 - exec winnr.'wincmd w' - else - let splitOpen = 0 - if &switchbuf ==# 'split' || a:splitWin - let splitOpen = 1 - endif - " First try opening as a buffer, if it fails, we will open as a file. - try - if bufnr == -1 - throw '' - endif - exec (splitOpen?'s':'').'buffer' bufnr - catch /^Vim\%((\a\+)\)\=:E325/ - " Ignore, this anyway means the file was found. - catch - try - exec (splitOpen?'split':'edit') fileName - catch /^Vim\%((\a\+)\)\=:E325/ - " Ignore, this anyway means the file was found. - endtry - endtry - endif -endfunction - -function! s:ShowFiller() - return lookupfile#LookupFile(1) -endfunction - -function! lookupfile#Complete(findstart, base) - if a:findstart - return 0 - else - call lookupfile#LookupFile(0, 1, a:base) - return g:lookupfile#lastStatsMsg+g:lookupfile#lastResults - endif -endfunction - -function! lookupfile#LookupFile(showingFiller, ...) - let generateMode = (a:0 == 0 ? 0 : a:1) - if generateMode - let pattern = (a:0 > 1) ? a:2 : getline('.') - else - let pattern = getline('.') - " The normal completion behavior is to stop completion when cursor is moved. - if col('.') == 1 || (col('.') != col('$')) - return '' - endif - endif - if pattern == '' || (pattern ==# g:lookupfile#lastPattern && pumvisible()) - return '' - endif - - if s:popupIsHidden && g:lookupfile#lastPattern ==# pattern - return '' - endif - let s:popupIsHidden = 0 - - let statusMsg = '' - if pattern == ' ' - if len(g:lookupfile#recentFiles) == 0 - let statusMsg = '<<< No recent files >>>' - let files = [] - else - let statusMsg = '<<< Showing '.len(g:lookupfile#recentFiles).' recent files >>>' - let files = reverse(copy(g:lookupfile#recentFiles)) - endif - elseif strlen(pattern) < g:LookupFile_MinPatLength - let statusMsg = '<<< Type at least '.g:LookupFile_MinPatLength. - \ ' characters >>>' - let files = [] - " We ignore filler when we have the result in hand. - elseif g:lookupfile#lastPattern ==# pattern - " This helps at every startup as we start with the previous pattern. - let files = g:lookupfile#lastResults - elseif a:showingFiller - " Just show a filler and return. We could return this as the only match, but - " unless 'completeopt' has "menuone", menu doesn't get shown. - let statusMsg = '<<< Looking up files... hit ^C to break >>>' - let files = [] - else - if type(g:LookupFile_LookupFunc) == 2 || - \ (type(g:LookupFile_LookupFunc) == 1 && - \ substitute(g:LookupFile_LookupFunc, '\s', '', 'g') != '') - let files = call(g:LookupFile_LookupFunc, [pattern]) - else - let _tags = &tags - try - let &tags = eval(g:LookupFile_TagExpr) - let taglist = taglist(g:LookupFile_TagsExpandCamelCase ? - \ lookupfile#ExpandCamelCase(pattern) : pattern) - catch - echohl ErrorMsg | echo "Exception: " . v:exception | echohl NONE - return '' - finally - let &tags = _tags - endtry - - " Show the matches for what is typed so far. - if g:LookupFile_UsingSpecializedTags - let files = map(taglist, '{'. - \ '"word": fnamemodify(v:val["filename"], ":p"), '. - \ '"abbr": v:val["name"], '. - \ '"menu": fnamemodify(v:val["filename"], ":h"), '. - \ '"dup": 1, '. - \ '}') - else - let files = map(taglist, 'fnamemodify(v:val["filename"], ":p")') - endif - endif - - let pat = g:LookupFile_FileFilter - if pat != '' - call filter(files, '(type(v:val) == 4) ? v:val["word"] !~ pat : v:val !~ pat') - endif - - if g:LookupFile_SortMethod ==# 'alpha' - " When UsingSpecializedTags, sort by the actual name (Timothy, Guo - " (firemeteor dot guo at gmail dot com)). - if type(get(files, 0)) == 4 - call sort(files, "s:CmpByName") - else - call sort(files) - endif - endif - let g:lookupfile#lastPattern = pattern - let g:lookupfile#lastResults = files - endif - if statusMsg == '' - if len(files) > 0 - let statusMsg = '<<< '.len(files).' Matching >>>' - else - let statusMsg = '<<< None Matching >>>' - endif - endif - let msgLine = [{'word': pattern, 'abbr': statusMsg, 'menu': pattern}] - let g:lookupfile#lastStatsMsg = msgLine - if !generateMode - call complete(1, msgLine+files) - endif - return '' -endfunction - -function! lookupfile#ExpandCamelCase(str) - let pat = a:str - " Check if there are at least two consecutive uppercase letters to turn on - " the CamelCase expansion. - if match(a:str, '\u\u') != -1 - let pat = '\C'.substitute(a:str, '\u\+', - \ '\=substitute(submatch(0), ".", '."'".'&\\U*'."'".', "g")', 'g') - let @*=pat - endif - return pat -endfunction - -function! s:CmpByName(i1, i2) - let ileft = a:i1["abbr"] - let iright = a:i2["abbr"] - return ileft == iright ? 0 : ileft > iright ? 1 : -1 -endfunc - -" Restore cpo. -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim6:fdm=marker et sw=2 diff --git a/.vim/autoload/objc/cocoacomplete.vim b/.vim/autoload/objc/cocoacomplete.vim deleted file mode 100644 index 2c53f1e..0000000 --- a/.vim/autoload/objc/cocoacomplete.vim +++ /dev/null @@ -1,215 +0,0 @@ -" File: cocoacomplete.vim (part of the cocoa.vim plugin) -" Author: Michael Sanders (msanders42 [at] gmail [dot] com) -" Last Updated: June 30, 2009 -" Description: An omni-completion plugin for Cocoa/Objective-C. - -let s:lib_dir = fnameescape($HOME.'/.vim/lib/') -let s:cocoa_indexes = s:lib_dir.'cocoa_indexes/' - -if !isdirectory(s:cocoa_indexes) - echom 'Error in cocoacomplete.vim: could not find ~/.vim/lib/cocoa_indexes directory' -endif - -fun! objc#cocoacomplete#Complete(findstart, base) - if a:findstart - " Column where completion starts: - return match(getline('.'), '\k\+\%'.col('.').'c') - else - let matches = [] - let complete_type = s:GetCompleteType(line('.'), col('.') - 1) - - if complete_type == 'methods' - call s:Complete(a:base, ['alloc', 'init', 'retain', 'release', - \ 'autorelease', 'retainCount', - \ 'description', 'class', 'superclass', - \ 'self', 'zone', 'isProxy', 'hash']) - let obj_pos = s:GetObjPos(line('.'), col('.')) - call extend(matches, s:CompleteMethod(line('.'), obj_pos, a:base)) - elseif complete_type == 'types' || complete_type == 'returntypes' - let opt_types = complete_type == 'returntypes' ? ['IBAction'] : [] - call s:Complete(a:base, opt_types + ['void', 'id', 'BOOL', 'int', - \ 'double', 'float', 'char']) - call extend(matches, s:CompleteCocoa(a:base, 'classes', 'types', - \ 'notifications')) - elseif complete_type != '' - if complete_type =~ 'function_params$' - let complete_type = substitute(complete_type, 'function_params$', '', '') - let functions = s:CompleteFunction(a:base) - endif - - " Mimic vim's dot syntax for other complete types (see :h ft). - let word = a:base == '' ? 'NS' : a:base - let args = [word] + split(complete_type, '\.') - call extend(matches, call('s:CompleteCocoa', args)) - - " List functions after the other items in the menu. - if exists('functions') | call extend(matches, functions) | endif - endif - return matches - endif -endf - -fun s:GetCompleteType(lnum, col) - let scopelist = map(synstack(a:lnum, a:col), 'synIDattr(v:val, "name")') - if empty(scopelist) | return 'types' | endif - - let current_scope = scopelist[-1] - let beforeCursor = strpart(getline(a:lnum), 0, a:col) - - " Completing a function name: - if getline(a:lnum) =~ '\%'.(a:col + 1).'c\s*(' - return 'functions' - elseif current_scope == 'objcSuperclass' - return 'classes' - " Inside brackets "[ ... ]": - elseif index(scopelist, 'objcMessage') != -1 - return beforeCursor =~ '\[\k*$' ? 'classes' : 'methods' - " Inside parentheses "( ... )": - elseif current_scope == 'cParen' - " Inside parentheses for method definition: - if beforeCursor =~ '^\s*[-+]\s*([^{;]*' - return beforeCursor =~ '^\s*[-+]\s*([^)]*$' ? 'returntypes' : 'types' - " Inside function, loop, or conditional: - else - return 'classes.types.constants.function_params' - endif - " Inside braces "{ ... }" or after equals "=": - elseif current_scope == 'cBlock' || current_scope == 'objcAssign' || current_scope == '' - let type = current_scope == 'cBlock' ? 'types.constants.' : '' - let type = 'classes.'.type.'function_params' - - if beforeCursor =~ 'IBOutlet' | return 'classes' | endif - return beforeCursor =~ '\v(^|[{};=\])]|return)\s*\k*$'? type : 'methods' - " Directly inside "@implementation ... @end" or "@interface ... @end" - elseif current_scope == 'objcImp' || current_scope == 'objcHeader' - " TODO: Complete delegate/subclass methods - endif - return '' -endf - -" Adds item to the completion menu if they match the base. -fun s:Complete(base, items) - for item in a:items - if item =~ '^'.a:base | call complete_add(item) | endif - endfor -endf - -" Returns position of "foo" in "[foo bar]" or "[baz bar: [foo bar]]". -fun s:GetObjPos(lnum, col) - let beforeCursor = strpart(getline(a:lnum), 0, a:col) - return match(beforeCursor, '\v.*(^|[\[=;])\s*\[*\zs[A-Za-z0-9_@]+') + 1 -endf - -" Completes a method given the position of the object and the method -" being completed. -fun s:CompleteMethod(lnum, col, method) - let class = s:GetCocoaClass(a:lnum, a:col) - if class == '' - let object = matchstr(getline(a:lnum), '\%'.a:col.'c\k\+') - let class = s:GetDeclWord(object) - if class == '' | return [] | endif - endif - let method = s:GetMethodName(a:lnum, a:col, a:method) - let matches = split(system(s:lib_dir.'get_methods.sh '.class. - \ '|grep "^'.method.'"'), "\n") - if exists('g:loaded_snips') " Use snipMate if it's installed - call objc#pum_snippet#Map() - else " Otherwise, only complete the method name. - call map(matches, 'substitute(v:val, ''\v:\zs.{-}\ze(\w+:|$)'', " ", "g")') - endif - - " If dealing with a partial method name, only complete past it. E.g., in - " "[NSString stringWithCharacters:baz l|]" (where | is the cursor), - " only return "length", not "stringWithCharacters:length:". - if stridx(method, ':') != -1 - let method = substitute(method, a:method.'$', '\\\\zs&', '') - call map(matches, 'matchstr(v:val, "'.method.'.*")') - endif - return matches -endf - -" Returns the Cocoa class at a given position if it exists, or -" an empty string "" if it doesn't. -fun s:GetCocoaClass(lnum, col) - let class = matchstr(getline(a:lnum), '\%'.a:col.'c[A-Za-z0-9_"@]\+') - if class =~ '^@"' | return 'NSString' | endif " Treat @"..." as an NSString - let v:errmsg = '' - sil! hi cocoaClass - if v:errmsg == '' && synIDattr(synID(a:lnum, a:col, 0), 'name') == 'cocoaClass' - return class " If cocoaClass is defined, try using that. - endif - return system('grep ^'.class.' '.s:cocoa_indexes.'classes.txt') != '' - \ ? class : '' " Use grep as a fallback. -endf - -" Returns the word before a variable declaration. -fun s:GetDeclWord(var) - let startpos = [line('.'), col('.')] - let line_found = searchdecl(a:var) != 0 ? 0 : line('.') - call cursor(startpos) - let matchstr = '\v(IBOutlet\s+)=\zs\k+\s*\ze\**\s*' - - " If the declaration was not found in the implementation file, check - " the header. - if !line_found && expand('%:e') == 'm' - let header_path = expand('%:p:r').'.h' - if filereadable(header_path) - for line in readfile(header_path) - if line =~ '^\s*\(IBOutlet\)\=\s*\k*\s*\ze\**\s*'.a:var.'\s*' - return matchstr(line, matchstr) - endif - endfor - return '' - endif - endif - - return matchstr(getline(line_found), matchstr.a:var) -endf - -fun s:SearchList(list, regex) - for line in a:list - if line =~ a:regex - return line - endif - endfor - return '' -endf - -" Returns the method name, ready to be searched by grep. -" The "base" word needs to be passed in separately, because -" Vim apparently removes it from the line during completions. -fun s:GetMethodName(lnum, col, base) - let line = getline(a:lnum) - let col = matchend(line, '\%'.a:col.'c\S\+\s\+') + 1 " Skip past class name. - if line =~ '\%'.col.'c\k\+:' - let base = a:base == '' ? '' : ' '.a:base - let method = matchstr(line, '\%'.col.'c.\{-}\ze]').base - return substitute(method, '\v\k+:\zs.{-}\ze(\s*\k+:|'.base.'$)', '[^:]*', 'g') - else - return a:base - endif -endf - -" Completes Cocoa functions, using snippets for the parameters if possible. -fun s:CompleteFunction(word) - let files = s:cocoa_indexes.'functions.txt' " TODO: Add C functions. - let matches = split(system('zgrep -h "^'.a:word.'" '.files), "\n") - if exists('g:loaded_snips') " Use snipMate if it's installed - call objc#pum_snippet#Map() - else " Otherwise, just complete the function name - call map(matches, "{'word':matchstr(v:val, '^\\k\\+'), 'abbr':v:val}") - endif - return matches -endf - -" Completes word for Cocoa "classes", "types", "notifications", or "constants". -" (supplied as the optional parameters). -fun s:CompleteCocoa(word, file, ...) - let files = '' - for file in [a:file] + a:000 - let files .= ' '.s:cocoa_indexes.file.'.txt' - endfor - - return split(system('grep -ho "^'.a:word.'[A-Za-z0-9_]*" '.files), "\n") -endf -" vim:noet:sw=4:ts=4:ft=vim diff --git a/.vim/autoload/objc/man.vim b/.vim/autoload/objc/man.vim deleted file mode 100644 index 8fffa29..0000000 --- a/.vim/autoload/objc/man.vim +++ /dev/null @@ -1,160 +0,0 @@ -" File: objc#man.vim (part of the cocoa.vim plugin) -" Author: Michael Sanders (msanders42 [at] gmail [dot] com) -" Description: Allows you to look up Cocoa API docs in Vim. -" Last Updated: June 30, 2009 -" NOTE: See http://mymacinations.com/2008/02/06/changing-the-systems-default-settings-for-html-files-safe/ -" for removing the annoying security alert in Leopard. - -" Return all matches in for ":CocoaDoc <tab>" sorted by length. -fun objc#man#Completion(ArgLead, CmdLine, CursorPos) - return system('grep -ho "^'.a:ArgLead.'\w*" ~/.vim/lib/cocoa_indexes/*.txt'. - \ "| perl -e 'print sort {length $a <=> length $b} <>'") -endf - -let s:docsets = [] -for path in ['/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset', - \ '/Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone3_0.iPhoneLibrary.docset'] - if isdirectory(path) - call add(s:docsets, path) - endif -endfor - -let s:docset_cmd = '/Developer/usr/bin/docsetutil search -skip-text -query ' - -fun s:OpenFile(file) - if a:file =~ '/.*/man/' - exe ':!'.substitute(&kp, '^man -s', 'man', '').' '.a:file - else - " /usr/bin/open strips the #fragments in file:// URLs, which we need, - " so I'm using applescript instead. - call system('osascript -e ''open location "file://'.a:file.'"'' &') - endif -endf - -fun objc#man#ShowDoc(...) - let word = a:0 ? a:1 : matchstr(getline('.'), '\<\w*\%'.col('.').'c\w\+:\=') - - " Look up the whole method if it takes multiple arguments. - if !a:0 && word[len(word) - 1] == ':' - let word = s:GetMethodName() - endif - - if word == '' - if !a:0 " Mimic K if using it as such - echoh ErrorMsg - echo 'E349: No identifier under cursor' - echoh None - endif - return - endif - - let references = {} - - " First check Cocoa docs for word using docsetutil - for docset in s:docsets - let response = split(system(s:docset_cmd.word.' '.docset), "\n") - let docset .= '/Contents/Resources/Documents/' " Actual path of files - for line in response - " Format string is: " Language/type/class/word path" - let path = matchstr(line, '\S*$') - if path[0] != '/' | let path = docset.path | endif - if has_key(references, path) | continue | endif " Ignore duplicate entries - - let [lang, type, class] = split(matchstr(line, '^ \zs*\S*'), '/')[:2] - " If no class if given use type instead - if class == '-' | let class = type | endif - let references[path] = {'lang': lang, 'class': class} - endfor - endfor - - " Then try man - let man = system('man -S2:3 -aW '.word) - if man !~ '^No manual entry' - for path in split(man, "\n") - if !has_key(references, path) - let references[path] = {'lang': 'C', 'class': 'man'} - endif - endfor - endif - - if len(references) == 1 - return s:OpenFile(keys(references)[0]) - elseif !empty(references) - echoh ModeMsg | echo word | echoh None - return s:ChooseFrom(references) - else - echoh WarningMsg - echo "Can't find documentation for ".word - echoh None - endif -endf - -fun s:ChooseFrom(references) - let type_abbr = {'cl' : 'Class', 'intf' : 'Protocol', 'cat' : 'Category', - \ 'intfm' : 'Method', 'instm' : 'Method', 'econst' : 'Enum', - \ 'tdef' : 'Typedef', 'macro' : 'Macro', 'data' : 'Data', - \ 'func' : 'Function'} - let inputlist = [] - " Don't display "Objective-C" if all items are objc - let show_lang = !AllKeysEqual(values(a:references), 'lang', 'Objective-C') - let i = 1 - for ref in values(a:references) - let class = ref.class - if has_key(type_abbr, class) | let class = type_abbr[class] | endif - call add(inputlist, i.'. '.(show_lang ? ref['lang'].' ' : '').class) - let i += 1 - endfor - let num = inputlist(inputlist) - return num ? s:OpenFile(keys(a:references)[num - 1]) : -1 -endf - -fun AllKeysEqual(list, key, item) - for item in a:list - if item[a:key] != a:item - return 0 - endif - endfor - return 1 -endf - -fun s:GetMethodName() - let pos = [line('.'), col('.')] - let startpos = searchpos('\v^\s*-.{-}\w+:|\[\s*\w+\s+\w+:|\]\s*\w+:', 'cbW') - - " Method declaration (- (foo) bar:) - if getline(startpos[0]) =~ '^\s*-.\{-}\w\+:' - let endpos = searchpos('{', 'W') - " Message inside brackets ([foo bar: baz]) - else - let endpos = searchpairpos('\[', '', '\]', 'W') - endif - call cursor(pos) - - if startpos[0] == 0 || endpos[0] == 0 | return '' | endif - let lines = getline(startpos[0], endpos[0]) - - let lines[0] = strpart(lines[0], startpos[1] - 1) - let lines[-1] = strpart(lines[-1], 0, endpos[1]) - - " Ignore outer brackets - let message = substitute(join(lines), '^\[\|\]$', '', '') - " Ignore nested messages [...] - let message = substitute(message, '\[.\{-}\]', '', 'g') - " Ignore strings (could contain colons) - let message = substitute(message, '".\{-}"', '', 'g') - " Ignore @selector(...) - let message = substitute(message, '@selector(.\{-})', '', 'g') - - return s:MatchAll(message, '\w\+:') -endf - -fun s:MatchAll(haystack, needle) - let matches = matchstr(a:haystack, a:needle) - let index = matchend(a:haystack, a:needle) - while index != -1 - let matches .= matchstr(a:haystack, a:needle, index + 1) - let index = matchend(a:haystack, a:needle, index + 1) - endw - return matches -endf -" vim:noet:sw=4:ts=4:ft=vim diff --git a/.vim/autoload/objc/method_builder.vim b/.vim/autoload/objc/method_builder.vim deleted file mode 100644 index 999d38b..0000000 --- a/.vim/autoload/objc/method_builder.vim +++ /dev/null @@ -1,124 +0,0 @@ -" File: objc#method_builder.vim (part of the cocoa.vim plugin) -" Author: Michael Sanders (msanders42 [at] gmail [dot] com) -" Description: Builds an empty implementation (*.m) file given a header (*.h) -" file. When called with no arguments (simply ":BuildMethods"), -" it looks for the corresponding header file of the current *.m -" file (e.g. "foo.m" -> "foo.h"). -" Last Updated: June 03, 2009 -" - make sure you're not in a comment - -" TODO: Relative pathnames -fun objc#method_builder#Completion(ArgLead, CmdLine, CursorPos) - let dir = stridx(a:ArgLead, '/') == -1 ? getcwd() : fnamemodify(a:ArgLead, ':h') - let search = fnamemodify(a:ArgLead, ':t') - let files = split(glob(dir.'/'.search.'*.h') - \ ."\n".glob(dir.'/'.search.'*/'), "\n") - call map(files, 'fnameescape(fnamemodify(v:val, ":."))') - return files -endf - -fun s:Error(msg) - echoh ErrorMsg | echo a:msg | echoh None - return -1 -endf - -fun s:GetDeclarations(file) - let header = readfile(a:file) - let template = [] - let in_comment = 0 - let in_header = 0 - let looking_for_semi = 0 - - for line in header - if in_comment - if stridx(line, '*/') != -1 | let in_comment = 0 | endif - continue " Ignore declarations inside multi-line comments - elseif stridx(line, '/*') != -1 - let in_comment = 1 | continue - endif - - if stridx(line, '@interface') != -1 - let in_header = 1 - let template += ['@implementation'.matchstr(line, '@interface\zs\s\+\w\+'), ''] - continue - elseif in_header && stridx(line, '@end') != -1 - let in_header = 0 - call add(template, '@end') - break " Only process one @interface at a time, for now. - endif - if !in_header | continue | endif - - let first_char = strpart(line, 0, 1) - if first_char == '-' || first_char == '+' || looking_for_semi - let semi_pos = stridx(line, ';') - let looking_for_semi = semi_pos == -1 - if looking_for_semi - call add(template, line) - else - call add(template, strpart(line, 0, semi_pos)) - let template += ['{', "\t", '}', ''] - endif - endif - endfor - return template -endf - -fun objc#method_builder#Build(header) - let headerfile = a:header == '' ? expand('%:p:r').'.h' : a:header - if expand('%:e') != 'm' - return s:Error('Not in an implementation file.') - elseif !filereadable(headerfile) - return s:Error('Could not read header file.') - endif - - let declarations = s:GetDeclarations(headerfile) - - if empty(declarations) - return s:Error('Header file has no method declarations!') - endif - - let len = len(declarations) - let last_change = line('.') - - if search('\V'.substitute(declarations[0], '\s\+', '\\s\\+', '')) - if !searchpair('@implementation', '', '@end', 'W') - return s:Error('Missing @end declaration.') - endif - let i = 2 " Skip past the @implementation line & blank line - let len -= 1 " Skip past @end declaration - let lnum = line('.') - 1 - else - let i = 0 - let lnum = line('.') - endif - let start_line = lnum - - while i < len - let is_method = declarations[i][0] =~ '@\|+\|-' - if !is_method || !search('\V'.substitute(escape(declarations[i], '\'), - \ 'void\|IBAction', '\\(void\\|IBAction\\)', 'g'), 'n') - call append(lnum, declarations[i]) - let lnum += 1 - if is_method | let last_change = lnum | endif - else " Skip method declaration if it is already declared. - if declarations[i][0] == '@' - let i += 1 - else - while declarations[i] != '}' && i < len - let i += 1 - endw - let i += 1 - endif - endif - let i += 1 - endw - call cursor(last_change, 1) - - if lnum == start_line - echoh WarningMsg - let class = matchstr(declarations[0], '@implementation\s\+\zs.*') - echo 'The methods for the "'.class.'" class have already been declared.' - echoh None - endif -endf -" vim:noet:sw=4:ts=4:ft=vim diff --git a/.vim/autoload/objc/method_list.vim b/.vim/autoload/objc/method_list.vim deleted file mode 100644 index 5c7246a..0000000 --- a/.vim/autoload/objc/method_list.vim +++ /dev/null @@ -1,115 +0,0 @@ -" File: objc#method_list.vim (part of the cocoa.vim plugin) -" Author: Michael Sanders (msanders42 [at] gmail [dot] com) -" Description: Opens a split window containing the methods of the current file. -" Last Updated: July 13, 2009 - -au WinLeave Method\ List call<SID>LeaveMethodList() -au WinEnter Method\ List call objc#method_list#Activate(0) - -fun objc#method_list#Activate(update) - let s:opt = {'is':&is, 'hls': &hls} " Save current options. - let s:last_search = @/ - set is nohls - " If methodlist has already been opened, reactivate it. - if exists('s:mlist_buffer') && bufexists(s:mlist_buffer) - let mlist_win = bufwinnr(s:mlist_buffer) - if mlist_win == -1 - sil exe 'belowright sbuf '.s:mlist_buffer - if a:update | call s:UpdateMethodList() | endif - elseif winbufnr(2) == -1 - quit " If no other windows are open, close the method list automatically. - else " If method list is out of focus, bring it back into focus. - exe mlist_win.'winc w' - endif - else " Otherwise, create the method list. - call s:CreateMethodList() - call s:UpdateMethodList() - endif -endf - -fun s:CreateMethodList() - botright new - - let s:sortPref = 0 - let s:mlist_buffer = bufnr('%') - - sil file Method\ List - setl bt=nofile bh=wipe noswf nobl nonu nowrap syn=objc - syn match objcPragmark '^[^-+@].*$' - hi objcPragmark gui=italic term=underline - - nn <silent> <buffer> <cr> :cal<SID>SelectMethod()<cr> - nn <buffer> q <c-w>q - nn <buffer> p <c-w>p - nm <buffer> l p - nm <buffer> <2-leftmouse> <cr> -endf - -" Returns the lines of all the matches in a dictionary -fun s:GetAllMatches(needle) - let startpos = [line('.'), col('.')] - call cursor(1, 1) - - let results = {} - let line = search(a:needle, 'Wc') - let key = matchstr(getline(line), a:needle) - if !s:InComment(line, 1) && key != '' - let results[key] = line - endif - - while 1 - let line = search(a:needle, 'W') - if !line | break | endif - let key = matchstr(getline(line), a:needle) - if !s:InComment(line, 1) && key != '' - let results[key] = line - endif - endw - - call cursor(startpos) - return results -endf - -fun s:InComment(line, col) - return stridx(synIDattr(synID(a:line, a:col, 0), 'name'), 'omment') != -1 -endf - -fun s:UpdateMethodList() - winc p " Go to source file window - let s:methods = s:GetAllMatches('^\v(\@(implementation|interface) \w+|'. - \ '\s*(\+|-).*|#pragma\s+mark\s+\zs.+)') - winc p " Go to method window - - if empty(s:methods) - winc q - echoh WarningMsg - echo 'There are no methods in this file!' - echoh None - return - endif - - call setline(1, sort(keys(s:methods), 's:SortByLineNum')) - exe "norm! \<c-w>".line('$').'_' -endf - -fun s:SortByLineNum(i1, i2) - let line1 = s:methods[a:i1] - let line2 = s:methods[a:i2] - return line1 == line2 ? 0 : line1 > line2 ? 1 : -1 -endf - -fun s:SelectMethod() - let number = s:methods[getline('.')] - winc q - winc p - call cursor(number, 1) -endf - -fun s:LeaveMethodList() - for [option, value] in items(s:opt) - exe 'let &'.option.'='.value - endfor - let @/ = s:last_search == '' ? '' : s:last_search - unl s:opt s:last_search -endf -" vim:noet:sw=4:ts=4:ft=vim diff --git a/.vim/autoload/objc/pum_snippet.vim b/.vim/autoload/objc/pum_snippet.vim deleted file mode 100644 index 3ee2907..0000000 --- a/.vim/autoload/objc/pum_snippet.vim +++ /dev/null @@ -1,87 +0,0 @@ -" File: pum_snippet.vim -" Author: Michael Sanders (msanders42 [at] gmail [dot] com) -" Last Updated: June 12, 2009 -" Description: Uses snipMate to jump through function or method objc -" parameters when autocompleting. Used in cocoacomplete.vim. - -" This function is invoked whenever pum_snippet is to be used; the keys are -" only mapped when used as the trigger, and then immediately unmapped to avoid -" breaking abbreviations, as well as other things. -fun! objc#pum_snippet#Map() - ino <silent> <buffer> <space> <c-r>=objc#pum_snippet#Trigger(' ')<cr> - if !exists('g:SuperTabMappingForward') " Only map tab if not using supertab. - \ || (g:SuperTabMappingForward != '<tab>' && g:SuperTabMappingForward != '<tab>') - ino <silent> <buffer> <tab> <c-r>=objc#pum_snippet#Trigger("\t")<cr> - endif - ino <silent> <buffer> <return> <c-r>=objc#pum_snippet#Trigger("\n")<cr> - let s:start = col('.') - " Completion menu can only be detected when the popup menu is visible, so - " 'menuone' needs to be temporarily set: - let s:cot = &cot - set cot+=menuone -endf - -fun! objc#pum_snippet#Unmap() - call s:UnmapKey('<space>') - call s:UnmapKey('<tab>') - call s:UnmapKey('<return>') -endf - -fun s:UnmapKey(key) - if maparg(a:key, 'i') =~? '^<C-R>=objc#pum_snippet#Trigger(' - sil exe 'iunmap <buffer> '.a:key - endif -endf - -fun! objc#pum_snippet#Trigger(key) - call objc#pum_snippet#Unmap() - if pumvisible() - let line = getline('.') - let col = col('.') - let word = matchstr(line, '\%'.s:start.'c\k\+(.\{-})\%'.col.'c') - if word != '' - let ConvertWord = function('s:ConvertFunction') - elseif match(line, '\%'.s:start.'c\k\+[^()]*:[^()]*\%'.col.'c') != -1 - let word = matchstr(line, '\%'.s:start.'c\k\+[^()]*\%'.col.'c') - let ConvertWord = function('s:ConvertMethod') - endif - if word != '' - call s:ResetOptions() - let col -= len(word) - sil exe 's/\V'.escape(word, '\/').'\%#//' - return snipMate#expandSnip(ConvertWord(word), col) - endif - endif - call s:ResetOptions() - return a:key -endf - -fun s:ResetOptions() - let &cot = s:cot - unl s:start s:cot -endf - -fun s:ConvertFunction(function) - let name = matchstr(a:function, '^\k\+') - let params = matchstr(a:function, '^\k\+(\zs.*') - let snippet = name.'('.substitute(params, '\v(.{-1})(, |\))', '${0:\1}\2', 'g').'${0}' - return s:OrderSnippet(snippet) -endf - -fun s:ConvertMethod(method) - if stridx(a:method, ':') == -1 | return a:method | endif - let snippet = substitute(a:method, '\v\k+:\zs.{-}\ze(\s*\k+:|$)', '${0:&}', 'g') - return s:OrderSnippet(snippet) -endf - -" Converts "${0} foo ${0} bar ..." to "${1} foo ${2} bar", etc. -fun s:OrderSnippet(snippet) - let snippet = a:snippet - let i = 1 - while stridx(snippet, '${0') != -1 - let snippet = substitute(snippet, '${0', '${'.i, '') - let i += 1 - endw - return snippet -endf -" vim:noet:sw=4:ts=4:ft=vim diff --git a/.vim/autoload/pathogen.vim b/.vim/autoload/pathogen.vim deleted file mode 100644 index 16c21fe..0000000 --- a/.vim/autoload/pathogen.vim +++ /dev/null @@ -1,328 +0,0 @@ -" pathogen.vim - path option manipulation -" Maintainer: Tim Pope <http://tpo.pe/> -" Version: 2.2 - -" Install in ~/.vim/autoload (or ~\vimfiles\autoload). -" -" For management of individually installed plugins in ~/.vim/bundle (or -" ~\vimfiles\bundle), adding `call pathogen#infect()` to the top of your -" .vimrc is the only other setup necessary. -" -" The API is documented inline below. For maximum ease of reading, -" :set foldmethod=marker - -if exists("g:loaded_pathogen") || &cp - finish -endif -let g:loaded_pathogen = 1 - -function! s:warn(msg) - if &verbose - echohl WarningMsg - echomsg a:msg - echohl NONE - endif -endfunction - -" Point of entry for basic default usage. Give a relative path to invoke -" pathogen#incubate() (defaults to "bundle/{}"), or an absolute path to invoke -" pathogen#surround(). For backwards compatibility purposes, a full path that -" does not end in {} or * is given to pathogen#runtime_prepend_subdirectories() -" instead. -function! pathogen#infect(...) abort " {{{1 - for path in a:0 ? reverse(copy(a:000)) : ['bundle/{}'] - if path =~# '^[^\\/]\+$' - call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') - call pathogen#incubate(path . '/{}') - elseif path =~# '^[^\\/]\+[\\/]\%({}\|\*\)$' - call pathogen#incubate(path) - elseif path =~# '[\\/]\%({}\|\*\)$' - call pathogen#surround(path) - else - call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') - call pathogen#surround(path . '/{}') - endif - endfor - call pathogen#cycle_filetype() - return '' -endfunction " }}}1 - -" Split a path into a list. -function! pathogen#split(path) abort " {{{1 - if type(a:path) == type([]) | return a:path | endif - let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,') - return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")') -endfunction " }}}1 - -" Convert a list to a path. -function! pathogen#join(...) abort " {{{1 - if type(a:1) == type(1) && a:1 - let i = 1 - let space = ' ' - else - let i = 0 - let space = '' - endif - let path = "" - while i < a:0 - if type(a:000[i]) == type([]) - let list = a:000[i] - let j = 0 - while j < len(list) - let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g') - let path .= ',' . escaped - let j += 1 - endwhile - else - let path .= "," . a:000[i] - endif - let i += 1 - endwhile - return substitute(path,'^,','','') -endfunction " }}}1 - -" Convert a list to a path with escaped spaces for 'path', 'tag', etc. -function! pathogen#legacyjoin(...) abort " {{{1 - return call('pathogen#join',[1] + a:000) -endfunction " }}}1 - -" Remove duplicates from a list. -function! pathogen#uniq(list) abort " {{{1 - let i = 0 - let seen = {} - while i < len(a:list) - if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i]) - call remove(a:list,i) - elseif a:list[i] ==# '' - let i += 1 - let empty = 1 - else - let seen[a:list[i]] = 1 - let i += 1 - endif - endwhile - return a:list -endfunction " }}}1 - -" \ on Windows unless shellslash is set, / everywhere else. -function! pathogen#separator() abort " {{{1 - return !exists("+shellslash") || &shellslash ? '/' : '\' -endfunction " }}}1 - -" Convenience wrapper around glob() which returns a list. -function! pathogen#glob(pattern) abort " {{{1 - let files = split(glob(a:pattern),"\n") - return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")') -endfunction "}}}1 - -" Like pathogen#glob(), only limit the results to directories. -function! pathogen#glob_directories(pattern) abort " {{{1 - return filter(pathogen#glob(a:pattern),'isdirectory(v:val)') -endfunction "}}}1 - -" Turn filetype detection off and back on again if it was already enabled. -function! pathogen#cycle_filetype() " {{{1 - if exists('g:did_load_filetypes') - filetype off - filetype on - endif -endfunction " }}}1 - -" Check if a bundle is disabled. A bundle is considered disabled if it ends -" in a tilde or its basename or full name is included in the list -" g:pathogen_disabled. -function! pathogen#is_disabled(path) " {{{1 - if a:path =~# '\~$' - return 1 - elseif !exists("g:pathogen_disabled") - return 0 - endif - let sep = pathogen#separator() - let blacklist = g:pathogen_disabled - return index(blacklist, strpart(a:path, strridx(a:path, sep)+1)) != -1 && index(blacklist, a:path) != 1 -endfunction "}}}1 - -" Prepend the given directory to the runtime path and append its corresponding -" after directory. If the directory is already included, move it to the -" outermost position. Wildcards are added as is. Ending a path in /{} causes -" all subdirectories to be added (except those in g:pathogen_disabled). -function! pathogen#surround(path) abort " {{{1 - let sep = pathogen#separator() - let rtp = pathogen#split(&rtp) - if a:path =~# '[\\/]{}$' - let path = fnamemodify(a:path[0:-4], ':p:s?[\\/]\=$??') - let before = filter(pathogen#glob_directories(path.sep.'*'), '!pathogen#is_disabled(v:val)') - let after = filter(reverse(pathogen#glob_directories(path.sep."*".sep."after")), '!pathogen#is_disabled(v:val[0:-7])') - call filter(rtp,'v:val[0:strlen(path)-1] !=# path') - else - let path = fnamemodify(a:path, ':p:s?[\\/]\=$??') - let before = [path] - let after = [path . sep . 'after'] - call filter(rtp, 'index(before + after, v:val) == -1') - endif - let &rtp = pathogen#join(before, rtp, after) - return &rtp -endfunction " }}}1 - -" Prepend all subdirectories of path to the rtp, and append all 'after' -" directories in those subdirectories. Deprecated. -function! pathogen#runtime_prepend_subdirectories(path) " {{{1 - call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#surround('.string(a:path.'/{}').')') - return pathogen#surround(a:path . pathogen#separator() . '{}') -endfunction " }}}1 - -" For each directory in the runtime path, add a second entry with the given -" argument appended. If the argument ends in '/{}', add a separate entry for -" each subdirectory. The default argument is 'bundle/{}', which means that -" .vim/bundle/*, $VIM/vimfiles/bundle/*, $VIMRUNTIME/bundle/*, -" $VIM/vim/files/bundle/*/after, and .vim/bundle/*/after will be added (on -" UNIX). -function! pathogen#incubate(...) abort " {{{1 - let sep = pathogen#separator() - let name = a:0 ? a:1 : 'bundle/{}' - if "\n".s:done_bundles =~# "\\M\n".name."\n" - return "" - endif - let s:done_bundles .= name . "\n" - let list = [] - for dir in pathogen#split(&rtp) - if dir =~# '\<after$' - if name =~# '{}$' - let list += filter(pathogen#glob_directories(substitute(dir,'after$',name[0:-3],'').'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir] - else - let list += [dir, substitute(dir, 'after$', '', '') . name . sep . 'after'] - endif - else - if name =~# '{}$' - let list += [dir] + filter(pathogen#glob_directories(dir.sep.name[0:-3].'*[^~]'), '!pathogen#is_disabled(v:val)') - else - let list += [dir . sep . name, dir] - endif - endif - endfor - let &rtp = pathogen#join(pathogen#uniq(list)) - return 1 -endfunction " }}}1 - -" Deprecated alias for pathogen#incubate(). -function! pathogen#runtime_append_all_bundles(...) abort " {{{1 - if a:0 - call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#incubate('.string(a:1.'/{}').')') - else - call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#incubate()') - endif - return call('pathogen#incubate', map(copy(a:000),'v:val . "/{}"')) -endfunction - -let s:done_bundles = '' -" }}}1 - -" Invoke :helptags on all non-$VIM doc directories in runtimepath. -function! pathogen#helptags() abort " {{{1 - let sep = pathogen#separator() - for glob in pathogen#split(&rtp) - for dir in split(glob(glob), "\n") - if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags')) - helptags `=dir.'/doc'` - endif - endfor - endfor -endfunction " }}}1 - -command! -bar Helptags :call pathogen#helptags() - -" Execute the given command. This is basically a backdoor for --remote-expr. -function! pathogen#execute(...) abort " {{{1 - for command in a:000 - execute command - endfor - return '' -endfunction " }}}1 - -" Like findfile(), but hardcoded to use the runtimepath. -function! pathogen#runtime_findfile(file,count) abort "{{{1 - let rtp = pathogen#join(1,pathogen#split(&rtp)) - let file = findfile(a:file,rtp,a:count) - if file ==# '' - return '' - else - return fnamemodify(file,':p') - endif -endfunction " }}}1 - -" Backport of fnameescape(). -function! pathogen#fnameescape(string) abort " {{{1 - if exists('*fnameescape') - return fnameescape(a:string) - elseif a:string ==# '-' - return '\-' - else - return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','') - endif -endfunction " }}}1 - -if exists(':Vedit') - finish -endif - -let s:vopen_warning = 0 - -function! s:find(count,cmd,file,lcd) " {{{1 - let rtp = pathogen#join(1,pathogen#split(&runtimepath)) - let file = pathogen#runtime_findfile(a:file,a:count) - if file ==# '' - return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'" - endif - if !s:vopen_warning - let s:vopen_warning = 1 - let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE' - else - let warning = '' - endif - if a:lcd - let path = file[0:-strlen(a:file)-2] - execute 'lcd `=path`' - return a:cmd.' '.pathogen#fnameescape(a:file) . warning - else - return a:cmd.' '.pathogen#fnameescape(file) . warning - endif -endfunction " }}}1 - -function! s:Findcomplete(A,L,P) " {{{1 - let sep = pathogen#separator() - let cheats = { - \'a': 'autoload', - \'d': 'doc', - \'f': 'ftplugin', - \'i': 'indent', - \'p': 'plugin', - \'s': 'syntax'} - if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0]) - let request = cheats[a:A[0]].a:A[1:-1] - else - let request = a:A - endif - let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*' - let found = {} - for path in pathogen#split(&runtimepath) - let path = expand(path, ':p') - let matches = split(glob(path.sep.pattern),"\n") - call map(matches,'isdirectory(v:val) ? v:val.sep : v:val') - call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]') - for match in matches - let found[match] = 1 - endfor - endfor - return sort(keys(found)) -endfunction " }}}1 - -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1) - -" vim:set et sw=2: diff --git a/.vim/autoload/plug.vim b/.vim/autoload/plug.vim deleted file mode 100644 index 9c3011f..0000000 --- a/.vim/autoload/plug.vim +++ /dev/null @@ -1,2812 +0,0 @@ -" vim-plug: Vim plugin manager -" ============================ -" -" Download plug.vim and put it in ~/.vim/autoload -" -" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ -" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -" -" Edit your .vimrc -" -" call plug#begin('~/.vim/plugged') -" -" " Make sure you use single quotes -" -" " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align -" Plug 'junegunn/vim-easy-align' -" -" " Any valid git URL is allowed -" Plug 'https://github.com/junegunn/vim-github-dashboard.git' -" -" " Multiple Plug commands can be written in a single line using | separators -" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' -" -" " On-demand loading -" Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' } -" Plug 'tpope/vim-fireplace', { 'for': 'clojure' } -" -" " Using a non-default branch -" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } -" -" " Using a tagged release; wildcard allowed (requires git 1.9.2 or above) -" Plug 'fatih/vim-go', { 'tag': '*' } -" -" " Plugin options -" Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } -" -" " Plugin outside ~/.vim/plugged with post-update hook -" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } -" -" " Unmanaged plugin (manually installed and updated) -" Plug '~/my-prototype-plugin' -" -" " Initialize plugin system -" call plug#end() -" -" Then reload .vimrc and :PlugInstall to install plugins. -" -" Plug options: -" -"| Option | Description | -"| ----------------------- | ------------------------------------------------ | -"| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use | -"| `rtp` | Subdirectory that contains Vim plugin | -"| `dir` | Custom directory for the plugin | -"| `as` | Use different name for the plugin | -"| `do` | Post-update hook (string or funcref) | -"| `on` | On-demand loading: Commands or `<Plug>`-mappings | -"| `for` | On-demand loading: File types | -"| `frozen` | Do not update unless explicitly specified | -" -" More information: https://github.com/junegunn/vim-plug -" -" -" Copyright (c) 2017 Junegunn Choi -" -" MIT License -" -" Permission is hereby granted, free of charge, to any person obtaining -" a copy of this software and associated documentation files (the -" "Software"), to deal in the Software without restriction, including -" without limitation the rights to use, copy, modify, merge, publish, -" distribute, sublicense, and/or sell copies of the Software, and to -" permit persons to whom the Software is furnished to do so, subject to -" the following conditions: -" -" The above copyright notice and this permission notice shall be -" included in all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -if exists('g:loaded_plug') - finish -endif -let g:loaded_plug = 1 - -let s:cpo_save = &cpo -set cpo&vim - -let s:plug_src = 'https://github.com/junegunn/vim-plug.git' -let s:plug_tab = get(s:, 'plug_tab', -1) -let s:plug_buf = get(s:, 'plug_buf', -1) -let s:mac_gui = has('gui_macvim') && has('gui_running') -let s:is_win = has('win32') -let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait') && !s:is_win) -let s:vim8 = has('patch-8.0.0039') && exists('*job_start') -if s:is_win && &shellslash - set noshellslash - let s:me = resolve(expand('<sfile>:p')) - set shellslash -else - let s:me = resolve(expand('<sfile>:p')) -endif -let s:base_spec = { 'branch': '', 'frozen': 0 } -let s:TYPE = { -\ 'string': type(''), -\ 'list': type([]), -\ 'dict': type({}), -\ 'funcref': type(function('call')) -\ } -let s:loaded = get(s:, 'loaded', {}) -let s:triggers = get(s:, 'triggers', {}) - -function! s:is_powershell(shell) - return a:shell =~# 'powershell\(\.exe\)\?$' || a:shell =~# 'pwsh\(\.exe\)\?$' -endfunction - -function! s:isabsolute(dir) abort - return a:dir =~# '^/' || (has('win32') && a:dir =~? '^\%(\\\|[A-Z]:\)') -endfunction - -function! s:git_dir(dir) abort - let gitdir = s:trim(a:dir) . '/.git' - if isdirectory(gitdir) - return gitdir - endif - if !filereadable(gitdir) - return '' - endif - let gitdir = matchstr(get(readfile(gitdir), 0, ''), '^gitdir: \zs.*') - if len(gitdir) && !s:isabsolute(gitdir) - let gitdir = a:dir . '/' . gitdir - endif - return isdirectory(gitdir) ? gitdir : '' -endfunction - -function! s:git_origin_url(dir) abort - let gitdir = s:git_dir(a:dir) - let config = gitdir . '/config' - if empty(gitdir) || !filereadable(config) - return '' - endif - return matchstr(join(readfile(config)), '\[remote "origin"\].\{-}url\s*=\s*\zs\S*\ze') -endfunction - -function! s:git_revision(dir) abort - let gitdir = s:git_dir(a:dir) - let head = gitdir . '/HEAD' - if empty(gitdir) || !filereadable(head) - return '' - endif - - let line = get(readfile(head), 0, '') - let ref = matchstr(line, '^ref: \zs.*') - if empty(ref) - return line - endif - - if filereadable(gitdir . '/' . ref) - return get(readfile(gitdir . '/' . ref), 0, '') - endif - - if filereadable(gitdir . '/packed-refs') - for line in readfile(gitdir . '/packed-refs') - if line =~# ' ' . ref - return matchstr(line, '^[0-9a-f]*') - endif - endfor - endif - - return '' -endfunction - -function! s:git_local_branch(dir) abort - let gitdir = s:git_dir(a:dir) - let head = gitdir . '/HEAD' - if empty(gitdir) || !filereadable(head) - return '' - endif - let branch = matchstr(get(readfile(head), 0, ''), '^ref: refs/heads/\zs.*') - return len(branch) ? branch : 'HEAD' -endfunction - -function! s:git_origin_branch(spec) - if len(a:spec.branch) - return a:spec.branch - endif - - " The file may not be present if this is a local repository - let gitdir = s:git_dir(a:spec.dir) - let origin_head = gitdir.'/refs/remotes/origin/HEAD' - if len(gitdir) && filereadable(origin_head) - return matchstr(get(readfile(origin_head), 0, ''), - \ '^ref: refs/remotes/origin/\zs.*') - endif - - " The command may not return the name of a branch in detached HEAD state - let result = s:lines(s:system('git symbolic-ref --short HEAD', a:spec.dir)) - return v:shell_error ? '' : result[-1] -endfunction - -if s:is_win - function! s:plug_call(fn, ...) - let shellslash = &shellslash - try - set noshellslash - return call(a:fn, a:000) - finally - let &shellslash = shellslash - endtry - endfunction -else - function! s:plug_call(fn, ...) - return call(a:fn, a:000) - endfunction -endif - -function! s:plug_getcwd() - return s:plug_call('getcwd') -endfunction - -function! s:plug_fnamemodify(fname, mods) - return s:plug_call('fnamemodify', a:fname, a:mods) -endfunction - -function! s:plug_expand(fmt) - return s:plug_call('expand', a:fmt, 1) -endfunction - -function! s:plug_tempname() - return s:plug_call('tempname') -endfunction - -function! plug#begin(...) - if a:0 > 0 - let s:plug_home_org = a:1 - let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p')) - elseif exists('g:plug_home') - let home = s:path(g:plug_home) - elseif has('nvim') - let home = stdpath('data') . '/plugged' - elseif !empty(&rtp) - let home = s:path(split(&rtp, ',')[0]) . '/plugged' - else - return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.') - endif - if s:plug_fnamemodify(home, ':t') ==# 'plugin' && s:plug_fnamemodify(home, ':h') ==# s:first_rtp - return s:err('Invalid plug home. '.home.' is a standard Vim runtime path and is not allowed.') - endif - - let g:plug_home = home - let g:plugs = {} - let g:plugs_order = [] - let s:triggers = {} - - call s:define_commands() - return 1 -endfunction - -function! s:define_commands() - command! -nargs=+ -bar Plug call plug#(<args>) - if !executable('git') - return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') - endif - if has('win32') - \ && &shellslash - \ && (&shell =~# 'cmd\(\.exe\)\?$' || s:is_powershell(&shell)) - return s:err('vim-plug does not support shell, ' . &shell . ', when shellslash is set.') - endif - if !has('nvim') - \ && (has('win32') || has('win32unix')) - \ && !has('multi_byte') - return s:err('Vim needs +multi_byte feature on Windows to run shell commands. Enable +iconv for best results.') - endif - command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(<bang>0, [<f-args>]) - command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update(<bang>0, [<f-args>]) - command! -nargs=0 -bar -bang PlugClean call s:clean(<bang>0) - command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif - command! -nargs=0 -bar PlugStatus call s:status() - command! -nargs=0 -bar PlugDiff call s:diff() - command! -nargs=? -bar -bang -complete=file PlugSnapshot call s:snapshot(<bang>0, <f-args>) -endfunction - -function! s:to_a(v) - return type(a:v) == s:TYPE.list ? a:v : [a:v] -endfunction - -function! s:to_s(v) - return type(a:v) == s:TYPE.string ? a:v : join(a:v, "\n") . "\n" -endfunction - -function! s:glob(from, pattern) - return s:lines(globpath(a:from, a:pattern)) -endfunction - -function! s:source(from, ...) - let found = 0 - for pattern in a:000 - for vim in s:glob(a:from, pattern) - execute 'source' s:esc(vim) - let found = 1 - endfor - endfor - return found -endfunction - -function! s:assoc(dict, key, val) - let a:dict[a:key] = add(get(a:dict, a:key, []), a:val) -endfunction - -function! s:ask(message, ...) - call inputsave() - echohl WarningMsg - let answer = input(a:message.(a:0 ? ' (y/N/a) ' : ' (y/N) ')) - echohl None - call inputrestore() - echo "\r" - return (a:0 && answer =~? '^a') ? 2 : (answer =~? '^y') ? 1 : 0 -endfunction - -function! s:ask_no_interrupt(...) - try - return call('s:ask', a:000) - catch - return 0 - endtry -endfunction - -function! s:lazy(plug, opt) - return has_key(a:plug, a:opt) && - \ (empty(s:to_a(a:plug[a:opt])) || - \ !isdirectory(a:plug.dir) || - \ len(s:glob(s:rtp(a:plug), 'plugin')) || - \ len(s:glob(s:rtp(a:plug), 'after/plugin'))) -endfunction - -function! plug#end() - if !exists('g:plugs') - return s:err('plug#end() called without calling plug#begin() first') - endif - - if exists('#PlugLOD') - augroup PlugLOD - autocmd! - augroup END - augroup! PlugLOD - endif - let lod = { 'ft': {}, 'map': {}, 'cmd': {} } - - if get(g:, 'did_load_filetypes', 0) - filetype off - endif - for name in g:plugs_order - if !has_key(g:plugs, name) - continue - endif - let plug = g:plugs[name] - if get(s:loaded, name, 0) || !s:lazy(plug, 'on') && !s:lazy(plug, 'for') - let s:loaded[name] = 1 - continue - endif - - if has_key(plug, 'on') - let s:triggers[name] = { 'map': [], 'cmd': [] } - for cmd in s:to_a(plug.on) - if cmd =~? '^<Plug>.\+' - if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i')) - call s:assoc(lod.map, cmd, name) - endif - call add(s:triggers[name].map, cmd) - elseif cmd =~# '^[A-Z]' - let cmd = substitute(cmd, '!*$', '', '') - if exists(':'.cmd) != 2 - call s:assoc(lod.cmd, cmd, name) - endif - call add(s:triggers[name].cmd, cmd) - else - call s:err('Invalid `on` option: '.cmd. - \ '. Should start with an uppercase letter or `<Plug>`.') - endif - endfor - endif - - if has_key(plug, 'for') - let types = s:to_a(plug.for) - if !empty(types) - augroup filetypedetect - call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim') - augroup END - endif - for type in types - call s:assoc(lod.ft, type, name) - endfor - endif - endfor - - for [cmd, names] in items(lod.cmd) - execute printf( - \ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, %s)', - \ cmd, string(cmd), string(names)) - endfor - - for [map, names] in items(lod.map) - for [mode, map_prefix, key_prefix] in - \ [['i', '<C-\><C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] - execute printf( - \ '%snoremap <silent> %s %s:<C-U>call <SID>lod_map(%s, %s, %s, "%s")<CR>', - \ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix) - endfor - endfor - - for [ft, names] in items(lod.ft) - augroup PlugLOD - execute printf('autocmd FileType %s call <SID>lod_ft(%s, %s)', - \ ft, string(ft), string(names)) - augroup END - endfor - - call s:reorg_rtp() - filetype plugin indent on - if has('vim_starting') - if has('syntax') && !exists('g:syntax_on') - syntax enable - end - else - call s:reload_plugins() - endif -endfunction - -function! s:loaded_names() - return filter(copy(g:plugs_order), 'get(s:loaded, v:val, 0)') -endfunction - -function! s:load_plugin(spec) - call s:source(s:rtp(a:spec), 'plugin/**/*.vim', 'after/plugin/**/*.vim') -endfunction - -function! s:reload_plugins() - for name in s:loaded_names() - call s:load_plugin(g:plugs[name]) - endfor -endfunction - -function! s:trim(str) - return substitute(a:str, '[\/]\+$', '', '') -endfunction - -function! s:version_requirement(val, min) - for idx in range(0, len(a:min) - 1) - let v = get(a:val, idx, 0) - if v < a:min[idx] | return 0 - elseif v > a:min[idx] | return 1 - endif - endfor - return 1 -endfunction - -function! s:git_version_requirement(...) - if !exists('s:git_version') - let s:git_version = map(split(split(s:system(['git', '--version']))[2], '\.'), 'str2nr(v:val)') - endif - return s:version_requirement(s:git_version, a:000) -endfunction - -function! s:progress_opt(base) - return a:base && !s:is_win && - \ s:git_version_requirement(1, 7, 1) ? '--progress' : '' -endfunction - -function! s:rtp(spec) - return s:path(a:spec.dir . get(a:spec, 'rtp', '')) -endfunction - -if s:is_win - function! s:path(path) - return s:trim(substitute(a:path, '/', '\', 'g')) - endfunction - - function! s:dirpath(path) - return s:path(a:path) . '\' - endfunction - - function! s:is_local_plug(repo) - return a:repo =~? '^[a-z]:\|^[%~]' - endfunction - - " Copied from fzf - function! s:wrap_cmds(cmds) - let cmds = [ - \ '@echo off', - \ 'setlocal enabledelayedexpansion'] - \ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) - \ + ['endlocal'] - if has('iconv') - if !exists('s:codepage') - let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0) - endif - return map(cmds, printf('iconv(v:val."\r", "%s", "cp%d")', &encoding, s:codepage)) - endif - return map(cmds, 'v:val."\r"') - endfunction - - function! s:batchfile(cmd) - let batchfile = s:plug_tempname().'.bat' - call writefile(s:wrap_cmds(a:cmd), batchfile) - let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 0}) - if s:is_powershell(&shell) - let cmd = '& ' . cmd - endif - return [batchfile, cmd] - endfunction -else - function! s:path(path) - return s:trim(a:path) - endfunction - - function! s:dirpath(path) - return substitute(a:path, '[/\\]*$', '/', '') - endfunction - - function! s:is_local_plug(repo) - return a:repo[0] =~ '[/$~]' - endfunction -endif - -function! s:err(msg) - echohl ErrorMsg - echom '[vim-plug] '.a:msg - echohl None -endfunction - -function! s:warn(cmd, msg) - echohl WarningMsg - execute a:cmd 'a:msg' - echohl None -endfunction - -function! s:esc(path) - return escape(a:path, ' ') -endfunction - -function! s:escrtp(path) - return escape(a:path, ' ,') -endfunction - -function! s:remove_rtp() - for name in s:loaded_names() - let rtp = s:rtp(g:plugs[name]) - execute 'set rtp-='.s:escrtp(rtp) - let after = globpath(rtp, 'after') - if isdirectory(after) - execute 'set rtp-='.s:escrtp(after) - endif - endfor -endfunction - -function! s:reorg_rtp() - if !empty(s:first_rtp) - execute 'set rtp-='.s:first_rtp - execute 'set rtp-='.s:last_rtp - endif - - " &rtp is modified from outside - if exists('s:prtp') && s:prtp !=# &rtp - call s:remove_rtp() - unlet! s:middle - endif - - let s:middle = get(s:, 'middle', &rtp) - let rtps = map(s:loaded_names(), 's:rtp(g:plugs[v:val])') - let afters = filter(map(copy(rtps), 'globpath(v:val, "after")'), '!empty(v:val)') - let rtp = join(map(rtps, 'escape(v:val, ",")'), ',') - \ . ','.s:middle.',' - \ . join(map(afters, 'escape(v:val, ",")'), ',') - let &rtp = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\|,$', '', 'g') - let s:prtp = &rtp - - if !empty(s:first_rtp) - execute 'set rtp^='.s:first_rtp - execute 'set rtp+='.s:last_rtp - endif -endfunction - -function! s:doautocmd(...) - if exists('#'.join(a:000, '#')) - execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '<nomodeline>' : '') join(a:000) - endif -endfunction - -function! s:dobufread(names) - for name in a:names - let path = s:rtp(g:plugs[name]) - for dir in ['ftdetect', 'ftplugin', 'after/ftdetect', 'after/ftplugin'] - if len(finddir(dir, path)) - if exists('#BufRead') - doautocmd BufRead - endif - return - endif - endfor - endfor -endfunction - -function! plug#load(...) - if a:0 == 0 - return s:err('Argument missing: plugin name(s) required') - endif - if !exists('g:plugs') - return s:err('plug#begin was not called') - endif - let names = a:0 == 1 && type(a:1) == s:TYPE.list ? a:1 : a:000 - let unknowns = filter(copy(names), '!has_key(g:plugs, v:val)') - if !empty(unknowns) - let s = len(unknowns) > 1 ? 's' : '' - return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', '))) - end - let unloaded = filter(copy(names), '!get(s:loaded, v:val, 0)') - if !empty(unloaded) - for name in unloaded - call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - endfor - call s:dobufread(unloaded) - return 1 - end - return 0 -endfunction - -function! s:remove_triggers(name) - if !has_key(s:triggers, a:name) - return - endif - for cmd in s:triggers[a:name].cmd - execute 'silent! delc' cmd - endfor - for map in s:triggers[a:name].map - execute 'silent! unmap' map - execute 'silent! iunmap' map - endfor - call remove(s:triggers, a:name) -endfunction - -function! s:lod(names, types, ...) - for name in a:names - call s:remove_triggers(name) - let s:loaded[name] = 1 - endfor - call s:reorg_rtp() - - for name in a:names - let rtp = s:rtp(g:plugs[name]) - for dir in a:types - call s:source(rtp, dir.'/**/*.vim') - endfor - if a:0 - if !s:source(rtp, a:1) && !empty(s:glob(rtp, a:2)) - execute 'runtime' a:1 - endif - call s:source(rtp, a:2) - endif - call s:doautocmd('User', name) - endfor -endfunction - -function! s:lod_ft(pat, names) - let syn = 'syntax/'.a:pat.'.vim' - call s:lod(a:names, ['plugin', 'after/plugin'], syn, 'after/'.syn) - execute 'autocmd! PlugLOD FileType' a:pat - call s:doautocmd('filetypeplugin', 'FileType') - call s:doautocmd('filetypeindent', 'FileType') -endfunction - -function! s:lod_cmd(cmd, bang, l1, l2, args, names) - call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - call s:dobufread(a:names) - execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) -endfunction - -function! s:lod_map(map, names, with_prefix, prefix) - call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - call s:dobufread(a:names) - let extra = '' - while 1 - let c = getchar(0) - if c == 0 - break - endif - let extra .= nr2char(c) - endwhile - - if a:with_prefix - let prefix = v:count ? v:count : '' - let prefix .= '"'.v:register.a:prefix - if mode(1) == 'no' - if v:operator == 'c' - let prefix = "\<esc>" . prefix - endif - let prefix .= v:operator - endif - call feedkeys(prefix, 'n') - endif - call feedkeys(substitute(a:map, '^<Plug>', "\<Plug>", '') . extra) -endfunction - -function! plug#(repo, ...) - if a:0 > 1 - return s:err('Invalid number of arguments (1..2)') - endif - - try - let repo = s:trim(a:repo) - let opts = a:0 == 1 ? s:parse_options(a:1) : s:base_spec - let name = get(opts, 'as', s:plug_fnamemodify(repo, ':t:s?\.git$??')) - let spec = extend(s:infer_properties(name, repo), opts) - if !has_key(g:plugs, name) - call add(g:plugs_order, name) - endif - let g:plugs[name] = spec - let s:loaded[name] = get(s:loaded, name, 0) - catch - return s:err(repo . ' ' . v:exception) - endtry -endfunction - -function! s:parse_options(arg) - let opts = copy(s:base_spec) - let type = type(a:arg) - let opt_errfmt = 'Invalid argument for "%s" option of :Plug (expected: %s)' - if type == s:TYPE.string - if empty(a:arg) - throw printf(opt_errfmt, 'tag', 'string') - endif - let opts.tag = a:arg - elseif type == s:TYPE.dict - for opt in ['branch', 'tag', 'commit', 'rtp', 'dir', 'as'] - if has_key(a:arg, opt) - \ && (type(a:arg[opt]) != s:TYPE.string || empty(a:arg[opt])) - throw printf(opt_errfmt, opt, 'string') - endif - endfor - for opt in ['on', 'for'] - if has_key(a:arg, opt) - \ && type(a:arg[opt]) != s:TYPE.list - \ && (type(a:arg[opt]) != s:TYPE.string || empty(a:arg[opt])) - throw printf(opt_errfmt, opt, 'string or list') - endif - endfor - if has_key(a:arg, 'do') - \ && type(a:arg.do) != s:TYPE.funcref - \ && (type(a:arg.do) != s:TYPE.string || empty(a:arg.do)) - throw printf(opt_errfmt, 'do', 'string or funcref') - endif - call extend(opts, a:arg) - if has_key(opts, 'dir') - let opts.dir = s:dirpath(s:plug_expand(opts.dir)) - endif - else - throw 'Invalid argument type (expected: string or dictionary)' - endif - return opts -endfunction - -function! s:infer_properties(name, repo) - let repo = a:repo - if s:is_local_plug(repo) - return { 'dir': s:dirpath(s:plug_expand(repo)) } - else - if repo =~ ':' - let uri = repo - else - if repo !~ '/' - throw printf('Invalid argument: %s (implicit `vim-scripts'' expansion is deprecated)', repo) - endif - let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git') - let uri = printf(fmt, repo) - endif - return { 'dir': s:dirpath(g:plug_home.'/'.a:name), 'uri': uri } - endif -endfunction - -function! s:install(force, names) - call s:update_impl(0, a:force, a:names) -endfunction - -function! s:update(force, names) - call s:update_impl(1, a:force, a:names) -endfunction - -function! plug#helptags() - if !exists('g:plugs') - return s:err('plug#begin was not called') - endif - for spec in values(g:plugs) - let docd = join([s:rtp(spec), 'doc'], '/') - if isdirectory(docd) - silent! execute 'helptags' s:esc(docd) - endif - endfor - return 1 -endfunction - -function! s:syntax() - syntax clear - syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber - syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX - syn match plugNumber /[0-9]\+[0-9.]*/ contained - syn match plugBracket /[[\]]/ contained - syn match plugX /x/ contained - syn match plugDash /^-\{1}\ / - syn match plugPlus /^+/ - syn match plugStar /^*/ - syn match plugMessage /\(^- \)\@<=.*/ - syn match plugName /\(^- \)\@<=[^ ]*:/ - syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ - syn match plugTag /(tag: [^)]\+)/ - syn match plugInstall /\(^+ \)\@<=[^:]*/ - syn match plugUpdate /\(^* \)\@<=[^:]*/ - syn match plugCommit /^ \X*[0-9a-f]\{7,9} .*/ contains=plugRelDate,plugEdge,plugTag - syn match plugEdge /^ \X\+$/ - syn match plugEdge /^ \X*/ contained nextgroup=plugSha - syn match plugSha /[0-9a-f]\{7,9}/ contained - syn match plugRelDate /([^)]*)$/ contained - syn match plugNotLoaded /(not loaded)$/ - syn match plugError /^x.*/ - syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ - syn match plugH2 /^.*:\n-\+$/ - syn match plugH2 /^-\{2,}/ - syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean - hi def link plug1 Title - hi def link plug2 Repeat - hi def link plugH2 Type - hi def link plugX Exception - hi def link plugBracket Structure - hi def link plugNumber Number - - hi def link plugDash Special - hi def link plugPlus Constant - hi def link plugStar Boolean - - hi def link plugMessage Function - hi def link plugName Label - hi def link plugInstall Function - hi def link plugUpdate Type - - hi def link plugError Error - hi def link plugDeleted Ignore - hi def link plugRelDate Comment - hi def link plugEdge PreProc - hi def link plugSha Identifier - hi def link plugTag Constant - - hi def link plugNotLoaded Comment -endfunction - -function! s:lpad(str, len) - return a:str . repeat(' ', a:len - len(a:str)) -endfunction - -function! s:lines(msg) - return split(a:msg, "[\r\n]") -endfunction - -function! s:lastline(msg) - return get(s:lines(a:msg), -1, '') -endfunction - -function! s:new_window() - execute get(g:, 'plug_window', 'vertical topleft new') -endfunction - -function! s:plug_window_exists() - let buflist = tabpagebuflist(s:plug_tab) - return !empty(buflist) && index(buflist, s:plug_buf) >= 0 -endfunction - -function! s:switch_in() - if !s:plug_window_exists() - return 0 - endif - - if winbufnr(0) != s:plug_buf - let s:pos = [tabpagenr(), winnr(), winsaveview()] - execute 'normal!' s:plug_tab.'gt' - let winnr = bufwinnr(s:plug_buf) - execute winnr.'wincmd w' - call add(s:pos, winsaveview()) - else - let s:pos = [winsaveview()] - endif - - setlocal modifiable - return 1 -endfunction - -function! s:switch_out(...) - call winrestview(s:pos[-1]) - setlocal nomodifiable - if a:0 > 0 - execute a:1 - endif - - if len(s:pos) > 1 - execute 'normal!' s:pos[0].'gt' - execute s:pos[1] 'wincmd w' - call winrestview(s:pos[2]) - endif -endfunction - -function! s:finish_bindings() - nnoremap <silent> <buffer> R :call <SID>retry()<cr> - nnoremap <silent> <buffer> D :PlugDiff<cr> - nnoremap <silent> <buffer> S :PlugStatus<cr> - nnoremap <silent> <buffer> U :call <SID>status_update()<cr> - xnoremap <silent> <buffer> U :call <SID>status_update()<cr> - nnoremap <silent> <buffer> ]] :silent! call <SID>section('')<cr> - nnoremap <silent> <buffer> [[ :silent! call <SID>section('b')<cr> -endfunction - -function! s:prepare(...) - if empty(s:plug_getcwd()) - throw 'Invalid current working directory. Cannot proceed.' - endif - - for evar in ['$GIT_DIR', '$GIT_WORK_TREE'] - if exists(evar) - throw evar.' detected. Cannot proceed.' - endif - endfor - - call s:job_abort() - if s:switch_in() - if b:plug_preview == 1 - pc - endif - enew - else - call s:new_window() - endif - - nnoremap <silent> <buffer> q :call <SID>close_pane()<cr> - if a:0 == 0 - call s:finish_bindings() - endif - let b:plug_preview = -1 - let s:plug_tab = tabpagenr() - let s:plug_buf = winbufnr(0) - call s:assign_name() - - for k in ['<cr>', 'L', 'o', 'X', 'd', 'dd'] - execute 'silent! unmap <buffer>' k - endfor - setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline modifiable nospell - if exists('+colorcolumn') - setlocal colorcolumn= - endif - setf vim-plug - if exists('g:syntax_on') - call s:syntax() - endif -endfunction - -function! s:close_pane() - if b:plug_preview == 1 - pc - let b:plug_preview = -1 - else - bd - endif -endfunction - -function! s:assign_name() - " Assign buffer name - let prefix = '[Plugins]' - let name = prefix - let idx = 2 - while bufexists(name) - let name = printf('%s (%s)', prefix, idx) - let idx = idx + 1 - endwhile - silent! execute 'f' fnameescape(name) -endfunction - -function! s:chsh(swap) - let prev = [&shell, &shellcmdflag, &shellredir] - if !s:is_win - set shell=sh - endif - if a:swap - if s:is_powershell(&shell) - let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s' - elseif &shell =~# 'sh' || &shell =~# 'cmd\(\.exe\)\?$' - set shellredir=>%s\ 2>&1 - endif - endif - return prev -endfunction - -function! s:bang(cmd, ...) - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(a:0) - " FIXME: Escaping is incomplete. We could use shellescape with eval, - " but it won't work on Windows. - let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd - if s:is_win - let [batchfile, cmd] = s:batchfile(cmd) - endif - let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%') - execute "normal! :execute g:_plug_bang\<cr>\<cr>" - finally - unlet g:_plug_bang - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry - return v:shell_error ? 'Exit status: ' . v:shell_error : '' -endfunction - -function! s:regress_bar() - let bar = substitute(getline(2)[1:-2], '.*\zs=', 'x', '') - call s:progress_bar(2, bar, len(bar)) -endfunction - -function! s:is_updated(dir) - return !empty(s:system_chomp(['git', 'log', '--pretty=format:%h', 'HEAD...HEAD@{1}'], a:dir)) -endfunction - -function! s:do(pull, force, todo) - for [name, spec] in items(a:todo) - if !isdirectory(spec.dir) - continue - endif - let installed = has_key(s:update.new, name) - let updated = installed ? 0 : - \ (a:pull && index(s:update.errors, name) < 0 && s:is_updated(spec.dir)) - if a:force || installed || updated - execute 'cd' s:esc(spec.dir) - call append(3, '- Post-update hook for '. name .' ... ') - let error = '' - let type = type(spec.do) - if type == s:TYPE.string - if spec.do[0] == ':' - if !get(s:loaded, name, 0) - let s:loaded[name] = 1 - call s:reorg_rtp() - endif - call s:load_plugin(spec) - try - execute spec.do[1:] - catch - let error = v:exception - endtry - if !s:plug_window_exists() - cd - - throw 'Warning: vim-plug was terminated by the post-update hook of '.name - endif - else - let error = s:bang(spec.do) - endif - elseif type == s:TYPE.funcref - try - call s:load_plugin(spec) - let status = installed ? 'installed' : (updated ? 'updated' : 'unchanged') - call spec.do({ 'name': name, 'status': status, 'force': a:force }) - catch - let error = v:exception - endtry - else - let error = 'Invalid hook type' - endif - call s:switch_in() - call setline(4, empty(error) ? (getline(4) . 'OK') - \ : ('x' . getline(4)[1:] . error)) - if !empty(error) - call add(s:update.errors, name) - call s:regress_bar() - endif - cd - - endif - endfor -endfunction - -function! s:hash_match(a, b) - return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 -endfunction - -function! s:checkout(spec) - let sha = a:spec.commit - let output = s:git_revision(a:spec.dir) - if !empty(output) && !s:hash_match(sha, s:lines(output)[0]) - let credential_helper = s:git_version_requirement(2) ? '-c credential.helper= ' : '' - let output = s:system( - \ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) - endif - return output -endfunction - -function! s:finish(pull) - let new_frozen = len(filter(keys(s:update.new), 'g:plugs[v:val].frozen')) - if new_frozen - let s = new_frozen > 1 ? 's' : '' - call append(3, printf('- Installed %d frozen plugin%s', new_frozen, s)) - endif - call append(3, '- Finishing ... ') | 4 - redraw - call plug#helptags() - call plug#end() - call setline(4, getline(4) . 'Done!') - redraw - let msgs = [] - if !empty(s:update.errors) - call add(msgs, "Press 'R' to retry.") - endif - if a:pull && len(s:update.new) < len(filter(getline(5, '$'), - \ "v:val =~ '^- ' && v:val !~# 'Already up.to.date'")) - call add(msgs, "Press 'D' to see the updated changes.") - endif - echo join(msgs, ' ') - call s:finish_bindings() -endfunction - -function! s:retry() - if empty(s:update.errors) - return - endif - echo - call s:update_impl(s:update.pull, s:update.force, - \ extend(copy(s:update.errors), [s:update.threads])) -endfunction - -function! s:is_managed(name) - return has_key(g:plugs[a:name], 'uri') -endfunction - -function! s:names(...) - return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)')) -endfunction - -function! s:check_ruby() - silent! ruby require 'thread'; VIM::command("let g:plug_ruby = '#{RUBY_VERSION}'") - if !exists('g:plug_ruby') - redraw! - return s:warn('echom', 'Warning: Ruby interface is broken') - endif - let ruby_version = split(g:plug_ruby, '\.') - unlet g:plug_ruby - return s:version_requirement(ruby_version, [1, 8, 7]) -endfunction - -function! s:update_impl(pull, force, args) abort - let sync = index(a:args, '--sync') >= 0 || has('vim_starting') - let args = filter(copy(a:args), 'v:val != "--sync"') - let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ? - \ remove(args, -1) : get(g:, 'plug_threads', 16) - - let managed = filter(copy(g:plugs), 's:is_managed(v:key)') - let todo = empty(args) ? filter(managed, '!v:val.frozen || !isdirectory(v:val.dir)') : - \ filter(managed, 'index(args, v:key) >= 0') - - if empty(todo) - return s:warn('echo', 'No plugin to '. (a:pull ? 'update' : 'install')) - endif - - if !s:is_win && s:git_version_requirement(2, 3) - let s:git_terminal_prompt = exists('$GIT_TERMINAL_PROMPT') ? $GIT_TERMINAL_PROMPT : '' - let $GIT_TERMINAL_PROMPT = 0 - for plug in values(todo) - let plug.uri = substitute(plug.uri, - \ '^https://git::@github\.com', 'https://github.com', '') - endfor - endif - - if !isdirectory(g:plug_home) - try - call mkdir(g:plug_home, 'p') - catch - return s:err(printf('Invalid plug directory: %s. '. - \ 'Try to call plug#begin with a valid directory', g:plug_home)) - endtry - endif - - if has('nvim') && !exists('*jobwait') && threads > 1 - call s:warn('echom', '[vim-plug] Update Neovim for parallel installer') - endif - - let use_job = s:nvim || s:vim8 - let python = (has('python') || has('python3')) && !use_job - let ruby = has('ruby') && !use_job && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && threads > 1 && s:check_ruby() - - let s:update = { - \ 'start': reltime(), - \ 'all': todo, - \ 'todo': copy(todo), - \ 'errors': [], - \ 'pull': a:pull, - \ 'force': a:force, - \ 'new': {}, - \ 'threads': (python || ruby || use_job) ? min([len(todo), threads]) : 1, - \ 'bar': '', - \ 'fin': 0 - \ } - - call s:prepare(1) - call append(0, ['', '']) - normal! 2G - silent! redraw - - " Set remote name, overriding a possible user git config's clone.defaultRemoteName - let s:clone_opt = ['--origin', 'origin'] - if get(g:, 'plug_shallow', 1) - call extend(s:clone_opt, ['--depth', '1']) - if s:git_version_requirement(1, 7, 10) - call add(s:clone_opt, '--no-single-branch') - endif - endif - - if has('win32unix') || has('wsl') - call extend(s:clone_opt, ['-c', 'core.eol=lf', '-c', 'core.autocrlf=input']) - endif - - let s:submodule_opt = s:git_version_requirement(2, 8) ? ' --jobs='.threads : '' - - " Python version requirement (>= 2.7) - if python && !has('python3') && !ruby && !use_job && s:update.threads > 1 - redir => pyv - silent python import platform; print platform.python_version() - redir END - let python = s:version_requirement( - \ map(split(split(pyv)[0], '\.'), 'str2nr(v:val)'), [2, 6]) - endif - - if (python || ruby) && s:update.threads > 1 - try - let imd = &imd - if s:mac_gui - set noimd - endif - if ruby - call s:update_ruby() - else - call s:update_python() - endif - catch - let lines = getline(4, '$') - let printed = {} - silent! 4,$d _ - for line in lines - let name = s:extract_name(line, '.', '') - if empty(name) || !has_key(printed, name) - call append('$', line) - if !empty(name) - let printed[name] = 1 - if line[0] == 'x' && index(s:update.errors, name) < 0 - call add(s:update.errors, name) - end - endif - endif - endfor - finally - let &imd = imd - call s:update_finish() - endtry - else - call s:update_vim() - while use_job && sync - sleep 100m - if s:update.fin - break - endif - endwhile - endif -endfunction - -function! s:log4(name, msg) - call setline(4, printf('- %s (%s)', a:msg, a:name)) - redraw -endfunction - -function! s:update_finish() - if exists('s:git_terminal_prompt') - let $GIT_TERMINAL_PROMPT = s:git_terminal_prompt - endif - if s:switch_in() - call append(3, '- Updating ...') | 4 - for [name, spec] in items(filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && (s:update.force || s:update.pull || has_key(s:update.new, v:key))')) - let [pos, _] = s:logpos(name) - if !pos - continue - endif - if has_key(spec, 'commit') - call s:log4(name, 'Checking out '.spec.commit) - let out = s:checkout(spec) - elseif has_key(spec, 'tag') - let tag = spec.tag - if tag =~ '\*' - let tags = s:lines(s:system('git tag --list '.plug#shellescape(tag).' --sort -version:refname 2>&1', spec.dir)) - if !v:shell_error && !empty(tags) - let tag = tags[0] - call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag)) - call append(3, '') - endif - endif - call s:log4(name, 'Checking out '.tag) - let out = s:system('git checkout -q '.plug#shellescape(tag).' -- 2>&1', spec.dir) - else - let branch = s:git_origin_branch(spec) - call s:log4(name, 'Merging origin/'.s:esc(branch)) - let out = s:system('git checkout -q '.plug#shellescape(branch).' -- 2>&1' - \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only '.plug#shellescape('origin/'.branch).' 2>&1')), spec.dir) - endif - if !v:shell_error && filereadable(spec.dir.'/.gitmodules') && - \ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir)) - call s:log4(name, 'Updating submodules. This may take a while.') - let out .= s:bang('git submodule update --init --recursive'.s:submodule_opt.' 2>&1', spec.dir) - endif - let msg = s:format_message(v:shell_error ? 'x': '-', name, out) - if v:shell_error - call add(s:update.errors, name) - call s:regress_bar() - silent execute pos 'd _' - call append(4, msg) | 4 - elseif !empty(out) - call setline(pos, msg[0]) - endif - redraw - endfor - silent 4 d _ - try - call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && has_key(v:val, "do")')) - catch - call s:warn('echom', v:exception) - call s:warn('echo', '') - return - endtry - call s:finish(s:update.pull) - call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.') - call s:switch_out('normal! gg') - endif -endfunction - -function! s:job_abort() - if (!s:nvim && !s:vim8) || !exists('s:jobs') - return - endif - - for [name, j] in items(s:jobs) - if s:nvim - silent! call jobstop(j.jobid) - elseif s:vim8 - silent! call job_stop(j.jobid) - endif - if j.new - call s:rm_rf(g:plugs[name].dir) - endif - endfor - let s:jobs = {} -endfunction - -function! s:last_non_empty_line(lines) - let len = len(a:lines) - for idx in range(len) - let line = a:lines[len-idx-1] - if !empty(line) - return line - endif - endfor - return '' -endfunction - -function! s:job_out_cb(self, data) abort - let self = a:self - let data = remove(self.lines, -1) . a:data - let lines = map(split(data, "\n", 1), 'split(v:val, "\r", 1)[-1]') - call extend(self.lines, lines) - " To reduce the number of buffer updates - let self.tick = get(self, 'tick', -1) + 1 - if !self.running || self.tick % len(s:jobs) == 0 - let bullet = self.running ? (self.new ? '+' : '*') : (self.error ? 'x' : '-') - let result = self.error ? join(self.lines, "\n") : s:last_non_empty_line(self.lines) - call s:log(bullet, self.name, result) - endif -endfunction - -function! s:job_exit_cb(self, data) abort - let a:self.running = 0 - let a:self.error = a:data != 0 - call s:reap(a:self.name) - call s:tick() -endfunction - -function! s:job_cb(fn, job, ch, data) - if !s:plug_window_exists() " plug window closed - return s:job_abort() - endif - call call(a:fn, [a:job, a:data]) -endfunction - -function! s:nvim_cb(job_id, data, event) dict abort - return (a:event == 'stdout' || a:event == 'stderr') ? - \ s:job_cb('s:job_out_cb', self, 0, join(a:data, "\n")) : - \ s:job_cb('s:job_exit_cb', self, 0, a:data) -endfunction - -function! s:spawn(name, cmd, opts) - let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''], - \ 'new': get(a:opts, 'new', 0) } - let s:jobs[a:name] = job - - if s:nvim - if has_key(a:opts, 'dir') - let job.cwd = a:opts.dir - endif - let argv = a:cmd - call extend(job, { - \ 'on_stdout': function('s:nvim_cb'), - \ 'on_stderr': function('s:nvim_cb'), - \ 'on_exit': function('s:nvim_cb'), - \ }) - let jid = s:plug_call('jobstart', argv, job) - if jid > 0 - let job.jobid = jid - else - let job.running = 0 - let job.error = 1 - let job.lines = [jid < 0 ? argv[0].' is not executable' : - \ 'Invalid arguments (or job table is full)'] - endif - elseif s:vim8 - let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"script": 0})')) - if has_key(a:opts, 'dir') - let cmd = s:with_cd(cmd, a:opts.dir, 0) - endif - let argv = s:is_win ? ['cmd', '/s', '/c', '"'.cmd.'"'] : ['sh', '-c', cmd] - let jid = job_start(s:is_win ? join(argv, ' ') : argv, { - \ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]), - \ 'err_cb': function('s:job_cb', ['s:job_out_cb', job]), - \ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]), - \ 'err_mode': 'raw', - \ 'out_mode': 'raw' - \}) - if job_status(jid) == 'run' - let job.jobid = jid - else - let job.running = 0 - let job.error = 1 - let job.lines = ['Failed to start job'] - endif - else - let job.lines = s:lines(call('s:system', has_key(a:opts, 'dir') ? [a:cmd, a:opts.dir] : [a:cmd])) - let job.error = v:shell_error != 0 - let job.running = 0 - endif -endfunction - -function! s:reap(name) - let job = s:jobs[a:name] - if job.error - call add(s:update.errors, a:name) - elseif get(job, 'new', 0) - let s:update.new[a:name] = 1 - endif - let s:update.bar .= job.error ? 'x' : '=' - - let bullet = job.error ? 'x' : '-' - let result = job.error ? join(job.lines, "\n") : s:last_non_empty_line(job.lines) - call s:log(bullet, a:name, empty(result) ? 'OK' : result) - call s:bar() - - call remove(s:jobs, a:name) -endfunction - -function! s:bar() - if s:switch_in() - let total = len(s:update.all) - call setline(1, (s:update.pull ? 'Updating' : 'Installing'). - \ ' plugins ('.len(s:update.bar).'/'.total.')') - call s:progress_bar(2, s:update.bar, total) - call s:switch_out() - endif -endfunction - -function! s:logpos(name) - let max = line('$') - for i in range(4, max > 4 ? max : 4) - if getline(i) =~# '^[-+x*] '.a:name.':' - for j in range(i + 1, max > 5 ? max : 5) - if getline(j) !~ '^ ' - return [i, j - 1] - endif - endfor - return [i, i] - endif - endfor - return [0, 0] -endfunction - -function! s:log(bullet, name, lines) - if s:switch_in() - let [b, e] = s:logpos(a:name) - if b > 0 - silent execute printf('%d,%d d _', b, e) - if b > winheight('.') - let b = 4 - endif - else - let b = 4 - endif - " FIXME For some reason, nomodifiable is set after :d in vim8 - setlocal modifiable - call append(b - 1, s:format_message(a:bullet, a:name, a:lines)) - call s:switch_out() - endif -endfunction - -function! s:update_vim() - let s:jobs = {} - - call s:bar() - call s:tick() -endfunction - -function! s:tick() - let pull = s:update.pull - let prog = s:progress_opt(s:nvim || s:vim8) -while 1 " Without TCO, Vim stack is bound to explode - if empty(s:update.todo) - if empty(s:jobs) && !s:update.fin - call s:update_finish() - let s:update.fin = 1 - endif - return - endif - - let name = keys(s:update.todo)[0] - let spec = remove(s:update.todo, name) - let new = empty(globpath(spec.dir, '.git', 1)) - - call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...') - redraw - - let has_tag = has_key(spec, 'tag') - if !new - let [error, _] = s:git_validate(spec, 0) - if empty(error) - if pull - let cmd = s:git_version_requirement(2) ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch'] - if has_tag && !empty(globpath(spec.dir, '.git/shallow')) - call extend(cmd, ['--depth', '99999999']) - endif - if !empty(prog) - call add(cmd, prog) - endif - call s:spawn(name, cmd, { 'dir': spec.dir }) - else - let s:jobs[name] = { 'running': 0, 'lines': ['Already installed'], 'error': 0 } - endif - else - let s:jobs[name] = { 'running': 0, 'lines': s:lines(error), 'error': 1 } - endif - else - let cmd = ['git', 'clone'] - if !has_tag - call extend(cmd, s:clone_opt) - endif - if !empty(prog) - call add(cmd, prog) - endif - call s:spawn(name, extend(cmd, [spec.uri, s:trim(spec.dir)]), { 'new': 1 }) - endif - - if !s:jobs[name].running - call s:reap(name) - endif - if len(s:jobs) >= s:update.threads - break - endif -endwhile -endfunction - -function! s:update_python() -let py_exe = has('python') ? 'python' : 'python3' -execute py_exe "<< EOF" -import datetime -import functools -import os -try: - import queue -except ImportError: - import Queue as queue -import random -import re -import shutil -import signal -import subprocess -import tempfile -import threading as thr -import time -import traceback -import vim - -G_NVIM = vim.eval("has('nvim')") == '1' -G_PULL = vim.eval('s:update.pull') == '1' -G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1 -G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)')) -G_CLONE_OPT = ' '.join(vim.eval('s:clone_opt')) -G_PROGRESS = vim.eval('s:progress_opt(1)') -G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads')) -G_STOP = thr.Event() -G_IS_WIN = vim.eval('s:is_win') == '1' - -class PlugError(Exception): - def __init__(self, msg): - self.msg = msg -class CmdTimedOut(PlugError): - pass -class CmdFailed(PlugError): - pass -class InvalidURI(PlugError): - pass -class Action(object): - INSTALL, UPDATE, ERROR, DONE = ['+', '*', 'x', '-'] - -class Buffer(object): - def __init__(self, lock, num_plugs, is_pull): - self.bar = '' - self.event = 'Updating' if is_pull else 'Installing' - self.lock = lock - self.maxy = int(vim.eval('winheight(".")')) - self.num_plugs = num_plugs - - def __where(self, name): - """ Find first line with name in current buffer. Return line num. """ - found, lnum = False, 0 - matcher = re.compile('^[-+x*] {0}:'.format(name)) - for line in vim.current.buffer: - if matcher.search(line) is not None: - found = True - break - lnum += 1 - - if not found: - lnum = -1 - return lnum - - def header(self): - curbuf = vim.current.buffer - curbuf[0] = self.event + ' plugins ({0}/{1})'.format(len(self.bar), self.num_plugs) - - num_spaces = self.num_plugs - len(self.bar) - curbuf[1] = '[{0}{1}]'.format(self.bar, num_spaces * ' ') - - with self.lock: - vim.command('normal! 2G') - vim.command('redraw') - - def write(self, action, name, lines): - first, rest = lines[0], lines[1:] - msg = ['{0} {1}{2}{3}'.format(action, name, ': ' if first else '', first)] - msg.extend([' ' + line for line in rest]) - - try: - if action == Action.ERROR: - self.bar += 'x' - vim.command("call add(s:update.errors, '{0}')".format(name)) - elif action == Action.DONE: - self.bar += '=' - - curbuf = vim.current.buffer - lnum = self.__where(name) - if lnum != -1: # Found matching line num - del curbuf[lnum] - if lnum > self.maxy and action in set([Action.INSTALL, Action.UPDATE]): - lnum = 3 - else: - lnum = 3 - curbuf.append(msg, lnum) - - self.header() - except vim.error: - pass - -class Command(object): - CD = 'cd /d' if G_IS_WIN else 'cd' - - def __init__(self, cmd, cmd_dir=None, timeout=60, cb=None, clean=None): - self.cmd = cmd - if cmd_dir: - self.cmd = '{0} {1} && {2}'.format(Command.CD, cmd_dir, self.cmd) - self.timeout = timeout - self.callback = cb if cb else (lambda msg: None) - self.clean = clean if clean else (lambda: None) - self.proc = None - - @property - def alive(self): - """ Returns true only if command still running. """ - return self.proc and self.proc.poll() is None - - def execute(self, ntries=3): - """ Execute the command with ntries if CmdTimedOut. - Returns the output of the command if no Exception. - """ - attempt, finished, limit = 0, False, self.timeout - - while not finished: - try: - attempt += 1 - result = self.try_command() - finished = True - return result - except CmdTimedOut: - if attempt != ntries: - self.notify_retry() - self.timeout += limit - else: - raise - - def notify_retry(self): - """ Retry required for command, notify user. """ - for count in range(3, 0, -1): - if G_STOP.is_set(): - raise KeyboardInterrupt - msg = 'Timeout. Will retry in {0} second{1} ...'.format( - count, 's' if count != 1 else '') - self.callback([msg]) - time.sleep(1) - self.callback(['Retrying ...']) - - def try_command(self): - """ Execute a cmd & poll for callback. Returns list of output. - Raises CmdFailed -> return code for Popen isn't 0 - Raises CmdTimedOut -> command exceeded timeout without new output - """ - first_line = True - - try: - tfile = tempfile.NamedTemporaryFile(mode='w+b') - preexec_fn = not G_IS_WIN and os.setsid or None - self.proc = subprocess.Popen(self.cmd, stdout=tfile, - stderr=subprocess.STDOUT, - stdin=subprocess.PIPE, shell=True, - preexec_fn=preexec_fn) - thrd = thr.Thread(target=(lambda proc: proc.wait()), args=(self.proc,)) - thrd.start() - - thread_not_started = True - while thread_not_started: - try: - thrd.join(0.1) - thread_not_started = False - except RuntimeError: - pass - - while self.alive: - if G_STOP.is_set(): - raise KeyboardInterrupt - - if first_line or random.random() < G_LOG_PROB: - first_line = False - line = '' if G_IS_WIN else nonblock_read(tfile.name) - if line: - self.callback([line]) - - time_diff = time.time() - os.path.getmtime(tfile.name) - if time_diff > self.timeout: - raise CmdTimedOut(['Timeout!']) - - thrd.join(0.5) - - tfile.seek(0) - result = [line.decode('utf-8', 'replace').rstrip() for line in tfile] - - if self.proc.returncode != 0: - raise CmdFailed([''] + result) - - return result - except: - self.terminate() - raise - - def terminate(self): - """ Terminate process and cleanup. """ - if self.alive: - if G_IS_WIN: - os.kill(self.proc.pid, signal.SIGINT) - else: - os.killpg(self.proc.pid, signal.SIGTERM) - self.clean() - -class Plugin(object): - def __init__(self, name, args, buf_q, lock): - self.name = name - self.args = args - self.buf_q = buf_q - self.lock = lock - self.tag = args.get('tag', 0) - - def manage(self): - try: - if os.path.exists(self.args['dir']): - self.update() - else: - self.install() - with self.lock: - thread_vim_command("let s:update.new['{0}'] = 1".format(self.name)) - except PlugError as exc: - self.write(Action.ERROR, self.name, exc.msg) - except KeyboardInterrupt: - G_STOP.set() - self.write(Action.ERROR, self.name, ['Interrupted!']) - except: - # Any exception except those above print stack trace - msg = 'Trace:\n{0}'.format(traceback.format_exc().rstrip()) - self.write(Action.ERROR, self.name, msg.split('\n')) - raise - - def install(self): - target = self.args['dir'] - if target[-1] == '\\': - target = target[0:-1] - - def clean(target): - def _clean(): - try: - shutil.rmtree(target) - except OSError: - pass - return _clean - - self.write(Action.INSTALL, self.name, ['Installing ...']) - callback = functools.partial(self.write, Action.INSTALL, self.name) - cmd = 'git clone {0} {1} {2} {3} 2>&1'.format( - '' if self.tag else G_CLONE_OPT, G_PROGRESS, self.args['uri'], - esc(target)) - com = Command(cmd, None, G_TIMEOUT, callback, clean(target)) - result = com.execute(G_RETRIES) - self.write(Action.DONE, self.name, result[-1:]) - - def repo_uri(self): - cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url' - command = Command(cmd, self.args['dir'], G_TIMEOUT,) - result = command.execute(G_RETRIES) - return result[-1] - - def update(self): - actual_uri = self.repo_uri() - expect_uri = self.args['uri'] - regex = re.compile(r'^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$') - ma = regex.match(actual_uri) - mb = regex.match(expect_uri) - if ma is None or mb is None or ma.groups() != mb.groups(): - msg = ['', - 'Invalid URI: {0}'.format(actual_uri), - 'Expected {0}'.format(expect_uri), - 'PlugClean required.'] - raise InvalidURI(msg) - - if G_PULL: - self.write(Action.UPDATE, self.name, ['Updating ...']) - callback = functools.partial(self.write, Action.UPDATE, self.name) - fetch_opt = '--depth 99999999' if self.tag and os.path.isfile(os.path.join(self.args['dir'], '.git/shallow')) else '' - cmd = 'git fetch {0} {1} 2>&1'.format(fetch_opt, G_PROGRESS) - com = Command(cmd, self.args['dir'], G_TIMEOUT, callback) - result = com.execute(G_RETRIES) - self.write(Action.DONE, self.name, result[-1:]) - else: - self.write(Action.DONE, self.name, ['Already installed']) - - def write(self, action, name, msg): - self.buf_q.put((action, name, msg)) - -class PlugThread(thr.Thread): - def __init__(self, tname, args): - super(PlugThread, self).__init__() - self.tname = tname - self.args = args - - def run(self): - thr.current_thread().name = self.tname - buf_q, work_q, lock = self.args - - try: - while not G_STOP.is_set(): - name, args = work_q.get_nowait() - plug = Plugin(name, args, buf_q, lock) - plug.manage() - work_q.task_done() - except queue.Empty: - pass - -class RefreshThread(thr.Thread): - def __init__(self, lock): - super(RefreshThread, self).__init__() - self.lock = lock - self.running = True - - def run(self): - while self.running: - with self.lock: - thread_vim_command('noautocmd normal! a') - time.sleep(0.33) - - def stop(self): - self.running = False - -if G_NVIM: - def thread_vim_command(cmd): - vim.session.threadsafe_call(lambda: vim.command(cmd)) -else: - def thread_vim_command(cmd): - vim.command(cmd) - -def esc(name): - return '"' + name.replace('"', '\"') + '"' - -def nonblock_read(fname): - """ Read a file with nonblock flag. Return the last line. """ - fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK) - buf = os.read(fread, 100000).decode('utf-8', 'replace') - os.close(fread) - - line = buf.rstrip('\r\n') - left = max(line.rfind('\r'), line.rfind('\n')) - if left != -1: - left += 1 - line = line[left:] - - return line - -def main(): - thr.current_thread().name = 'main' - nthreads = int(vim.eval('s:update.threads')) - plugs = vim.eval('s:update.todo') - mac_gui = vim.eval('s:mac_gui') == '1' - - lock = thr.Lock() - buf = Buffer(lock, len(plugs), G_PULL) - buf_q, work_q = queue.Queue(), queue.Queue() - for work in plugs.items(): - work_q.put(work) - - start_cnt = thr.active_count() - for num in range(nthreads): - tname = 'PlugT-{0:02}'.format(num) - thread = PlugThread(tname, (buf_q, work_q, lock)) - thread.start() - if mac_gui: - rthread = RefreshThread(lock) - rthread.start() - - while not buf_q.empty() or thr.active_count() != start_cnt: - try: - action, name, msg = buf_q.get(True, 0.25) - buf.write(action, name, ['OK'] if not msg else msg) - buf_q.task_done() - except queue.Empty: - pass - except KeyboardInterrupt: - G_STOP.set() - - if mac_gui: - rthread.stop() - rthread.join() - -main() -EOF -endfunction - -function! s:update_ruby() - ruby << EOF - module PlugStream - SEP = ["\r", "\n", nil] - def get_line - buffer = '' - loop do - char = readchar rescue return - if SEP.include? char.chr - buffer << $/ - break - else - buffer << char - end - end - buffer - end - end unless defined?(PlugStream) - - def esc arg - %["#{arg.gsub('"', '\"')}"] - end - - def killall pid - pids = [pid] - if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM - pids.each { |pid| Process.kill 'INT', pid.to_i rescue nil } - else - unless `which pgrep 2> /dev/null`.empty? - children = pids - until children.empty? - children = children.map { |pid| - `pgrep -P #{pid}`.lines.map { |l| l.chomp } - }.flatten - pids += children - end - end - pids.each { |pid| Process.kill 'TERM', pid.to_i rescue nil } - end - end - - def compare_git_uri a, b - regex = %r{^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$} - regex.match(a).to_a.drop(1) == regex.match(b).to_a.drop(1) - end - - require 'thread' - require 'fileutils' - require 'timeout' - running = true - iswin = VIM::evaluate('s:is_win').to_i == 1 - pull = VIM::evaluate('s:update.pull').to_i == 1 - base = VIM::evaluate('g:plug_home') - all = VIM::evaluate('s:update.todo') - limit = VIM::evaluate('get(g:, "plug_timeout", 60)') - tries = VIM::evaluate('get(g:, "plug_retries", 2)') + 1 - nthr = VIM::evaluate('s:update.threads').to_i - maxy = VIM::evaluate('winheight(".")').to_i - vim7 = VIM::evaluate('v:version').to_i <= 703 && RUBY_PLATFORM =~ /darwin/ - cd = iswin ? 'cd /d' : 'cd' - tot = VIM::evaluate('len(s:update.todo)') || 0 - bar = '' - skip = 'Already installed' - mtx = Mutex.new - take1 = proc { mtx.synchronize { running && all.shift } } - logh = proc { - cnt = bar.length - $curbuf[1] = "#{pull ? 'Updating' : 'Installing'} plugins (#{cnt}/#{tot})" - $curbuf[2] = '[' + bar.ljust(tot) + ']' - VIM::command('normal! 2G') - VIM::command('redraw') - } - where = proc { |name| (1..($curbuf.length)).find { |l| $curbuf[l] =~ /^[-+x*] #{name}:/ } } - log = proc { |name, result, type| - mtx.synchronize do - ing = ![true, false].include?(type) - bar += type ? '=' : 'x' unless ing - b = case type - when :install then '+' when :update then '*' - when true, nil then '-' else - VIM::command("call add(s:update.errors, '#{name}')") - 'x' - end - result = - if type || type.nil? - ["#{b} #{name}: #{result.lines.to_a.last || 'OK'}"] - elsif result =~ /^Interrupted|^Timeout/ - ["#{b} #{name}: #{result}"] - else - ["#{b} #{name}"] + result.lines.map { |l| " " << l } - end - if lnum = where.call(name) - $curbuf.delete lnum - lnum = 4 if ing && lnum > maxy - end - result.each_with_index do |line, offset| - $curbuf.append((lnum || 4) - 1 + offset, line.gsub(/\e\[./, '').chomp) - end - logh.call - end - } - bt = proc { |cmd, name, type, cleanup| - tried = timeout = 0 - begin - tried += 1 - timeout += limit - fd = nil - data = '' - if iswin - Timeout::timeout(timeout) do - tmp = VIM::evaluate('tempname()') - system("(#{cmd}) > #{tmp}") - data = File.read(tmp).chomp - File.unlink tmp rescue nil - end - else - fd = IO.popen(cmd).extend(PlugStream) - first_line = true - log_prob = 1.0 / nthr - while line = Timeout::timeout(timeout) { fd.get_line } - data << line - log.call name, line.chomp, type if name && (first_line || rand < log_prob) - first_line = false - end - fd.close - end - [$? == 0, data.chomp] - rescue Timeout::Error, Interrupt => e - if fd && !fd.closed? - killall fd.pid - fd.close - end - cleanup.call if cleanup - if e.is_a?(Timeout::Error) && tried < tries - 3.downto(1) do |countdown| - s = countdown > 1 ? 's' : '' - log.call name, "Timeout. Will retry in #{countdown} second#{s} ...", type - sleep 1 - end - log.call name, 'Retrying ...', type - retry - end - [false, e.is_a?(Interrupt) ? "Interrupted!" : "Timeout!"] - end - } - main = Thread.current - threads = [] - watcher = Thread.new { - if vim7 - while VIM::evaluate('getchar(1)') - sleep 0.1 - end - else - require 'io/console' # >= Ruby 1.9 - nil until IO.console.getch == 3.chr - end - mtx.synchronize do - running = false - threads.each { |t| t.raise Interrupt } unless vim7 - end - threads.each { |t| t.join rescue nil } - main.kill - } - refresh = Thread.new { - while true - mtx.synchronize do - break unless running - VIM::command('noautocmd normal! a') - end - sleep 0.2 - end - } if VIM::evaluate('s:mac_gui') == 1 - - clone_opt = VIM::evaluate('s:clone_opt').join(' ') - progress = VIM::evaluate('s:progress_opt(1)') - nthr.times do - mtx.synchronize do - threads << Thread.new { - while pair = take1.call - name = pair.first - dir, uri, tag = pair.last.values_at *%w[dir uri tag] - exists = File.directory? dir - ok, result = - if exists - chdir = "#{cd} #{iswin ? dir : esc(dir)}" - ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url", nil, nil, nil - current_uri = data.lines.to_a.last - if !ret - if data =~ /^Interrupted|^Timeout/ - [false, data] - else - [false, [data.chomp, "PlugClean required."].join($/)] - end - elsif !compare_git_uri(current_uri, uri) - [false, ["Invalid URI: #{current_uri}", - "Expected: #{uri}", - "PlugClean required."].join($/)] - else - if pull - log.call name, 'Updating ...', :update - fetch_opt = (tag && File.exist?(File.join(dir, '.git/shallow'))) ? '--depth 99999999' : '' - bt.call "#{chdir} && git fetch #{fetch_opt} #{progress} 2>&1", name, :update, nil - else - [true, skip] - end - end - else - d = esc dir.sub(%r{[\\/]+$}, '') - log.call name, 'Installing ...', :install - bt.call "git clone #{clone_opt unless tag} #{progress} #{uri} #{d} 2>&1", name, :install, proc { - FileUtils.rm_rf dir - } - end - mtx.synchronize { VIM::command("let s:update.new['#{name}'] = 1") } if !exists && ok - log.call name, result, ok - end - } if running - end - end - threads.each { |t| t.join rescue nil } - logh.call - refresh.kill if refresh - watcher.kill -EOF -endfunction - -function! s:shellesc_cmd(arg, script) - let escaped = substitute('"'.a:arg.'"', '[&|<>()@^!"]', '^&', 'g') - return substitute(escaped, '%', (a:script ? '%' : '^') . '&', 'g') -endfunction - -function! s:shellesc_ps1(arg) - return "'".substitute(escape(a:arg, '\"'), "'", "''", 'g')."'" -endfunction - -function! s:shellesc_sh(arg) - return "'".substitute(a:arg, "'", "'\\\\''", 'g')."'" -endfunction - -" Escape the shell argument based on the shell. -" Vim and Neovim's shellescape() are insufficient. -" 1. shellslash determines whether to use single/double quotes. -" Double-quote escaping is fragile for cmd.exe. -" 2. It does not work for powershell. -" 3. It does not work for *sh shells if the command is executed -" via cmd.exe (ie. cmd.exe /c sh -c command command_args) -" 4. It does not support batchfile syntax. -" -" Accepts an optional dictionary with the following keys: -" - shell: same as Vim/Neovim 'shell' option. -" If unset, fallback to 'cmd.exe' on Windows or 'sh'. -" - script: If truthy and shell is cmd.exe, escape for batchfile syntax. -function! plug#shellescape(arg, ...) - if a:arg =~# '^[A-Za-z0-9_/:.-]\+$' - return a:arg - endif - let opts = a:0 > 0 && type(a:1) == s:TYPE.dict ? a:1 : {} - let shell = get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh') - let script = get(opts, 'script', 1) - if shell =~# 'cmd\(\.exe\)\?$' - return s:shellesc_cmd(a:arg, script) - elseif s:is_powershell(shell) - return s:shellesc_ps1(a:arg) - endif - return s:shellesc_sh(a:arg) -endfunction - -function! s:glob_dir(path) - return map(filter(s:glob(a:path, '**'), 'isdirectory(v:val)'), 's:dirpath(v:val)') -endfunction - -function! s:progress_bar(line, bar, total) - call setline(a:line, '[' . s:lpad(a:bar, a:total) . ']') -endfunction - -function! s:compare_git_uri(a, b) - " See `git help clone' - " https:// [user@] github.com[:port] / junegunn/vim-plug [.git] - " [git@] github.com[:port] : junegunn/vim-plug [.git] - " file:// / junegunn/vim-plug [/] - " / junegunn/vim-plug [/] - let pat = '^\%(\w\+://\)\='.'\%([^@/]*@\)\='.'\([^:/]*\%(:[0-9]*\)\=\)'.'[:/]'.'\(.\{-}\)'.'\%(\.git\)\=/\?$' - let ma = matchlist(a:a, pat) - let mb = matchlist(a:b, pat) - return ma[1:2] ==# mb[1:2] -endfunction - -function! s:format_message(bullet, name, message) - if a:bullet != 'x' - return [printf('%s %s: %s', a:bullet, a:name, s:lastline(a:message))] - else - let lines = map(s:lines(a:message), '" ".v:val') - return extend([printf('x %s:', a:name)], lines) - endif -endfunction - -function! s:with_cd(cmd, dir, ...) - let script = a:0 > 0 ? a:1 : 1 - return printf('cd%s %s && %s', s:is_win ? ' /d' : '', plug#shellescape(a:dir, {'script': script}), a:cmd) -endfunction - -function! s:system(cmd, ...) - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(1) - if type(a:cmd) == s:TYPE.list - " Neovim's system() supports list argument to bypass the shell - " but it cannot set the working directory for the command. - " Assume that the command does not rely on the shell. - if has('nvim') && a:0 == 0 - return system(a:cmd) - endif - let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"shell": &shell, "script": 0})')) - if s:is_powershell(&shell) - let cmd = '& ' . cmd - endif - else - let cmd = a:cmd - endif - if a:0 > 0 - let cmd = s:with_cd(cmd, a:1, type(a:cmd) != s:TYPE.list) - endif - if s:is_win && type(a:cmd) != s:TYPE.list - let [batchfile, cmd] = s:batchfile(cmd) - endif - return system(cmd) - finally - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry -endfunction - -function! s:system_chomp(...) - let ret = call('s:system', a:000) - return v:shell_error ? '' : substitute(ret, '\n$', '', '') -endfunction - -function! s:git_validate(spec, check_branch) - let err = '' - if isdirectory(a:spec.dir) - let result = [s:git_local_branch(a:spec.dir), s:git_origin_url(a:spec.dir)] - let remote = result[-1] - if empty(remote) - let err = join([remote, 'PlugClean required.'], "\n") - elseif !s:compare_git_uri(remote, a:spec.uri) - let err = join(['Invalid URI: '.remote, - \ 'Expected: '.a:spec.uri, - \ 'PlugClean required.'], "\n") - elseif a:check_branch && has_key(a:spec, 'commit') - let sha = s:git_revision(a:spec.dir) - if empty(sha) - let err = join(add(result, 'PlugClean required.'), "\n") - elseif !s:hash_match(sha, a:spec.commit) - let err = join([printf('Invalid HEAD (expected: %s, actual: %s)', - \ a:spec.commit[:6], sha[:6]), - \ 'PlugUpdate required.'], "\n") - endif - elseif a:check_branch - let current_branch = result[0] - " Check tag - let origin_branch = s:git_origin_branch(a:spec) - if has_key(a:spec, 'tag') - let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir) - if a:spec.tag !=# tag && a:spec.tag !~ '\*' - let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.', - \ (empty(tag) ? 'N/A' : tag), a:spec.tag) - endif - " Check branch - elseif origin_branch !=# current_branch - let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.', - \ current_branch, origin_branch) - endif - if empty(err) - let [ahead, behind] = split(s:lastline(s:system([ - \ 'git', 'rev-list', '--count', '--left-right', - \ printf('HEAD...origin/%s', origin_branch) - \ ], a:spec.dir)), '\t') - if !v:shell_error && ahead - if behind - " Only mention PlugClean if diverged, otherwise it's likely to be - " pushable (and probably not that messed up). - let err = printf( - \ "Diverged from origin/%s (%d commit(s) ahead and %d commit(s) behind!\n" - \ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', origin_branch, ahead, behind) - else - let err = printf("Ahead of origin/%s by %d commit(s).\n" - \ .'Cannot update until local changes are pushed.', - \ origin_branch, ahead) - endif - endif - endif - endif - else - let err = 'Not found' - endif - return [err, err =~# 'PlugClean'] -endfunction - -function! s:rm_rf(dir) - if isdirectory(a:dir) - return s:system(s:is_win - \ ? 'rmdir /S /Q '.plug#shellescape(a:dir) - \ : ['rm', '-rf', a:dir]) - endif -endfunction - -function! s:clean(force) - call s:prepare() - call append(0, 'Searching for invalid plugins in '.g:plug_home) - call append(1, '') - - " List of valid directories - let dirs = [] - let errs = {} - let [cnt, total] = [0, len(g:plugs)] - for [name, spec] in items(g:plugs) - if !s:is_managed(name) - call add(dirs, spec.dir) - else - let [err, clean] = s:git_validate(spec, 1) - if clean - let errs[spec.dir] = s:lines(err)[0] - else - call add(dirs, spec.dir) - endif - endif - let cnt += 1 - call s:progress_bar(2, repeat('=', cnt), total) - normal! 2G - redraw - endfor - - let allowed = {} - for dir in dirs - let allowed[s:dirpath(s:plug_fnamemodify(dir, ':h:h'))] = 1 - let allowed[dir] = 1 - for child in s:glob_dir(dir) - let allowed[child] = 1 - endfor - endfor - - let todo = [] - let found = sort(s:glob_dir(g:plug_home)) - while !empty(found) - let f = remove(found, 0) - if !has_key(allowed, f) && isdirectory(f) - call add(todo, f) - call append(line('$'), '- ' . f) - if has_key(errs, f) - call append(line('$'), ' ' . errs[f]) - endif - let found = filter(found, 'stridx(v:val, f) != 0') - end - endwhile - - 4 - redraw - if empty(todo) - call append(line('$'), 'Already clean.') - else - let s:clean_count = 0 - call append(3, ['Directories to delete:', '']) - redraw! - if a:force || s:ask_no_interrupt('Delete all directories?') - call s:delete([6, line('$')], 1) - else - call setline(4, 'Cancelled.') - nnoremap <silent> <buffer> d :set opfunc=<sid>delete_op<cr>g@ - nmap <silent> <buffer> dd d_ - xnoremap <silent> <buffer> d :<c-u>call <sid>delete_op(visualmode(), 1)<cr> - echo 'Delete the lines (d{motion}) to delete the corresponding directories' - endif - endif - 4 - setlocal nomodifiable -endfunction - -function! s:delete_op(type, ...) - call s:delete(a:0 ? [line("'<"), line("'>")] : [line("'["), line("']")], 0) -endfunction - -function! s:delete(range, force) - let [l1, l2] = a:range - let force = a:force - let err_count = 0 - while l1 <= l2 - let line = getline(l1) - if line =~ '^- ' && isdirectory(line[2:]) - execute l1 - redraw! - let answer = force ? 1 : s:ask('Delete '.line[2:].'?', 1) - let force = force || answer > 1 - if answer - let err = s:rm_rf(line[2:]) - setlocal modifiable - if empty(err) - call setline(l1, '~'.line[1:]) - let s:clean_count += 1 - else - delete _ - call append(l1 - 1, s:format_message('x', line[1:], err)) - let l2 += len(s:lines(err)) - let err_count += 1 - endif - let msg = printf('Removed %d directories.', s:clean_count) - if err_count > 0 - let msg .= printf(' Failed to remove %d directories.', err_count) - endif - call setline(4, msg) - setlocal nomodifiable - endif - endif - let l1 += 1 - endwhile -endfunction - -function! s:upgrade() - echo 'Downloading the latest version of vim-plug' - redraw - let tmp = s:plug_tempname() - let new = tmp . '/plug.vim' - - try - let out = s:system(['git', 'clone', '--depth', '1', s:plug_src, tmp]) - if v:shell_error - return s:err('Error upgrading vim-plug: '. out) - endif - - if readfile(s:me) ==# readfile(new) - echo 'vim-plug is already up-to-date' - return 0 - else - call rename(s:me, s:me . '.old') - call rename(new, s:me) - unlet g:loaded_plug - echo 'vim-plug has been upgraded' - return 1 - endif - finally - silent! call s:rm_rf(tmp) - endtry -endfunction - -function! s:upgrade_specs() - for spec in values(g:plugs) - let spec.frozen = get(spec, 'frozen', 0) - endfor -endfunction - -function! s:status() - call s:prepare() - call append(0, 'Checking plugins') - call append(1, '') - - let ecnt = 0 - let unloaded = 0 - let [cnt, total] = [0, len(g:plugs)] - for [name, spec] in items(g:plugs) - let is_dir = isdirectory(spec.dir) - if has_key(spec, 'uri') - if is_dir - let [err, _] = s:git_validate(spec, 1) - let [valid, msg] = [empty(err), empty(err) ? 'OK' : err] - else - let [valid, msg] = [0, 'Not found. Try PlugInstall.'] - endif - else - if is_dir - let [valid, msg] = [1, 'OK'] - else - let [valid, msg] = [0, 'Not found.'] - endif - endif - let cnt += 1 - let ecnt += !valid - " `s:loaded` entry can be missing if PlugUpgraded - if is_dir && get(s:loaded, name, -1) == 0 - let unloaded = 1 - let msg .= ' (not loaded)' - endif - call s:progress_bar(2, repeat('=', cnt), total) - call append(3, s:format_message(valid ? '-' : 'x', name, msg)) - normal! 2G - redraw - endfor - call setline(1, 'Finished. '.ecnt.' error(s).') - normal! gg - setlocal nomodifiable - if unloaded - echo "Press 'L' on each line to load plugin, or 'U' to update" - nnoremap <silent> <buffer> L :call <SID>status_load(line('.'))<cr> - xnoremap <silent> <buffer> L :call <SID>status_load(line('.'))<cr> - end -endfunction - -function! s:extract_name(str, prefix, suffix) - return matchstr(a:str, '^'.a:prefix.' \zs[^:]\+\ze:.*'.a:suffix.'$') -endfunction - -function! s:status_load(lnum) - let line = getline(a:lnum) - let name = s:extract_name(line, '-', '(not loaded)') - if !empty(name) - call plug#load(name) - setlocal modifiable - call setline(a:lnum, substitute(line, ' (not loaded)$', '', '')) - setlocal nomodifiable - endif -endfunction - -function! s:status_update() range - let lines = getline(a:firstline, a:lastline) - let names = filter(map(lines, 's:extract_name(v:val, "[x-]", "")'), '!empty(v:val)') - if !empty(names) - echo - execute 'PlugUpdate' join(names) - endif -endfunction - -function! s:is_preview_window_open() - silent! wincmd P - if &previewwindow - wincmd p - return 1 - endif -endfunction - -function! s:find_name(lnum) - for lnum in reverse(range(1, a:lnum)) - let line = getline(lnum) - if empty(line) - return '' - endif - let name = s:extract_name(line, '-', '') - if !empty(name) - return name - endif - endfor - return '' -endfunction - -function! s:preview_commit() - if b:plug_preview < 0 - let b:plug_preview = !s:is_preview_window_open() - endif - - let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7,9}') - if empty(sha) - let name = matchstr(getline('.'), '^- \zs[^:]*\ze:$') - if empty(name) - return - endif - let title = 'HEAD@{1}..' - let command = 'git diff --no-color HEAD@{1}' - else - let title = sha - let command = 'git show --no-color --pretty=medium '.sha - let name = s:find_name(line('.')) - endif - - if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir) - return - endif - - if exists('g:plug_pwindow') && !s:is_preview_window_open() - execute g:plug_pwindow - execute 'e' title - else - execute 'pedit' title - wincmd P - endif - setlocal previewwindow filetype=git buftype=nofile bufhidden=wipe nobuflisted modifiable - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(1) - let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && '.command - if s:is_win - let [batchfile, cmd] = s:batchfile(cmd) - endif - execute 'silent %!' cmd - finally - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry - setlocal nomodifiable - nnoremap <silent> <buffer> q :q<cr> - wincmd p -endfunction - -function! s:section(flags) - call search('\(^[x-] \)\@<=[^:]\+:', a:flags) -endfunction - -function! s:format_git_log(line) - let indent = ' ' - let tokens = split(a:line, nr2char(1)) - if len(tokens) != 5 - return indent.substitute(a:line, '\s*$', '', '') - endif - let [graph, sha, refs, subject, date] = tokens - let tag = matchstr(refs, 'tag: [^,)]\+') - let tag = empty(tag) ? ' ' : ' ('.tag.') ' - return printf('%s%s%s%s%s (%s)', indent, graph, sha, tag, subject, date) -endfunction - -function! s:append_ul(lnum, text) - call append(a:lnum, ['', a:text, repeat('-', len(a:text))]) -endfunction - -function! s:diff() - call s:prepare() - call append(0, ['Collecting changes ...', '']) - let cnts = [0, 0] - let bar = '' - let total = filter(copy(g:plugs), 's:is_managed(v:key) && isdirectory(v:val.dir)') - call s:progress_bar(2, bar, len(total)) - for origin in [1, 0] - let plugs = reverse(sort(items(filter(copy(total), (origin ? '' : '!').'(has_key(v:val, "commit") || has_key(v:val, "tag"))')))) - if empty(plugs) - continue - endif - call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:') - for [k, v] in plugs - let branch = s:git_origin_branch(v) - if len(branch) - let range = origin ? '..origin/'.branch : 'HEAD@{1}..' - let cmd = ['git', 'log', '--graph', '--color=never'] - if s:git_version_requirement(2, 10, 0) - call add(cmd, '--no-show-signature') - endif - call extend(cmd, ['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range]) - if has_key(v, 'rtp') - call extend(cmd, ['--', v.rtp]) - endif - let diff = s:system_chomp(cmd, v.dir) - if !empty(diff) - let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : '' - call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)'))) - let cnts[origin] += 1 - endif - endif - let bar .= '=' - call s:progress_bar(2, bar, len(total)) - normal! 2G - redraw - endfor - if !cnts[origin] - call append(5, ['', 'N/A']) - endif - endfor - call setline(1, printf('%d plugin(s) updated.', cnts[0]) - \ . (cnts[1] ? printf(' %d plugin(s) have pending updates.', cnts[1]) : '')) - - if cnts[0] || cnts[1] - nnoremap <silent> <buffer> <plug>(plug-preview) :silent! call <SID>preview_commit()<cr> - if empty(maparg("\<cr>", 'n')) - nmap <buffer> <cr> <plug>(plug-preview) - endif - if empty(maparg('o', 'n')) - nmap <buffer> o <plug>(plug-preview) - endif - endif - if cnts[0] - nnoremap <silent> <buffer> X :call <SID>revert()<cr> - echo "Press 'X' on each block to revert the update" - endif - normal! gg - setlocal nomodifiable -endfunction - -function! s:revert() - if search('^Pending updates', 'bnW') - return - endif - - let name = s:find_name(line('.')) - if empty(name) || !has_key(g:plugs, name) || - \ input(printf('Revert the update of %s? (y/N) ', name)) !~? '^y' - return - endif - - call s:system('git reset --hard HEAD@{1} && git checkout '.plug#shellescape(g:plugs[name].branch).' --', g:plugs[name].dir) - setlocal modifiable - normal! "_dap - setlocal nomodifiable - echo 'Reverted' -endfunction - -function! s:snapshot(force, ...) abort - call s:prepare() - setf vim - call append(0, ['" Generated by vim-plug', - \ '" '.strftime("%c"), - \ '" :source this file in vim to restore the snapshot', - \ '" or execute: vim -S snapshot.vim', - \ '', '', 'PlugUpdate!']) - 1 - let anchor = line('$') - 3 - let names = sort(keys(filter(copy(g:plugs), - \'has_key(v:val, "uri") && isdirectory(v:val.dir)'))) - for name in reverse(names) - let sha = has_key(g:plugs[name], 'commit') ? g:plugs[name].commit : s:git_revision(g:plugs[name].dir) - if !empty(sha) - call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha)) - redraw - endif - endfor - - if a:0 > 0 - let fn = s:plug_expand(a:1) - if filereadable(fn) && !(a:force || s:ask(a:1.' already exists. Overwrite?')) - return - endif - call writefile(getline(1, '$'), fn) - echo 'Saved as '.a:1 - silent execute 'e' s:esc(fn) - setf vim - endif -endfunction - -function! s:split_rtp() - return split(&rtp, '\\\@<!,') -endfunction - -let s:first_rtp = s:escrtp(get(s:split_rtp(), 0, '')) -let s:last_rtp = s:escrtp(get(s:split_rtp(), -1, '')) - -if exists('g:plugs') - let g:plugs_order = get(g:, 'plugs_order', keys(g:plugs)) - call s:upgrade_specs() - call s:define_commands() -endif - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/.vim/autoload/pythoncomplete.vim b/.vim/autoload/pythoncomplete.vim deleted file mode 100644 index 57add71..0000000 --- a/.vim/autoload/pythoncomplete.vim +++ /dev/null @@ -1,625 +0,0 @@ -"pythoncomplete.vim - Omni Completion for python -" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com> -" Version: 0.9 -" Last Updated: 18 Jun 2009 -" -" Changes -" TODO: -" 'info' item output can use some formatting work -" Add an "unsafe eval" mode, to allow for return type evaluation -" Complete basic syntax along with import statements -" i.e. "import url<c-x,c-o>" -" Continue parsing on invalid line?? -" -" v 0.9 -" * Fixed docstring parsing for classes and functions -" * Fixed parsing of *args and **kwargs type arguments -" * Better function param parsing to handle things like tuples and -" lambda defaults args -" -" v 0.8 -" * Fixed an issue where the FIRST assignment was always used instead of -" using a subsequent assignment for a variable -" * Fixed a scoping issue when working inside a parameterless function -" -" -" v 0.7 -" * Fixed function list sorting (_ and __ at the bottom) -" * Removed newline removal from docs. It appears vim handles these better in -" recent patches -" -" v 0.6: -" * Fixed argument completion -" * Removed the 'kind' completions, as they are better indicated -" with real syntax -" * Added tuple assignment parsing (whoops, that was forgotten) -" * Fixed import handling when flattening scope -" -" v 0.5: -" Yeah, I skipped a version number - 0.4 was never public. -" It was a bugfix version on top of 0.3. This is a complete -" rewrite. -" - -if !has('python') - echo "Error: Required vim compiled with +python" - finish -endif - -function! pythoncomplete#Complete(findstart, base) - "findstart = 1 when we need to get the text length - if a:findstart == 1 - let line = getline('.') - let idx = col('.') - while idx > 0 - let idx -= 1 - let c = line[idx] - if c =~ '\w' - continue - elseif ! c =~ '\.' - let idx = -1 - break - else - break - endif - endwhile - - return idx - "findstart = 0 when we need to return the list of completions - else - "vim no longer moves the cursor upon completion... fix that - let line = getline('.') - let idx = col('.') - let cword = '' - while idx > 0 - let idx -= 1 - let c = line[idx] - if c =~ '\w' || c =~ '\.' - let cword = c . cword - continue - elseif strlen(cword) > 0 || idx == 0 - break - endif - endwhile - execute "python vimcomplete('" . cword . "', '" . a:base . "')" - return g:pythoncomplete_completions - endif -endfunction - -function! s:DefPython() -python << PYTHONEOF -import sys, tokenize, cStringIO, types -from token import NAME, DEDENT, NEWLINE, STRING - -debugstmts=[] -def dbg(s): debugstmts.append(s) -def showdbg(): - for d in debugstmts: print "DBG: %s " % d - -def vimcomplete(context,match): - global debugstmts - debugstmts = [] - try: - import vim - def complsort(x,y): - try: - xa = x['abbr'] - ya = y['abbr'] - if xa[0] == '_': - if xa[1] == '_' and ya[0:2] == '__': - return xa > ya - elif ya[0:2] == '__': - return -1 - elif y[0] == '_': - return xa > ya - else: - return 1 - elif ya[0] == '_': - return -1 - else: - return xa > ya - except: - return 0 - cmpl = Completer() - cmpl.evalsource('\n'.join(vim.current.buffer),vim.eval("line('.')")) - all = cmpl.get_completions(context,match) - all.sort(complsort) - dictstr = '[' - # have to do this for double quoting - for cmpl in all: - dictstr += '{' - for x in cmpl: dictstr += '"%s":"%s",' % (x,cmpl[x]) - dictstr += '"icase":0},' - if dictstr[-1] == ',': dictstr = dictstr[:-1] - dictstr += ']' - #dbg("dict: %s" % dictstr) - vim.command("silent let g:pythoncomplete_completions = %s" % dictstr) - #dbg("Completion dict:\n%s" % all) - except vim.error: - dbg("VIM Error: %s" % vim.error) - -class Completer(object): - def __init__(self): - self.compldict = {} - self.parser = PyParser() - - def evalsource(self,text,line=0): - sc = self.parser.parse(text,line) - src = sc.get_code() - dbg("source: %s" % src) - try: exec(src) in self.compldict - except: dbg("parser: %s, %s" % (sys.exc_info()[0],sys.exc_info()[1])) - for l in sc.locals: - try: exec(l) in self.compldict - except: dbg("locals: %s, %s [%s]" % (sys.exc_info()[0],sys.exc_info()[1],l)) - - def _cleanstr(self,doc): - return doc.replace('"',' ').replace("'",' ') - - def get_arguments(self,func_obj): - def _ctor(obj): - try: return class_ob.__init__.im_func - except AttributeError: - for base in class_ob.__bases__: - rc = _find_constructor(base) - if rc is not None: return rc - return None - - arg_offset = 1 - if type(func_obj) == types.ClassType: func_obj = _ctor(func_obj) - elif type(func_obj) == types.MethodType: func_obj = func_obj.im_func - else: arg_offset = 0 - - arg_text='' - if type(func_obj) in [types.FunctionType, types.LambdaType]: - try: - cd = func_obj.func_code - real_args = cd.co_varnames[arg_offset:cd.co_argcount] - defaults = func_obj.func_defaults or '' - defaults = map(lambda name: "=%s" % name, defaults) - defaults = [""] * (len(real_args)-len(defaults)) + defaults - items = map(lambda a,d: a+d, real_args, defaults) - if func_obj.func_code.co_flags & 0x4: - items.append("...") - if func_obj.func_code.co_flags & 0x8: - items.append("***") - arg_text = (','.join(items)) + ')' - - except: - dbg("arg completion: %s: %s" % (sys.exc_info()[0],sys.exc_info()[1])) - pass - if len(arg_text) == 0: - # The doc string sometimes contains the function signature - # this works for alot of C modules that are part of the - # standard library - doc = func_obj.__doc__ - if doc: - doc = doc.lstrip() - pos = doc.find('\n') - if pos > 0: - sigline = doc[:pos] - lidx = sigline.find('(') - ridx = sigline.find(')') - if lidx > 0 and ridx > 0: - arg_text = sigline[lidx+1:ridx] + ')' - if len(arg_text) == 0: arg_text = ')' - return arg_text - - def get_completions(self,context,match): - dbg("get_completions('%s','%s')" % (context,match)) - stmt = '' - if context: stmt += str(context) - if match: stmt += str(match) - try: - result = None - all = {} - ridx = stmt.rfind('.') - if len(stmt) > 0 and stmt[-1] == '(': - result = eval(_sanitize(stmt[:-1]), self.compldict) - doc = result.__doc__ - if doc is None: doc = '' - args = self.get_arguments(result) - return [{'word':self._cleanstr(args),'info':self._cleanstr(doc)}] - elif ridx == -1: - match = stmt - all = self.compldict - else: - match = stmt[ridx+1:] - stmt = _sanitize(stmt[:ridx]) - result = eval(stmt, self.compldict) - all = dir(result) - - dbg("completing: stmt:%s" % stmt) - completions = [] - - try: maindoc = result.__doc__ - except: maindoc = ' ' - if maindoc is None: maindoc = ' ' - for m in all: - if m == "_PyCmplNoType": continue #this is internal - try: - dbg('possible completion: %s' % m) - if m.find(match) == 0: - if result is None: inst = all[m] - else: inst = getattr(result,m) - try: doc = inst.__doc__ - except: doc = maindoc - typestr = str(inst) - if doc is None or doc == '': doc = maindoc - - wrd = m[len(match):] - c = {'word':wrd, 'abbr':m, 'info':self._cleanstr(doc)} - if "function" in typestr: - c['word'] += '(' - c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst)) - elif "method" in typestr: - c['word'] += '(' - c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst)) - elif "module" in typestr: - c['word'] += '.' - elif "class" in typestr: - c['word'] += '(' - c['abbr'] += '(' - completions.append(c) - except: - i = sys.exc_info() - dbg("inner completion: %s,%s [stmt='%s']" % (i[0],i[1],stmt)) - return completions - except: - i = sys.exc_info() - dbg("completion: %s,%s [stmt='%s']" % (i[0],i[1],stmt)) - return [] - -class Scope(object): - def __init__(self,name,indent,docstr=''): - self.subscopes = [] - self.docstr = docstr - self.locals = [] - self.parent = None - self.name = name - self.indent = indent - - def add(self,sub): - #print 'push scope: [%s@%s]' % (sub.name,sub.indent) - sub.parent = self - self.subscopes.append(sub) - return sub - - def doc(self,str): - """ Clean up a docstring """ - d = str.replace('\n',' ') - d = d.replace('\t',' ') - while d.find(' ') > -1: d = d.replace(' ',' ') - while d[0] in '"\'\t ': d = d[1:] - while d[-1] in '"\'\t ': d = d[:-1] - dbg("Scope(%s)::docstr = %s" % (self,d)) - self.docstr = d - - def local(self,loc): - self._checkexisting(loc) - self.locals.append(loc) - - def copy_decl(self,indent=0): - """ Copy a scope's declaration only, at the specified indent level - not local variables """ - return Scope(self.name,indent,self.docstr) - - def _checkexisting(self,test): - "Convienance function... keep out duplicates" - if test.find('=') > -1: - var = test.split('=')[0].strip() - for l in self.locals: - if l.find('=') > -1 and var == l.split('=')[0].strip(): - self.locals.remove(l) - - def get_code(self): - str = "" - if len(self.docstr) > 0: str += '"""'+self.docstr+'"""\n' - for l in self.locals: - if l.startswith('import'): str += l+'\n' - str += 'class _PyCmplNoType:\n def __getattr__(self,name):\n return None\n' - for sub in self.subscopes: - str += sub.get_code() - for l in self.locals: - if not l.startswith('import'): str += l+'\n' - - return str - - def pop(self,indent): - #print 'pop scope: [%s] to [%s]' % (self.indent,indent) - outer = self - while outer.parent != None and outer.indent >= indent: - outer = outer.parent - return outer - - def currentindent(self): - #print 'parse current indent: %s' % self.indent - return ' '*self.indent - - def childindent(self): - #print 'parse child indent: [%s]' % (self.indent+1) - return ' '*(self.indent+1) - -class Class(Scope): - def __init__(self, name, supers, indent, docstr=''): - Scope.__init__(self,name,indent, docstr) - self.supers = supers - def copy_decl(self,indent=0): - c = Class(self.name,self.supers,indent, self.docstr) - for s in self.subscopes: - c.add(s.copy_decl(indent+1)) - return c - def get_code(self): - str = '%sclass %s' % (self.currentindent(),self.name) - if len(self.supers) > 0: str += '(%s)' % ','.join(self.supers) - str += ':\n' - if len(self.docstr) > 0: str += self.childindent()+'"""'+self.docstr+'"""\n' - if len(self.subscopes) > 0: - for s in self.subscopes: str += s.get_code() - else: - str += '%spass\n' % self.childindent() - return str - - -class Function(Scope): - def __init__(self, name, params, indent, docstr=''): - Scope.__init__(self,name,indent, docstr) - self.params = params - def copy_decl(self,indent=0): - return Function(self.name,self.params,indent, self.docstr) - def get_code(self): - str = "%sdef %s(%s):\n" % \ - (self.currentindent(),self.name,','.join(self.params)) - if len(self.docstr) > 0: str += self.childindent()+'"""'+self.docstr+'"""\n' - str += "%spass\n" % self.childindent() - return str - -class PyParser: - def __init__(self): - self.top = Scope('global',0) - self.scope = self.top - - def _parsedotname(self,pre=None): - #returns (dottedname, nexttoken) - name = [] - if pre is None: - tokentype, token, indent = self.next() - if tokentype != NAME and token != '*': - return ('', token) - else: token = pre - name.append(token) - while True: - tokentype, token, indent = self.next() - if token != '.': break - tokentype, token, indent = self.next() - if tokentype != NAME: break - name.append(token) - return (".".join(name), token) - - def _parseimportlist(self): - imports = [] - while True: - name, token = self._parsedotname() - if not name: break - name2 = '' - if token == 'as': name2, token = self._parsedotname() - imports.append((name, name2)) - while token != "," and "\n" not in token: - tokentype, token, indent = self.next() - if token != ",": break - return imports - - def _parenparse(self): - name = '' - names = [] - level = 1 - while True: - tokentype, token, indent = self.next() - if token in (')', ',') and level == 1: - if '=' not in name: name = name.replace(' ', '') - names.append(name.strip()) - name = '' - if token == '(': - level += 1 - name += "(" - elif token == ')': - level -= 1 - if level == 0: break - else: name += ")" - elif token == ',' and level == 1: - pass - else: - name += "%s " % str(token) - return names - - def _parsefunction(self,indent): - self.scope=self.scope.pop(indent) - tokentype, fname, ind = self.next() - if tokentype != NAME: return None - - tokentype, open, ind = self.next() - if open != '(': return None - params=self._parenparse() - - tokentype, colon, ind = self.next() - if colon != ':': return None - - return Function(fname,params,indent) - - def _parseclass(self,indent): - self.scope=self.scope.pop(indent) - tokentype, cname, ind = self.next() - if tokentype != NAME: return None - - super = [] - tokentype, next, ind = self.next() - if next == '(': - super=self._parenparse() - elif next != ':': return None - - return Class(cname,super,indent) - - def _parseassignment(self): - assign='' - tokentype, token, indent = self.next() - if tokentype == tokenize.STRING or token == 'str': - return '""' - elif token == '(' or token == 'tuple': - return '()' - elif token == '[' or token == 'list': - return '[]' - elif token == '{' or token == 'dict': - return '{}' - elif tokentype == tokenize.NUMBER: - return '0' - elif token == 'open' or token == 'file': - return 'file' - elif token == 'None': - return '_PyCmplNoType()' - elif token == 'type': - return 'type(_PyCmplNoType)' #only for method resolution - else: - assign += token - level = 0 - while True: - tokentype, token, indent = self.next() - if token in ('(','{','['): - level += 1 - elif token in (']','}',')'): - level -= 1 - if level == 0: break - elif level == 0: - if token in (';','\n'): break - assign += token - return "%s" % assign - - def next(self): - type, token, (lineno, indent), end, self.parserline = self.gen.next() - if lineno == self.curline: - #print 'line found [%s] scope=%s' % (line.replace('\n',''),self.scope.name) - self.currentscope = self.scope - return (type, token, indent) - - def _adjustvisibility(self): - newscope = Scope('result',0) - scp = self.currentscope - while scp != None: - if type(scp) == Function: - slice = 0 - #Handle 'self' params - if scp.parent != None and type(scp.parent) == Class: - slice = 1 - newscope.local('%s = %s' % (scp.params[0],scp.parent.name)) - for p in scp.params[slice:]: - i = p.find('=') - if len(p) == 0: continue - pvar = '' - ptype = '' - if i == -1: - pvar = p - ptype = '_PyCmplNoType()' - else: - pvar = p[:i] - ptype = _sanitize(p[i+1:]) - if pvar.startswith('**'): - pvar = pvar[2:] - ptype = '{}' - elif pvar.startswith('*'): - pvar = pvar[1:] - ptype = '[]' - - newscope.local('%s = %s' % (pvar,ptype)) - - for s in scp.subscopes: - ns = s.copy_decl(0) - newscope.add(ns) - for l in scp.locals: newscope.local(l) - scp = scp.parent - - self.currentscope = newscope - return self.currentscope - - #p.parse(vim.current.buffer[:],vim.eval("line('.')")) - def parse(self,text,curline=0): - self.curline = int(curline) - buf = cStringIO.StringIO(''.join(text) + '\n') - self.gen = tokenize.generate_tokens(buf.readline) - self.currentscope = self.scope - - try: - freshscope=True - while True: - tokentype, token, indent = self.next() - #dbg( 'main: token=[%s] indent=[%s]' % (token,indent)) - - if tokentype == DEDENT or token == "pass": - self.scope = self.scope.pop(indent) - elif token == 'def': - func = self._parsefunction(indent) - if func is None: - print "function: syntax error..." - continue - dbg("new scope: function") - freshscope = True - self.scope = self.scope.add(func) - elif token == 'class': - cls = self._parseclass(indent) - if cls is None: - print "class: syntax error..." - continue - freshscope = True - dbg("new scope: class") - self.scope = self.scope.add(cls) - - elif token == 'import': - imports = self._parseimportlist() - for mod, alias in imports: - loc = "import %s" % mod - if len(alias) > 0: loc += " as %s" % alias - self.scope.local(loc) - freshscope = False - elif token == 'from': - mod, token = self._parsedotname() - if not mod or token != "import": - print "from: syntax error..." - continue - names = self._parseimportlist() - for name, alias in names: - loc = "from %s import %s" % (mod,name) - if len(alias) > 0: loc += " as %s" % alias - self.scope.local(loc) - freshscope = False - elif tokentype == STRING: - if freshscope: self.scope.doc(token) - elif tokentype == NAME: - name,token = self._parsedotname(token) - if token == '=': - stmt = self._parseassignment() - dbg("parseassignment: %s = %s" % (name, stmt)) - if stmt != None: - self.scope.local("%s = %s" % (name,stmt)) - freshscope = False - except StopIteration: #thrown on EOF - pass - except: - dbg("parse error: %s, %s @ %s" % - (sys.exc_info()[0], sys.exc_info()[1], self.parserline)) - return self._adjustvisibility() - -def _sanitize(str): - val = '' - level = 0 - for c in str: - if c in ('(','{','['): - level += 1 - elif c in (']','}',')'): - level -= 1 - elif level == 0: - val += c - return val - -sys.path.extend(['.','..']) -PYTHONEOF -endfunction - -call s:DefPython() -" vim: set et ts=4: diff --git a/.vim/autoload/rubycomplete.vim b/.vim/autoload/rubycomplete.vim deleted file mode 100644 index 003dc0b..0000000 --- a/.vim/autoload/rubycomplete.vim +++ /dev/null @@ -1,530 +0,0 @@ -" Vim completion script -" Language: Ruby -" Maintainer: Mark Guzman <segfault@hasno.info> -" Info: $Id: rubycomplete.vim,v 1.33 2006/06/19 17:10:24 segy Exp $ -" Version: 0.6 -" URL: http://vim-ruby.rubyforge.org -" Anon CVS: See above site -" Release Coordinator: Doug Kearns <dougkearns@gmail.com> -" ---------------------------------------------------------------------------- -" -" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com) -" ---------------------------------------------------------------------------- - -" {{{ requirement checks -if !has('ruby') - s:ErrMsg( "Error: Required vim compiled with +ruby" ) - finish -endif - -if version < 700 - s:ErrMsg( "Error: Required vim >= 7.0" ) - finish -endif -" }}} requirement checks - -if !exists("g:rubycomplete_rails") - let g:rubycomplete_rails = 0 -endif - -if !exists("g:rubycomplete_classes_in_global") - let g:rubycomplete_classes_in_global = 0 -endif - -if !exists("g:rubycomplete_buffer_loading") - let g:rubycomplete_classes_in_global = 0 -endif - - -" {{{ vim-side support functions -function! s:ErrMsg(msg) - echohl ErrorMsg - echo a:msg - echohl None -endfunction - -function! s:GetBufferRubyModule(name) - let [snum,enum] = s:GetBufferRubyEntity(a:name, "module") - return snum . '..' . enum -endfunction - -function! s:GetBufferRubyClass(name) - let [snum,enum] = s:GetBufferRubyEntity(a:name, "class") - return snum . '..' . enum -endfunction - -function! s:GetBufferRubySingletonMethods(name) -endfunction - -function! s:GetBufferRubyEntity( name, type ) - let stopline = 1 - let crex = '^\s*' . a:type . '\s*' . a:name . '\s*\(<\s*.*\s*\)\?\n*\(\(\s\|#\).*\n*\)*\n*\s*end$' - let [lnum,lcol] = searchpos( crex, 'nbw') - if lnum == 0 && lcol == 0 - return [0,0] - endif - - let [enum,ecol] = searchpos( crex, 'nebw') - if lnum > enum - let realdef = getline( lnum ) - let crexb = '^' . realdef . '\n*\(\(\s\|#\).*\n*\)*\n*\s*end$' - let [enum,ecol] = searchpos( crexb, 'necw' ) - endif - " we found a the class def - return [lnum,enum] -endfunction - -function! s:IsInClassDef() - let [snum,enum] = s:GetBufferRubyEntity( '.*', "class" ) - let ret = 'nil' - let pos = line('.') - - if snum < pos && pos < enum - let ret = snum . '..' . enum - endif - - return ret -endfunction - -function! s:GetRubyVarType(v) - let stopline = 1 - let vtp = '' - let pos = getpos('.') - let [lnum,lcol] = searchpos('^\s*#\s*@var\s*'.a:v.'\>\s\+[^ \t]\+\s*$','nb',stopline) - if lnum != 0 && lcol != 0 - call setpos('.',pos) - let str = getline(lnum) - let vtp = substitute(str,'^\s*#\s*@var\s*'.a:v.'\>\s\+\([^ \t]\+\)\s*$','\1','') - return vtp - endif - call setpos('.',pos) - if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1 - let ctors = '\(now\|new\|open\|get_instance\|find\|create\)' - else - let ctors = '\(now\|new\|open\|get_instance\)' - endif - - let [lnum,lcol] = searchpos(''.a:v.'\>\s*[+\-*/]*=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%r{\|[A-Za-z0-9@:\-()]\+...\?\)','nb',stopline) - if lnum != 0 && lcol != 0 - let str = matchstr(getline(lnum),'=\s*\([^ \t]\+.' . ctors . '\>\|[\[{"''/]\|%r{\|[A-Za-z0-9@:\-()]\+...\?\)',lcol) - let str = substitute(str,'^=\s*','','') - call setpos('.',pos) - if str == '"' || str == '''' - return 'String' - elseif str == '[' - return 'Array' - elseif str == '{' - return 'Hash' - elseif str == '/' || str == '%r{' - return 'Regexp' - elseif strlen(str) >= 4 && stridx(str,'..') != -1 - return 'Range' - elseif strlen(str) > 4 - let l = stridx(str,'.') - return str[0:l-1] - end - return '' - endif - call setpos('.',pos) - return '' -endfunction - -"}}} vim-side support functions - -function! rubycomplete#Complete(findstart, base) - "findstart = 1 when we need to get the text length - if a:findstart - let line = getline('.') - let idx = col('.') - while idx > 0 - let idx -= 1 - let c = line[idx-1] - if c =~ '\w' - continue - elseif ! c =~ '\.' - idx = -1 - break - else - break - endif - endwhile - - return idx - "findstart = 0 when we need to return the list of completions - else - let g:rubycomplete_completions = [] - execute "ruby get_completions('" . a:base . "')" - return g:rubycomplete_completions - endif -endfunction - - -function! s:DefRuby() -ruby << RUBYEOF -# {{{ ruby completion -RailsWords = [ - "has_many", "has_one", - "belongs_to", - ] - -ReservedWords = [ - "BEGIN", "END", - "alias", "and", - "begin", "break", - "case", "class", - "def", "defined", "do", - "else", "elsif", "end", "ensure", - "false", "for", - "if", "in", - "module", - "next", "nil", "not", - "or", - "redo", "rescue", "retry", "return", - "self", "super", - "then", "true", - "undef", "unless", "until", - "when", "while", - "yield", - ] - -Operators = [ "%", "&", "*", "**", "+", "-", "/", - "<", "<<", "<=", "<=>", "==", "===", "=~", ">", ">=", ">>", - "[]", "[]=", "^", ] - - -def load_requires - buf = VIM::Buffer.current - enum = buf.line_number - nums = Range.new( 1, enum ) - nums.each do |x| - ln = buf[x] - begin - eval( "require %s" % $1 ) if /.*require\s*(.*)$/.match( ln ) - rescue Exception - #ignore? - end - end -end - -def load_buffer_class(name) - classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")') - return if classdef == nil - - pare = /^\s*class\s*(.*)\s*<\s*(.*)\s*\n/.match( classdef ) - load_buffer_class( $2 ) if pare != nil - - mixre = /.*\n\s*include\s*(.*)\s*\n/.match( classdef ) - load_buffer_module( $2 ) if mixre != nil - - begin - eval classdef - rescue - VIM::evaluate( "s:ErrMsg( 'Problem loading class \"%s\", was it already completed?' )" % name ) - end -end - -def load_buffer_module(name) - classdef = get_buffer_entity(name, 's:GetBufferRubyModule("%s")') - return if classdef == nil - - begin - eval classdef - rescue - VIM::evaluate( "s:ErrMsg( 'Problem loading module \"%s\", was it already completed?' )" % name ) - end -end - -def get_buffer_entity(name, vimfun) - loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading") - return nil if loading_allowed != '1' - return nil if /(\"|\')+/.match( name ) - buf = VIM::Buffer.current - nums = eval( VIM::evaluate( vimfun % name ) ) - return nil if nums == nil - return nil if nums.min == nums.max && nums.min == 0 - - cur_line = VIM::Buffer.current.line_number - classdef = "" - nums.each do |x| - if x != cur_line - ln = buf[x] - classdef += "%s\n" % ln - end - end - - return classdef -end - -def get_var_type( receiver ) - if /(\"|\')+/.match( receiver ) - "String" - else - VIM::evaluate("s:GetRubyVarType('%s')" % receiver) - end -end - -def get_buffer_classes() - # this will be a little expensive. - loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading") - allow_aggressive_load = VIM::evaluate("exists('g:rubycomplete_classes_in_global') && g:rubycomplete_classes_in_global") - return [] if allow_aggressive_load != '1' || loading_allowed != '1' - - buf = VIM::Buffer.current - eob = buf.length - ret = [] - rg = 1..eob - - rg.each do |x| - if /^\s*class\s*([A-Za-z0-9_-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*/.match( buf[x] ) - ret.push $1 - end - end - - return ret -end - -def load_rails() - allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") - return if allow_rails != '1' - - buf_path = VIM::evaluate('expand("%:p")') - file_name = VIM::evaluate('expand("%:t")') - path = buf_path.gsub( file_name, '' ) - path.gsub!( /\\/, "/" ) - pup = [ "./", "../", "../../", "../../../", "../../../../" ] - pok = nil - - pup.each do |sup| - tpok = "%s%sconfig" % [ path, sup ] - if File.exists?( tpok ) - pok = tpok - break - end - end - - return if pok == nil - - bootfile = pok + "/boot.rb" - envfile = pok + "/environment.rb" - if File.exists?( bootfile ) && File.exists?( envfile ) - begin - require bootfile - require envfile - begin - require 'console_app' - require 'console_with_helpers' - rescue - # 1.0 - end - Rails::Initializer.run - VIM::command('let s:rubycomplete_rails_loaded = 1') - rescue - VIM::evaluate( "s:ErrMsg('Error loading rails environment')" ) - end - end -end - -def get_rails_helpers - allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") - rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded') - return [] if allow_rails != '1' || rails_loaded != '1' - return RailsWords -end - -def add_rails_columns( cls ) - allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") - rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded') - return [] if allow_rails != '1' || rails_loaded != '1' - eval( "#{cls}.establish_connection" ) - return [] unless eval( "#{cls}.ancestors.include?(ActiveRecord::Base).to_s" ) - col = eval( "#{cls}.column_names" ) - return col if col - return [] -end - -def clean_sel(sel, msg) - sel.delete_if { |x| x == nil } - sel.uniq! - sel.grep(/^#{Regexp.quote(msg)}/) if msg != nil -end - -def get_completions(base) - loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading") - if loading_allowed == '1' - load_requires - load_rails - end - - input = VIM::Buffer.current.line - cpos = VIM::Window.current.cursor[1] - 1 - input = input[0..cpos] - input += base - input.sub!(/.*[ \t\n\"\\'`><=;|&{(]/, '') # Readline.basic_word_break_characters - input.sub!(/self\./, '') - - message = nil - receiver = nil - methods = [] - variables = [] - classes = [] - - case input - when /^(\/[^\/]*\/)\.([^.]*)$/ # Regexp - receiver = $1 - message = Regexp.quote($2) - methods = Regexp.instance_methods(true) - - when /^([^\]]*\])\.([^.]*)$/ # Array - receiver = $1 - message = Regexp.quote($2) - methods = Array.instance_methods(true) - - when /^([^\}]*\})\.([^.]*)$/ # Proc or Hash - receiver = $1 - message = Regexp.quote($2) - methods = Proc.instance_methods(true) | Hash.instance_methods(true) - - when /^(:[^:.]*)$/ # Symbol - if Symbol.respond_to?(:all_symbols) - receiver = $1 - message = $1.sub( /:/, '' ) - methods = Symbol.all_symbols.collect{|s| s.id2name} - methods.delete_if { |c| c.match( /'/ ) } - end - - when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods - receiver = $1 - methods = Object.constants - methods.grep(/^#{receiver}/).collect{|e| "::" + e} - - when /^(((::)?[A-Z][^:.\(]*)+)::?([^:.]*)$/ # Constant or class methods - receiver = $1 - message = Regexp.quote($4) - begin - methods = eval("#{receiver}.constants | #{receiver}.methods") - rescue Exception - methods = [] - end - methods.grep(/^#{message}/).collect{|e| receiver + "::" + e} - - when /^(:[^:.]+)\.([^.]*)$/ # Symbol - receiver = $1 - message = Regexp.quote($2) - methods = Symbol.instance_methods(true) - - when /^([0-9_]+(\.[0-9_]+)?(e[0-9]+)?)\.([^.]*)$/ # Numeric - receiver = $1 - message = Regexp.quote($4) - begin - methods = eval(receiver).methods - rescue Exception - methods = [] - end - - when /^(\$[^.]*)$/ #global - methods = global_variables.grep(Regexp.new(Regexp.quote($1))) - - when /^((\.?[^.]+)+)\.([^.]*)$/ # variable - receiver = $1 - message = Regexp.quote($3) - load_buffer_class( receiver ) - - cv = eval("self.class.constants") - vartype = get_var_type( receiver ) - if vartype != '' - load_buffer_class( vartype ) - - begin - methods = eval("#{vartype}.instance_methods") - variables = eval("#{vartype}.instance_variables") - rescue Exception - end - elsif (cv).include?(receiver) - # foo.func and foo is local var. - methods = eval("#{receiver}.methods") - vartype = receiver - elsif /^[A-Z]/ =~ receiver and /\./ !~ receiver - vartype = receiver - # Foo::Bar.func - begin - methods = eval("#{receiver}.methods") - rescue Exception - end - else - # func1.func2 - ObjectSpace.each_object(Module){|m| - next if m.name != "IRB::Context" and - /^(IRB|SLex|RubyLex|RubyToken)/ =~ m.name - methods.concat m.instance_methods(false) - } - end - variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0 - - when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/ - message = $1 - methods = Range.instance_methods(true) - - when /^\.([^.]*)$/ # unknown(maybe String) - message = Regexp.quote($1) - methods = String.instance_methods(true) - - else - inclass = eval( VIM::evaluate("s:IsInClassDef()") ) - - if inclass != nil - classdef = "%s\n" % VIM::Buffer.current[ inclass.min ] - found = /^\s*class\s*([A-Za-z0-9_-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*\n$/.match( classdef ) - - if found != nil - receiver = $1 - message = input - load_buffer_class( receiver ) - begin - methods = eval( "#{receiver}.instance_methods" ) - methods += get_rails_helpers - variables += add_rails_columns( "#{receiver}" ) - rescue Exception - found = nil - end - end - end - - if inclass == nil || found == nil - classes = eval("self.class.constants") - classes += get_buffer_classes - message = receiver = input - end - end - - methods = clean_sel( methods, message ) - methods = (methods-Object.instance_methods) - variables = clean_sel( variables, message ) - classes = clean_sel( classes, message ) - valid = [] - valid += methods.collect { |m| { :name => m, :type => 'f' } } - valid += variables.collect { |v| { :name => v, :type => 'v' } } - valid += classes.collect { |c| { :name => c, :type => 't' } } - valid.sort! { |x,y| x[:name] <=> y[:name] } - - outp = "" - - rg = 0..valid.length - rg.step(150) do |x| - stpos = 0+x - enpos = 150+x - valid[stpos..enpos].each { |c| outp += "{'word':'%s','item':'%s','kind':'%s'}," % [ c[:name], c[:name], c[:type] ] } - outp.sub!(/,$/, '') - - VIM::command("call extend(g:rubycomplete_completions, [%s])" % outp) - outp = "" - end -end - -# }}} ruby completion -RUBYEOF -endfunction - -let s:rubycomplete_rails_loaded = 0 - -call s:DefRuby() -" vim:tw=78:sw=4:ts=8:et:fdm=marker:ft=vim:norl: diff --git a/.vim/autoload/snipMate.vim b/.vim/autoload/snipMate.vim deleted file mode 100644 index dcd28f6..0000000 --- a/.vim/autoload/snipMate.vim +++ /dev/null @@ -1,433 +0,0 @@ -fun! Filename(...) - let filename = expand('%:t:r') - if filename == '' | return a:0 == 2 ? a:2 : '' | endif - return !a:0 || a:1 == '' ? filename : substitute(a:1, '$1', filename, 'g') -endf - -fun s:RemoveSnippet() - unl! g:snipPos s:curPos s:snipLen s:endCol s:endLine s:prevLen - \ s:lastBuf s:oldWord - if exists('s:update') - unl s:startCol s:origWordLen s:update - if exists('s:oldVars') | unl s:oldVars s:oldEndCol | endif - endif - aug! snipMateAutocmds -endf - -fun snipMate#expandSnip(snip, col) - let lnum = line('.') | let col = a:col - - let snippet = s:ProcessSnippet(a:snip) - " Avoid error if eval evaluates to nothing - if snippet == '' | return '' | endif - - " Expand snippet onto current position with the tab stops removed - let snipLines = split(substitute(snippet, '$\d\+\|${\d\+.\{-}}', '', 'g'), "\n", 1) - - let line = getline(lnum) - let afterCursor = strpart(line, col - 1) - " Keep text after the cursor - if afterCursor != "\t" && afterCursor != ' ' - let line = strpart(line, 0, col - 1) - let snipLines[-1] .= afterCursor - else - let afterCursor = '' - " For some reason the cursor needs to move one right after this - if line != '' && col == 1 && &ve != 'all' && &ve != 'onemore' - let col += 1 - endif - endif - - call setline(lnum, line.snipLines[0]) - - " Autoindent snippet according to previous indentation - let indent = matchend(line, '^.\{-}\ze\(\S\|$\)') + 1 - call append(lnum, map(snipLines[1:], "'".strpart(line, 0, indent - 1)."'.v:val")) - - " Open any folds snippet expands into - if &fen | sil! exe lnum.','.(lnum + len(snipLines) - 1).'foldopen' | endif - - let [g:snipPos, s:snipLen] = s:BuildTabStops(snippet, lnum, col - indent, indent) - - if s:snipLen - aug snipMateAutocmds - au CursorMovedI * call s:UpdateChangedSnip(0) - au InsertEnter * call s:UpdateChangedSnip(1) - aug END - let s:lastBuf = bufnr(0) " Only expand snippet while in current buffer - let s:curPos = 0 - let s:endCol = g:snipPos[s:curPos][1] - let s:endLine = g:snipPos[s:curPos][0] - - call cursor(g:snipPos[s:curPos][0], g:snipPos[s:curPos][1]) - let s:prevLen = [line('$'), col('$')] - if g:snipPos[s:curPos][2] != -1 | return s:SelectWord() | endif - else - unl g:snipPos s:snipLen - " Place cursor at end of snippet if no tab stop is given - let newlines = len(snipLines) - 1 - call cursor(lnum + newlines, indent + len(snipLines[-1]) - len(afterCursor) - \ + (newlines ? 0: col - 1)) - endif - return '' -endf - -" Prepare snippet to be processed by s:BuildTabStops -fun s:ProcessSnippet(snip) - let snippet = a:snip - " Evaluate eval (`...`) expressions. - " Using a loop here instead of a regex fixes a bug with nested "\=". - if stridx(snippet, '`') != -1 - while match(snippet, '`.\{-}`') != -1 - let snippet = substitute(snippet, '`.\{-}`', - \ substitute(eval(matchstr(snippet, '`\zs.\{-}\ze`')), - \ "\n\\%$", '', ''), '') - endw - let snippet = substitute(snippet, "\r", "\n", 'g') - endif - - " Place all text after a colon in a tab stop after the tab stop - " (e.g. "${#:foo}" becomes "${:foo}foo"). - " This helps tell the position of the tab stops later. - let snippet = substitute(snippet, '${\d\+:\(.\{-}\)}', '&\1', 'g') - - " Update the a:snip so that all the $# become the text after - " the colon in their associated ${#}. - " (e.g. "${1:foo}" turns all "$1"'s into "foo") - let i = 1 - while stridx(snippet, '${'.i) != -1 - let s = matchstr(snippet, '${'.i.':\zs.\{-}\ze}') - if s != '' - let snippet = substitute(snippet, '$'.i, s.'&', 'g') - endif - let i += 1 - endw - - if &et " Expand tabs to spaces if 'expandtab' is set. - return substitute(snippet, '\t', repeat(' ', &sts ? &sts : &sw), 'g') - endif - return snippet -endf - -" Counts occurences of haystack in needle -fun s:Count(haystack, needle) - let counter = 0 - let index = stridx(a:haystack, a:needle) - while index != -1 - let index = stridx(a:haystack, a:needle, index+1) - let counter += 1 - endw - return counter -endf - -" Builds a list of a list of each tab stop in the snippet containing: -" 1.) The tab stop's line number. -" 2.) The tab stop's column number -" (by getting the length of the string between the last "\n" and the -" tab stop). -" 3.) The length of the text after the colon for the current tab stop -" (e.g. "${1:foo}" would return 3). If there is no text, -1 is returned. -" 4.) If the "${#:}" construct is given, another list containing all -" the matches of "$#", to be replaced with the placeholder. This list is -" composed the same way as the parent; the first item is the line number, -" and the second is the column. -fun s:BuildTabStops(snip, lnum, col, indent) - let snipPos = [] - let i = 1 - let withoutVars = substitute(a:snip, '$\d\+', '', 'g') - while stridx(a:snip, '${'.i) != -1 - let beforeTabStop = matchstr(withoutVars, '^.*\ze${'.i.'\D') - let withoutOthers = substitute(withoutVars, '${\('.i.'\D\)\@!\d\+.\{-}}', '', 'g') - - let j = i - 1 - call add(snipPos, [0, 0, -1]) - let snipPos[j][0] = a:lnum + s:Count(beforeTabStop, "\n") - let snipPos[j][1] = a:indent + len(matchstr(withoutOthers, '.*\(\n\|^\)\zs.*\ze${'.i.'\D')) - if snipPos[j][0] == a:lnum | let snipPos[j][1] += a:col | endif - - " Get all $# matches in another list, if ${#:name} is given - if stridx(withoutVars, '${'.i.':') != -1 - let snipPos[j][2] = len(matchstr(withoutVars, '${'.i.':\zs.\{-}\ze}')) - let dots = repeat('.', snipPos[j][2]) - call add(snipPos[j], []) - let withoutOthers = substitute(a:snip, '${\d\+.\{-}}\|$'.i.'\@!\d\+', '', 'g') - while match(withoutOthers, '$'.i.'\(\D\|$\)') != -1 - let beforeMark = matchstr(withoutOthers, '^.\{-}\ze'.dots.'$'.i.'\(\D\|$\)') - call add(snipPos[j][3], [0, 0]) - let snipPos[j][3][-1][0] = a:lnum + s:Count(beforeMark, "\n") - let snipPos[j][3][-1][1] = a:indent + (snipPos[j][3][-1][0] > a:lnum - \ ? len(matchstr(beforeMark, '.*\n\zs.*')) - \ : a:col + len(beforeMark)) - let withoutOthers = substitute(withoutOthers, '$'.i.'\ze\(\D\|$\)', '', '') - endw - endif - let i += 1 - endw - return [snipPos, i - 1] -endf - -fun snipMate#jumpTabStop(backwards) - let leftPlaceholder = exists('s:origWordLen') - \ && s:origWordLen != g:snipPos[s:curPos][2] - if leftPlaceholder && exists('s:oldEndCol') - let startPlaceholder = s:oldEndCol + 1 - endif - - if exists('s:update') - call s:UpdatePlaceholderTabStops() - else - call s:UpdateTabStops() - endif - - " Don't reselect placeholder if it has been modified - if leftPlaceholder && g:snipPos[s:curPos][2] != -1 - if exists('startPlaceholder') - let g:snipPos[s:curPos][1] = startPlaceholder - else - let g:snipPos[s:curPos][1] = col('.') - let g:snipPos[s:curPos][2] = 0 - endif - endif - - let s:curPos += a:backwards ? -1 : 1 - " Loop over the snippet when going backwards from the beginning - if s:curPos < 0 | let s:curPos = s:snipLen - 1 | endif - - if s:curPos == s:snipLen - let sMode = s:endCol == g:snipPos[s:curPos-1][1]+g:snipPos[s:curPos-1][2] - call s:RemoveSnippet() - return sMode ? "\<tab>" : TriggerSnippet() - endif - - call cursor(g:snipPos[s:curPos][0], g:snipPos[s:curPos][1]) - - let s:endLine = g:snipPos[s:curPos][0] - let s:endCol = g:snipPos[s:curPos][1] - let s:prevLen = [line('$'), col('$')] - - return g:snipPos[s:curPos][2] == -1 ? '' : s:SelectWord() -endf - -fun s:UpdatePlaceholderTabStops() - let changeLen = s:origWordLen - g:snipPos[s:curPos][2] - unl s:startCol s:origWordLen s:update - if !exists('s:oldVars') | return | endif - " Update tab stops in snippet if text has been added via "$#" - " (e.g., in "${1:foo}bar$1${2}"). - if changeLen != 0 - let curLine = line('.') - - for pos in g:snipPos - if pos == g:snipPos[s:curPos] | continue | endif - let changed = pos[0] == curLine && pos[1] > s:oldEndCol - let changedVars = 0 - let endPlaceholder = pos[2] - 1 + pos[1] - " Subtract changeLen from each tab stop that was after any of - " the current tab stop's placeholders. - for [lnum, col] in s:oldVars - if lnum > pos[0] | break | endif - if pos[0] == lnum - if pos[1] > col || (pos[2] == -1 && pos[1] == col) - let changed += 1 - elseif col < endPlaceholder - let changedVars += 1 - endif - endif - endfor - let pos[1] -= changeLen * changed - let pos[2] -= changeLen * changedVars " Parse variables within placeholders - " e.g., "${1:foo} ${2:$1bar}" - - if pos[2] == -1 | continue | endif - " Do the same to any placeholders in the other tab stops. - for nPos in pos[3] - let changed = nPos[0] == curLine && nPos[1] > s:oldEndCol - for [lnum, col] in s:oldVars - if lnum > nPos[0] | break | endif - if nPos[0] == lnum && nPos[1] > col - let changed += 1 - endif - endfor - let nPos[1] -= changeLen * changed - endfor - endfor - endif - unl s:endCol s:oldVars s:oldEndCol -endf - -fun s:UpdateTabStops() - let changeLine = s:endLine - g:snipPos[s:curPos][0] - let changeCol = s:endCol - g:snipPos[s:curPos][1] - if exists('s:origWordLen') - let changeCol -= s:origWordLen - unl s:origWordLen - endif - let lnum = g:snipPos[s:curPos][0] - let col = g:snipPos[s:curPos][1] - " Update the line number of all proceeding tab stops if <cr> has - " been inserted. - if changeLine != 0 - let changeLine -= 1 - for pos in g:snipPos - if pos[0] >= lnum - if pos[0] == lnum | let pos[1] += changeCol | endif - let pos[0] += changeLine - endif - if pos[2] == -1 | continue | endif - for nPos in pos[3] - if nPos[0] >= lnum - if nPos[0] == lnum | let nPos[1] += changeCol | endif - let nPos[0] += changeLine - endif - endfor - endfor - elseif changeCol != 0 - " Update the column of all proceeding tab stops if text has - " been inserted/deleted in the current line. - for pos in g:snipPos - if pos[1] >= col && pos[0] == lnum - let pos[1] += changeCol - endif - if pos[2] == -1 | continue | endif - for nPos in pos[3] - if nPos[0] > lnum | break | endif - if nPos[0] == lnum && nPos[1] >= col - let nPos[1] += changeCol - endif - endfor - endfor - endif -endf - -fun s:SelectWord() - let s:origWordLen = g:snipPos[s:curPos][2] - let s:oldWord = strpart(getline('.'), g:snipPos[s:curPos][1] - 1, - \ s:origWordLen) - let s:prevLen[1] -= s:origWordLen - if !empty(g:snipPos[s:curPos][3]) - let s:update = 1 - let s:endCol = -1 - let s:startCol = g:snipPos[s:curPos][1] - 1 - endif - if !s:origWordLen | return '' | endif - let l = col('.') != 1 ? 'l' : '' - if &sel == 'exclusive' - return "\<esc>".l.'v'.s:origWordLen."l\<c-g>" - endif - return s:origWordLen == 1 ? "\<esc>".l.'gh' - \ : "\<esc>".l.'v'.(s:origWordLen - 1)."l\<c-g>" -endf - -" This updates the snippet as you type when text needs to be inserted -" into multiple places (e.g. in "${1:default text}foo$1bar$1", -" "default text" would be highlighted, and if the user types something, -" UpdateChangedSnip() would be called so that the text after "foo" & "bar" -" are updated accordingly) -" -" It also automatically quits the snippet if the cursor is moved out of it -" while in insert mode. -fun s:UpdateChangedSnip(entering) - if exists('g:snipPos') && bufnr(0) != s:lastBuf - call s:RemoveSnippet() - elseif exists('s:update') " If modifying a placeholder - if !exists('s:oldVars') && s:curPos + 1 < s:snipLen - " Save the old snippet & word length before it's updated - " s:startCol must be saved too, in case text is added - " before the snippet (e.g. in "foo$1${2}bar${1:foo}"). - let s:oldEndCol = s:startCol - let s:oldVars = deepcopy(g:snipPos[s:curPos][3]) - endif - let col = col('.') - 1 - - if s:endCol != -1 - let changeLen = col('$') - s:prevLen[1] - let s:endCol += changeLen - else " When being updated the first time, after leaving select mode - if a:entering | return | endif - let s:endCol = col - 1 - endif - - " If the cursor moves outside the snippet, quit it - if line('.') != g:snipPos[s:curPos][0] || col < s:startCol || - \ col - 1 > s:endCol - unl! s:startCol s:origWordLen s:oldVars s:update - return s:RemoveSnippet() - endif - - call s:UpdateVars() - let s:prevLen[1] = col('$') - elseif exists('g:snipPos') - if !a:entering && g:snipPos[s:curPos][2] != -1 - let g:snipPos[s:curPos][2] = -2 - endif - - let col = col('.') - let lnum = line('.') - let changeLine = line('$') - s:prevLen[0] - - if lnum == s:endLine - let s:endCol += col('$') - s:prevLen[1] - let s:prevLen = [line('$'), col('$')] - endif - if changeLine != 0 - let s:endLine += changeLine - let s:endCol = col - endif - - " Delete snippet if cursor moves out of it in insert mode - if (lnum == s:endLine && (col > s:endCol || col < g:snipPos[s:curPos][1])) - \ || lnum > s:endLine || lnum < g:snipPos[s:curPos][0] - call s:RemoveSnippet() - endif - endif -endf - -" This updates the variables in a snippet when a placeholder has been edited. -" (e.g., each "$1" in "${1:foo} $1bar $1bar") -fun s:UpdateVars() - let newWordLen = s:endCol - s:startCol + 1 - let newWord = strpart(getline('.'), s:startCol, newWordLen) - if newWord == s:oldWord || empty(g:snipPos[s:curPos][3]) - return - endif - - let changeLen = g:snipPos[s:curPos][2] - newWordLen - let curLine = line('.') - let startCol = col('.') - let oldStartSnip = s:startCol - let updateTabStops = changeLen != 0 - let i = 0 - - for [lnum, col] in g:snipPos[s:curPos][3] - if updateTabStops - let start = s:startCol - if lnum == curLine && col <= start - let s:startCol -= changeLen - let s:endCol -= changeLen - endif - for nPos in g:snipPos[s:curPos][3][(i):] - " This list is in ascending order, so quit if we've gone too far. - if nPos[0] > lnum | break | endif - if nPos[0] == lnum && nPos[1] > col - let nPos[1] -= changeLen - endif - endfor - if lnum == curLine && col > start - let col -= changeLen - let g:snipPos[s:curPos][3][i][1] = col - endif - let i += 1 - endif - - " "Very nomagic" is used here to allow special characters. - call setline(lnum, substitute(getline(lnum), '\%'.col.'c\V'. - \ escape(s:oldWord, '\'), escape(newWord, '\&'), '')) - endfor - if oldStartSnip != s:startCol - call cursor(0, startCol + s:startCol - oldStartSnip) - endif - - let s:oldWord = newWord - let g:snipPos[s:curPos][2] = newWordLen -endf -" vim:noet:sw=4:ts=4:ft=vim diff --git a/.vim/buftabs.vim b/.vim/buftabs.vim deleted file mode 100644 index 30edea9..0000000 --- a/.vim/buftabs.vim +++ /dev/null @@ -1,309 +0,0 @@ -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" buftabs (C) 2006 Ico Doornekamp -" -" This program is free software; you can redistribute it and/or modify it -" under the terms of the GNU General Public License as published by the Free -" Software Foundation; either version 2 of the License, or (at your option) -" any later version. -" -" This program is distributed in the hope that it will be useful, but WITHOUT -" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -" more details. -" -" Introduction -" ------------ -" -" This is a simple script that shows a tabs-like list of buffers in the bottom -" of the window. The biggest advantage of this script over various others is -" that it does not take any lines away from your terminal, leaving more space -" for the document you're editing. The tabs are only visible when you need -" them - when you are switchin between buffers. -" -" Usage -" ----- -" -" This script draws buffer tabs on vim startup, when a new buffer is created -" and when switching between buffers. -" -" It might be handy to create a few maps for easy switching of buffers in your -" .vimrc file. For example, using F1 and F2 keys: -" -" noremap <f1> :bprev<CR> -" noremap <f2> :bnext<CR> -" -" or using control-left and control-right keys: -" -" :noremap <C-left> :bprev<CR> -" :noremap <C-right> :bnext<CR> -" -" -" The following extra configuration variables are availabe: -" -" * g:buftabs_only_basename -" -" Define this variable to make buftabs only print the filename of each buffer, -" omitting the preceding directory name. Add to your .vimrc: -" -" :let g:buftabs_only_basename=1 -" -" -" * g:buftabs_in_statusline -" -" Define this variable to make the plugin show the buftabs in the statusline -" instead of the command line. It is a good idea to configure vim to show -" the statusline as well when only one window is open. Add to your .vimrc: -" -" set laststatus=2 -" :let g:buftabs_in_statusline=1 -" -" -" * g:buftabs_active_highlight_group -" * g:buftabs_inactive_highlight_group -" -" The name of a highlight group (:help highligh-groups) which is used to -" show the name of the current active buffer and of all other inactive -" buffers. If these variables are not defined, no highlighting is used. -" (Highlighting is only functional when g:buftabs_in_statusline is enabled) -" -" :let g:buftabs_active_highlight_group="Visual" -" -" -" * g:buftabs_marker_start [ -" * g:buftabs_marker_end ] -" * g:buftabs_separator - -" -" These strings are drawn around each tab as separators. -" -" :let g:buftabs_separator = "." -" :let g:buftabs_marker_start = "(" -" :let g:buftabs_marker_end = ")" -" -" -" Changelog -" --------- -" -" 0.1 2006-09-22 Initial version -" -" 0.2 2006-09-22 Better handling when the list of buffers is longer then the -" window width. -" -" 0.3 2006-09-27 Some cleanups, set 'hidden' mode by default -" -" 0.4 2007-02-26 Don't draw buftabs until VimEnter event to avoid clutter at -" startup in some circumstances -" -" 0.5 2007-02-26 Added option for showing only filenames without directories -" in tabs -" -" 0.6 2007-03-04 'only_basename' changed to a global variable. Removed -" functions and add event handlers instead. 'hidden' mode -" broke some things, so is disabled now. Fixed documentation -" -" 0.7 2007-03-07 Added configuration option to show tabs in statusline -" instead of cmdline -" -" 0.8 2007-04-02 Update buftabs when leaving insertmode -" -" 0.9 2007-08-22 Now compatible with older Vim versions < 7.0 -" -" 0.10 2008-01-26 Added GPL license -" -" 0.11 2008-02-29 Added optional syntax highlighting to active buffer name -" -" 0.12 2009-03-18 Fixed support for split windows -" -" 0.13 2009-05-07 Store and reuse right-aligned part of original statusline -" -" 0.14 2010-01-28 Fixed bug that caused buftabs in command line being -" overwritten when 'hidden' mode is enabled. -" -" 0.15 2010-02-16 Fixed window width handling bug which caused strange -" behaviour in combination with the bufferlist plugin. -" Fixed wrong buffer display when deleting last window. -" Added extra options for tabs style and highlighting. -" -" 0.16 2010-02-28 Fixed bug causing errors when using buftabs in vim -" diff mode. -" -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -let w:buftabs_enabled = 0 -let w:original_statusline = matchstr(&statusline, "%=.*") - -" -" Don't bother when in diff mode -" - -if &diff - finish -endif - - -" -" Called on VimEnter event -" - -function! Buftabs_enable() - let w:buftabs_enabled = 1 -endfunction - - -" -" Persistent echo to avoid overwriting of status line when 'hidden' is enabled -" - -function! Pecho(msg) - let s:hold_ut=&ut|let &ut=1 - let s:Pecho=a:msg - aug Pecho - au CursorHold * ec s:Pecho - \|let &ut=s:hold_ut - \|aug Pecho|exe 'au!'|aug END|aug! Pecho - aug END -endf - - -" -" Draw the buftabs -" - -function! Buftabs_show(deleted_buf) - - let l:i = 1 - let l:list = '' - let l:start = 0 - let l:end = 0 - if ! exists("w:from") - let w:from = 0 - endif - - if ! exists("w:buftabs_enabled") - return - endif - - " Walk the list of buffers - - while(l:i <= bufnr('$')) - - " Only show buffers in the list, and omit help screens - - if buflisted(l:i) && getbufvar(l:i, "&modifiable") && a:deleted_buf != l:i - - " Get the name of the current buffer, and escape characters that might - " mess up the statusline - - if exists("g:buftabs_only_basename") - let l:name = fnamemodify(bufname(l:i), ":t") - else - let l:name = bufname(l:i) - endif - let l:name = substitute(l:name, "%", "%%", "g") - - " Append the current buffer number and name to the list. If the buffer - " is the active buffer, enclose it in some magick characters which will - " be replaced by markers later. If it is modified, it is appended with - " an exclaimation mark - - if winbufnr(winnr()) == l:i - let l:start = strlen(l:list) - let l:list = l:list . "\x01" - else - let l:list = l:list . ' ' - endif - - let l:buftabs_separator = "-" - if exists("g:buftabs_separator") - let l:buftabs_separator = g:buftabs_separator - endif - - let l:list = l:list . l:i . l:buftabs_separator - let l:list = l:list . l:name - - if getbufvar(l:i, "&modified") == 1 - let l:list = l:list . "!" - endif - - if winbufnr(winnr()) == l:i - let l:list = l:list . "\x02" - let l:end = strlen(l:list) - else - let l:list = l:list . ' ' - endif - end - - let l:i = l:i + 1 - endwhile - - " If the resulting list is too long to fit on the screen, chop - " out the appropriate part - - let l:width = winwidth(0) - 12 - - if(l:start < w:from) - let w:from = l:start - 1 - endif - if l:end > w:from + l:width - let w:from = l:end - l:width - endif - - let l:list = strpart(l:list, w:from, l:width) - - " Replace the magic characters by visible markers for highlighting the - " current buffer. The markers can be simple characters like square brackets, - " but can also be special codes with highlight groups - - let l:buftabs_marker_start = "[" - if exists("g:buftabs_marker_start") - let l:buftabs_marker_start = g:buftabs_marker_start - endif - - let l:buftabs_marker_end = "]" - if exists("g:buftabs_marker_end") - let l:buftabs_marker_end = g:buftabs_marker_end - endif - - if exists("g:buftabs_active_highlight_group") - if exists("g:buftabs_in_statusline") - let l:buftabs_marker_start = "%#" . g:buftabs_active_highlight_group . "#" . l:buftabs_marker_start - let l:buftabs_marker_end = l:buftabs_marker_end . "%##" - end - end - - if exists("g:buftabs_inactive_highlight_group") - if exists("g:buftabs_in_statusline") - let l:list = '%#' . g:buftabs_inactive_highlight_group . '#' . l:list - let l:list .= '%##' - let l:buftabs_marker_end = l:buftabs_marker_end . '%#' . g:buftabs_inactive_highlight_group . '#' - end - end - - let l:list = substitute(l:list, "\x01", l:buftabs_marker_start, 'g') - let l:list = substitute(l:list, "\x02", l:buftabs_marker_end, 'g') - - " Show the list. The buftabs_in_statusline variable determines of the list - " is displayed in the command line (volatile) or in the statusline - " (persistent) - - if exists("g:buftabs_in_statusline") - let &l:statusline = l:list . w:original_statusline - else - redraw - call Pecho(l:list) - end - -endfunction - - -" Hook to events to show buftabs at startup, when creating and when switching -" buffers - -autocmd VimEnter * call Buftabs_enable() -autocmd VimEnter,BufNew,BufEnter,BufWritePost * call Buftabs_show(-1) -autocmd BufDelete * call Buftabs_show(expand('<abuf>')) -if version >= 700 - autocmd InsertLeave,VimResized * call Buftabs_show(-1) -end - -" vi: ts=2 sw=2 - diff --git a/.vim/charm.vim b/.vim/charm.vim deleted file mode 100644 index 38f2c89..0000000 --- a/.vim/charm.vim +++ /dev/null @@ -1,18 +0,0 @@ -fu! SendToCharm(subject,mood) - if a:subject == "" - let subject=input("Subject: ") - else - let subject=a:subject - endif - if a:mood == "" - let mood=input("Mood: ") - else - let mood=a:mood - endif - exe "w!" - exe "!cat % | charm -q -s \"".subject."\" -m \"".mood."\"" -endf - -if !exists(":PostToLJ") - command PostToLJ :call SendToCharm("","") -endif diff --git a/.vim/closetag.vim b/.vim/closetag.vim deleted file mode 100644 index 6ce41fb..0000000 --- a/.vim/closetag.vim +++ /dev/null @@ -1,327 +0,0 @@ -" File: closetag.vim -" Summary: Functions and mappings to close open HTML/XML tags -" Uses: <C-_> -- close matching open tag -" Author: Steven Mueller <diffusor@ugcs.caltech.edu> -" Last Modified: Tue May 24 13:29:48 PDT 2005 -" Version: 0.9.1 -" XXX - breaks if close attempted while XIM is in preedit mode -" TODO - allow usability as a global plugin - -" Add g:unaryTagsStack - always contains html tags settings -" and g:closetag_default_xml - user should define this to default to xml -" When a close is attempted but b:unaryTagsStack undefined, -" use b:closetag_html_style to determine if the file is to be treated -" as html or xml. Failing that, check the filetype for xml or html. -" Finally, default to g:closetag_html_style. -" If the file is html, let b:unaryTagsStack=g:unaryTagsStack -" otherwise, let b:unaryTagsStack="" -" TODO - make matching work for all comments -" -- kinda works now, but needs syn sync minlines to be very long -" -- Only check whether in syntax in the beginning, then store comment tags -" in the tagstacks to determine whether to move into or out of comment mode -" TODO - The new normal mode mapping clears recent messages with its <ESC>, and -" it doesn't fix the null-undo issue for vim 5.7 anyway. -" TODO - make use of the following neat features: -" -- the ternary ?: operator -" -- :echomsg and :echoerr -" -- curly brace expansion for variables and function name definitions? -" -- check up on map <blah> \FuncName -" -" Description: -" This script eases redundant typing when writing html or xml files (even if -" you're very good with ctrl-p and ctrl-n :). Hitting ctrl-_ will initiate a -" search for the most recent open tag above that is not closed in the -" intervening space and then insert the matching close tag at the cursor. In -" normal mode, the close tag is inserted one character after cursor rather than -" at it, as if a<C-_> had been used. This allows putting close tags at the -" ends of lines while in normal mode, but disallows inserting them in the -" first column. -" -" For HTML, a configurable list of tags are ignored in the matching process. -" By default, the following tags will not be matched and thus not closed -" automatically: area, base, br, dd, dt, hr, img, input, link, meta, and -" param. -" -" For XML, all tags must have a closing match or be terminated by />, as in -" <empty-element/>. These empty element tags are ignored for matching. -" -" Comment checking is now handled by vim's internal syntax checking. If tag -" closing is initiated outside a comment, only tags outside of comments will -" be matched. When closing tags in comments, only tags within comments will -" be matched, skipping any non-commented out code (wee!). However, the -" process of determining the syntax ID of an arbitrary position can still be -" erroneous if a comment is not detected because the syntax highlighting is -" out of sync, or really slow if syn sync minlines is large. -" Set the b:closetag_disable_synID variable to disable this feature if you -" have really big chunks of comment in your code and closing tags is too slow. -" -" If syntax highlighting is not enabled, comments will not be handled very -" well. Commenting out HTML in certain ways may cause a "tag mismatch" -" message and no completion. For example, '<!--a href="blah">link!</a-->' -" between the cursor and the most recent unclosed open tag above causes -" trouble. Properly matched well formed tags in comments don't cause a -" problem. -" -" Install: -" To use, place this file in your standard vim scripts directory, and source -" it while editing the file you wish to close tags in. If the filetype is not -" set or the file is some sort of template with embedded HTML, you may force -" HTML style tag matching by first defining the b:closetag_html_style buffer -" variable. Otherwise, the default is XML style tag matching. -" -" Example: -" :let b:closetag_html_style=1 -" :source ~/.vim/scripts/closetag.vim -" -" For greater convenience, load this script in an autocommand: -" :au Filetype html,xml,xsl source ~/.vim/scripts/closetag.vim -" -" Also, set noignorecase for html files or edit b:unaryTagsStack to match your -" capitalization style. You may set this variable before or after loading the -" script, or simply change the file itself. -" -" Configuration Variables: -" -" b:unaryTagsStack Buffer local string containing a whitespace -" seperated list of element names that should be -" ignored while finding matching closetags. Checking -" is done according to the current setting of the -" ignorecase option. -" -" b:closetag_html_style Define this (as with let b:closetag_html_style=1) -" and source the script again to set the -" unaryTagsStack to its default value for html. -" -" b:closetag_disable_synID Define this to disable comment checking if tag -" closing is too slow. This can be set or unset -" without having to source again. -" -" Changelog: -" May 24, 2005 Tuesday -" * Changed function names to be script-local to avoid conflicts with other -" scripts' stack implementations. -" -" June 07, 2001 Thursday -" * Added comment handling. Currently relies on synID, so if syn sync -" minlines is small, the chance for failure is high, but if minlines is -" large, tagclosing becomes rather slow... -" -" * Changed normal mode closetag mapping to use <C-R> in insert mode -" rather than p in normal mode. This has 2 implications: -" - Tag closing no longer clobbers the unnamed register -" - When tag closing fails or finds no match, no longer adds to the undo -" buffer for recent vim 6.0 development versions. -" - However, clears the last message when closing tags in normal mode -" -" * Changed the closetag_html_style variable to be buffer-local rather than -" global. -" -" * Expanded documentation - -"------------------------------------------------------------------------------ -" User configurable settings -"------------------------------------------------------------------------------ - -" if html, don't close certain tags. Works best if ignorecase is set. -" otherwise, capitalize these elements according to your html editing style -if !exists("b:unaryTagsStack") || exists("b:closetag_html_style") - if &filetype == "html" || exists("b:closetag_html_style") - let b:unaryTagsStack="area base br dd dt hr img input link meta param" - else " for xsl and xsl - let b:unaryTagsStack="" - endif -endif - -" Has this already been loaded? -if exists("loaded_closetag") - finish -endif -let loaded_closetag=1 - -" set up mappings for tag closing -inoremap <C-_> <C-R>=GetCloseTag()<CR> -map <C-_> a<C-_><ESC> - -"------------------------------------------------------------------------------ -" Tag closer - uses the stringstack implementation below -"------------------------------------------------------------------------------ - -" Returns the most recent unclosed tag-name -" (ignores tags in the variable referenced by a:unaryTagsStack) -function! GetLastOpenTag(unaryTagsStack) - " Search backwards through the file line by line using getline() - " Overall strategy (moving backwards through the file from the cursor): - " Push closing tags onto a stack. - " On an opening tag, if the tag matches the stack top, discard both. - " -- if the tag doesn't match, signal an error. - " -- if the stack is empty, use this tag - let linenum=line(".") - let lineend=col(".") - 1 " start: cursor position - let first=1 " flag for first line searched - let b:TagStack="" " main stack of tags - let startInComment=s:InComment() - - let tagpat='</\=\(\k\|[-:]\)\+\|/>' - " Search for: closing tags </tag, opening tags <tag, and unary tag ends /> - while (linenum>0) - " Every time we see an end-tag, we push it on the stack. When we see an - " open tag, if the stack isn't empty, we pop it and see if they match. - " If no, signal an error. - " If yes, continue searching backwards. - " If stack is empty, return this open tag as the one that needs closing. - let line=getline(linenum) - if first - let line=strpart(line,0,lineend) - else - let lineend=strlen(line) - endif - let b:lineTagStack="" - let mpos=0 - let b:TagCol=0 - " Search the current line in the forward direction, pushing any tags - " onto a special stack for the current line - while (mpos > -1) - let mpos=matchend(line,tagpat) - if mpos > -1 - let b:TagCol=b:TagCol+mpos - let tag=matchstr(line,tagpat) - - if exists("b:closetag_disable_synID") || startInComment==s:InCommentAt(linenum, b:TagCol) - let b:TagLine=linenum - call s:Push(matchstr(tag,'[^<>]\+'),"b:lineTagStack") - endif - "echo "Tag: ".tag." ending at position ".mpos." in '".line."'." - let lineend=lineend-mpos - let line=strpart(line,mpos,lineend) - endif - endwhile - " Process the current line stack - while (!s:EmptystackP("b:lineTagStack")) - let tag=s:Pop("b:lineTagStack") - if match(tag, "^/") == 0 "found end tag - call s:Push(tag,"b:TagStack") - "echo linenum." ".b:TagStack - elseif s:EmptystackP("b:TagStack") && !s:Instack(tag, a:unaryTagsStack) "found unclosed tag - return tag - else - let endtag=s:Peekstack("b:TagStack") - if endtag == "/".tag || endtag == "/" - call s:Pop("b:TagStack") "found a open/close tag pair - "echo linenum." ".b:TagStack - elseif !s:Instack(tag, a:unaryTagsStack) "we have a mismatch error - echohl Error - echon "\rError:" - echohl None - echo " tag mismatch: <".tag."> doesn't match <".endtag.">. (Line ".linenum." Tagstack: ".b:TagStack.")" - return "" - endif - endif - endwhile - let linenum=linenum-1 | let first=0 - endwhile - " At this point, we have exhausted the file and not found any opening tag - echo "No opening tags." - return "" -endfunction - -" Returns closing tag for most recent unclosed tag, respecting the -" current setting of b:unaryTagsStack for tags that should not be closed -function! GetCloseTag() - let tag=GetLastOpenTag("b:unaryTagsStack") - if tag == "" - return "" - else - return "</".tag.">" - endif -endfunction - -" return 1 if the cursor is in a syntactically identified comment field -" (fails for empty lines: always returns not-in-comment) -function! s:InComment() - return synIDattr(synID(line("."), col("."), 0), "name") =~ 'Comment' -endfunction - -" return 1 if the position specified is in a syntactically identified comment field -function! s:InCommentAt(line, col) - return synIDattr(synID(a:line, a:col, 0), "name") =~ 'Comment' -endfunction - -"------------------------------------------------------------------------------ -" String Stacks -"------------------------------------------------------------------------------ -" These are strings of whitespace-separated elements, matched using the \< and -" \> patterns after setting the iskeyword option. -" -" The sname argument should contain a symbolic reference to the stack variable -" on which method should operate on (i.e., sname should be a string containing -" a fully qualified (ie: g:, b:, etc) variable name.) - -" Helper functions -function! s:SetKeywords() - let g:IsKeywordBak=&iskeyword - let &iskeyword="33-255" -endfunction - -function! s:RestoreKeywords() - let &iskeyword=g:IsKeywordBak -endfunction - -" Push el onto the stack referenced by sname -function! s:Push(el, sname) - if !s:EmptystackP(a:sname) - exe "let ".a:sname."=a:el.' '.".a:sname - else - exe "let ".a:sname."=a:el" - endif -endfunction - -" Check whether the stack is empty -function! s:EmptystackP(sname) - exe "let stack=".a:sname - if match(stack,"^ *$") == 0 - return 1 - else - return 0 - endif -endfunction - -" Return 1 if el is in stack sname, else 0. -function! s:Instack(el, sname) - exe "let stack=".a:sname - call s:SetKeywords() - let m=match(stack, "\\<".a:el."\\>") - call s:RestoreKeywords() - if m < 0 - return 0 - else - return 1 - endif -endfunction - -" Return the first element in the stack -function! s:Peekstack(sname) - call s:SetKeywords() - exe "let stack=".a:sname - let top=matchstr(stack, "\\<.\\{-1,}\\>") - call s:RestoreKeywords() - return top -endfunction - -" Remove and return the first element in the stack -function! s:Pop(sname) - if s:EmptystackP(a:sname) - echo "Error! Stack ".a:sname." is empty and can't be popped." - return "" - endif - exe "let stack=".a:sname - " Find the first space, loc is 0-based. Marks the end of 1st elt in stack. - call s:SetKeywords() - let loc=matchend(stack,"\\<.\\{-1,}\\>") - exe "let ".a:sname."=strpart(stack, loc+1, strlen(stack))" - let top=strpart(stack, match(stack, "\\<"), loc) - call s:RestoreKeywords() - return top -endfunction - -function! s:Clearstack(sname) - exe "let ".a:sname."=''" -endfunction diff --git a/.vim/coc-settings.json b/.vim/coc-settings.json deleted file mode 100644 index eea4ad7..0000000 --- a/.vim/coc-settings.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "suggest.timeout": 5000, - "suggest.enablePreview": true, - "suggest.maxPreviewWidth": 70, - "diagnostic.displayByAle": false, - "diagnostic.checkCurrentLine": true, - "python.linting.pylintEnabled": false, - "python.linting.flake8Enabled": true, - "python.linting.mypyEnabled": true, - "python.linting.mypyArgs": ["--ignore-missing-imports"], - "python.venvPath": "~/.virtualenvs", - "python.analysis.typeCheckingMode": "off", - "suggest.detailField": "abbr", - "suggest.snippetIndicator": "", - "rust-analyzer.server.path": "rust-analyzer", - "rust-analyzer.inlayHints.enable": false, - "languageserver": { - "ccls": { - "command": "ccls", - "filetypes": ["c", "cc", "cpp", "cuda", "objc", "objcpp"], - "rootPatterns": [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"], - "initializationOptions": { - "cache": { - "directory": ".ccls-cache" - } - } - }, - "golang": { - "command": "gopls", - "rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"], - "filetypes": ["go"] - } - } -} diff --git a/.vim/colors/barak.vim b/.vim/colors/barak.vim deleted file mode 100644 index c882944..0000000 --- a/.vim/colors/barak.vim +++ /dev/null @@ -1,110 +0,0 @@ -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" File: "/home/michener/.vim/barak.vim" -" Copyright (C) 2008, Barak Michener <barak@photonzero.com> -" Modified from colorscheme "dante": -" Copyright (C) 2002, Caciano Machado <caciano@inf.ufrgs.br> -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Colorscheme Option: -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -hi clear -if exists("syntax on") - syntax reset -endif -let g:colors_name = "barak" - -" General colors -hi Normal ctermfg=gray guifg=grey75 guibg=black -hi Directory term=bold ctermfg=blue guifg=royalblue -hi ErrorMsg term=standout ctermfg=white ctermbg=red guifg=white guibg=red3 -"hi NonText term=bold ctermfg=darkgray guibg=gray3 guifg=gray20 -hi NonText term=bold ctermfg=gray guibg=gray3 guifg=gray40 -hi SpecialKey term=bold ctermfg=darkgray guifg=gray30 -hi LineNr term=underline ctermfg=darkgray guifg=ivory4 guibg=gray4 -hi IncSearch term=reverse cterm=reverse gui=reverse,bold guifg=darkgoldenrod2 -hi Search term=reverse ctermfg=black ctermbg=yellow guifg=gray10 guibg=gold2 -hi Visual term=bold,reverse cterm=bold,reverse ctermfg=gray ctermbg=black gui=bold,reverse guifg=gray40 guibg=black -hi VisualNOS term=bold,underline cterm=bold,underline gui=bold,underline -hi MoreMsg term=bold ctermfg=green gui=bold guifg=olivedrab1 -hi ModeMsg term=bold ctermfg=red cterm=bold gui=bold guifg=red -hi Question term=standout ctermfg=green gui=bold guifg=olivedrab1 -hi WarningMsg term=standout ctermfg=red gui=bold guifg=red3 -hi WildMenu term=standout ctermfg=black ctermbg=yellow guifg=black guibg=gold2 -hi Folded term=standout ctermfg=blue ctermbg=white guifg=royalblue1 guibg=white -hi FoldColumn term=standout ctermfg=blue ctermbg=white guifg=royalblue3 guibg=white -hi DiffAdd term=bold ctermbg=blue guibg=royalblue2 -hi DiffChange term=bold ctermbg=darkmagenta guibg=maroon -hi DiffDelete term=bold cterm=bold ctermfg=lightblue ctermbg=cyan gui=bold guifg=lightblue guibg=cyan4 -hi DiffText term=reverse cterm=bold ctermbg=red gui=bold guibg=red3 -hi Cursor guifg=bg guibg=fg -hi CursorLine term=NONE cterm=bold guibg=grey20 -"hi lCursor guifg=bg guibg=fg -hi StatusLine term=reverse cterm=reverse gui=reverse guifg=gray60 -hi StatusLineNC term=reverse cterm=reverse gui=reverse guifg=gray40 -hi VertSplit term=reverse cterm=reverse gui=bold,reverse guifg=gray40 -hi Title term=bold ctermfg=magenta gui=bold guifg=aquamarine - -if version >= 700 - hi Pmenu ctermfg=white ctermbg=blue guifg=white guibg=MidnightBlue - hi PmenuSel ctermfg=darkblue ctermbg=white guibg=white guifg=MidnightBlue - hi PmenuSbar ctermfg=lightgray ctermbg=darkgray - hi PmenuThumb cterm=reverse - hi WildMenu term=standout ctermfg=white ctermbg=blue -endif - -" syntax hi colors -hi Comment term=bold ctermfg=darkgreen guifg=ForestGreen -hi PreProc term=underline ctermfg=darkmagenta guifg=magenta3 - -hi makoDelim term=underline ctermfg=darkyellow guifg=goldenrod1 guibg=gray25 -hi makoAttributeKey term=underline ctermfg=darkcyan gui=bold guifg=turquoise3 guibg=gray25 -hi makoAttributeValue term=underline ctermfg=red guifg=firebrick3 guibg=gray25 -hi makoText ctermfg=gray guifg=gray55 guibg=gray25 -hi makoEnd term=bold ctermfg=blue gui=bold guifg=RoyalBlue1 guibg=gray25 -hi makoComment term=bold ctermfg=darkgreen guifg=ForestGreen guibg=gray25 -hi makoEscape term=underline ctermfg=brown guifg=khaki3 guibg=gray25 - -hi Constant term=underline ctermfg=red guifg=#b62f61 -hi String term=underline ctermfg=red guifg=firebrick3 -hi Boolean term=underline ctermfg=magenta guifg=LightSalmon1 -"hi Type term=underline ctermfg=darkcyan gui=none guifg=CadetBlue3 -hi Type term=underline ctermfg=darkcyan gui=bold guifg=turquoise3 -hi Statement term=bold ctermfg=blue gui=bold guifg=RoyalBlue1 -hi Identifier term=underline ctermfg=darkcyan guifg=DeepSkyBlue -hi Function ctermfg=darkcyan gui=bold guifg=MediumPurple2 -hi Ignore term=bold ctermfg=darkgray gui=bold guifg=gray45 -hi Special term=underline ctermfg=brown guifg=khaki3 -hi Error term=reverse ctermfg=gray ctermbg=red guifg=gray guibg=red3 -hi Todo term=standout ctermfg=black ctermbg=yellow gui=bold guifg=gray10 guibg=yellow4 -hi Underlined term=underline cterm=underline ctermfg=blue gui=underline guifg=slateblue -hi Number term=underline ctermfg=darkyellow guifg=goldenrod1 -" syntax hi links -hi link String Constant -hi link Character Constant -hi link Number Constant -"hi link Boolean Constant -hi link javaScriptNull Special -hi link Float Number -"hi link Function Identifier -hi link Number Constant -hi link Conditional Statement -hi link Repeat Statement -hi link Label Statement -hi link Keyword Statement -hi link Exception Statement -hi link Operator Statement -hi link Include PreProc -"hi link Define PreProc -hi link Define Statement -hi link Macro PreProc -hi link PreCondit PreProc -"hi link StorageClass Type -hi link StorageClass Statement -"hi link Structure Type -hi link Structure Statement -hi link Typedef Type -hi link Tag Special -hi link SpecialChar Special -hi link Delimiter Special -hi link SpecialComment Special -hi link Debug Special -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" diff --git a/.vim/colors/baraknew.vim b/.vim/colors/baraknew.vim deleted file mode 100644 index 504e3c5..0000000 --- a/.vim/colors/baraknew.vim +++ /dev/null @@ -1,434 +0,0 @@ -" Vim color file -" Maintainer: Barak Michener <me@barakmich.com> -" Modified From: "lucius.vim" by Jonathan Filip <jfilip1024@gmail.com> -" Last Modified: Tue Mar 16 18:11:08 PDT 2010 -" Version: 1.0 -" -" GUI / 256 color terminal -" -" I started out trying to combine my favorite parts of other schemes and ended -" up with this (oceandeep, moria, peaksea, wombat, zenburn). -" -" This file also tries to have descriptive comments for each higlighting group -" so it is easy to understand what each part does. - - -set background=dark -hi clear -if exists("syntax_on") - syntax reset -endif -let colors_name="baraknew" - -" Some other colors to save -" blue: 3eb8e5 -" green: 92d400 -" c green: d5f876, cae682 -" new blue: 002D62 -" new gray: CCCCCC - - -" Base color -" ---------- -hi Normal guifg=#e0e0e0 guibg=#121212 -hi Normal ctermfg=253 ctermbg=NONE - - -" Comment Group -" ------------- -" any comment -hi Comment guifg=#238e23 gui=italic -hi Comment ctermfg=34 cterm=italic - - -" Constant Group -" -------------- -" any constant -hi Constant guifg=#e3ac3d gui=none -hi Constant ctermfg=172 cterm=none -" strings -hi String guifg=#f05656 gui=none -hi String ctermfg=203 cterm=none -" character constant -hi Character guifg=#e3ac3d gui=none -hi Character ctermfg=172 cterm=none -" numbers decimal/hex -hi Number guifg=#eead0e gui=none -hi Number ctermfg=214 cterm=none -" true, false -hi Boolean guifg=#e1634f gui=none -hi Boolean ctermfg=203 cterm=none -" float -hi Float guifg=#8cd0d3 gui=none -hi Float ctermfg=116 cterm=none - - -" Identifier Group -" ---------------- -" any variable name -hi Identifier guifg=#00bfff gui=none -hi Identifier ctermfg=39 cterm=none -" function, method, class -"hi Function guifg=#8e72c7 gui=none -"hi Function ctermfg=98 cterm=none -hi Function guifg=#c5a6ff gui=none -hi Function ctermfg=141 cterm=none - - -" Statement Group -" --------------- -" any statement -hi Statement guifg=#4876ff gui=bold -hi Statement ctermfg=33 cterm=bold -" if, then, else -"XXX Test this out -"hi Conditional guifg=#b3d38c gui=none -"hi Conditional ctermfg=150 cterm=none -hi Conditional guifg=#5fa6e8 gui=bold -hi Conditional ctermfg=75 cterm=bold -" try, catch, throw, raise -"XXX Test this out -"hi Exception guifg=#b3d38c gui=none -"hi Exception ctermfg=150 cterm=none -hi Exception guifg=#5fa6e8 gui=bold -hi Exception ctermfg=75 cterm=bold -" for, while, do -"XXX Test this out -"hi Repeat guifg=#b3d38c gui=none -"hi Repeat ctermfg=150 cterm=none -hi Repeat guifg=#5fa6e8 gui=bold -hi Repeat ctermfg=75 cterm=bold -" case, default -hi Label guifg=#4876ff gui=bold -hi Label ctermfg=69 cterm=bold -" sizeof, +, * -"hi Operator guifg=#b3d38c gui=none -"hi Operator ctermfg=150 cterm=none -hi Operator guifg=#5fa6e8 gui=bold -hi Operator ctermfg=75 cterm=bold -" any other keyword -hi Keyword guifg=#b3d38c gui=none -hi Keyword ctermfg=150 cterm=none - - -" Preprocessor Group -" ------------------ -" generic preprocessor -hi PreProc guifg=#e9dfaf gui=none -hi PreProc ctermfg=223 cterm=none -" #include -hi Include guifg=#e9dfaf gui=none -hi Include ctermfg=223 cterm=none -" #define -hi Define guifg=#e9dfaf gui=none -hi Define ctermfg=223 cterm=none -" same as define -hi Macro guifg=#e9dfaf gui=none -hi Macro ctermfg=223 cterm=none -" #if, #else, #endif -hi PreCondit guifg=#e9dfaf gui=none -hi PreCondit ctermfg=223 cterm=none - - -" Type Group -" ---------- -" int, long, char -hi Type guifg=#73e1e6 gui=none -hi Type ctermfg=116 cterm=none -" static, register, volative -hi StorageClass guifg=#66b7e1 gui=none -hi StorageClass ctermfg=116 cterm=none -" struct, union, enum -hi Structure guifg=#73e1e6 gui=none -hi Structure ctermfg=116 cterm=none -" typedef -hi Typedef guifg=#73e1e6 gui=none -hi Typedef ctermfg=116 cterm=none -" classes? b2ad50/143 -hi Class guifg=#00afff gui=none -hi Class ctermfg=39 cterm=none - -hi link cCustomClass Class -hi link javaCustomClass Class - - -" Special Group -" ------------- -" any special symbol -"hi Special guifg=#cca3b3 gui=none -"hi Special ctermfg=227 cterm=none -hi Special guifg=#c2b742 gui=none -hi Special ctermfg=179 cterm=none -" special character in a constant -hi SpecialChar guifg=#c2b742 gui=none -hi SpecialChar ctermfg=179 cterm=none -" things you can CTRL-] -hi Tag guifg=#c2b742 gui=none -hi Tag ctermfg=179 cterm=none -" character that needs attention -hi Delimiter guifg=#c2b742 gui=none -hi Delimiter ctermfg=179 cterm=none -" special things inside a comment -hi SpecialComment guifg=#c2b742 gui=none -hi SpecialComment ctermfg=179 cterm=none -" debugging statements -hi Debug guifg=#c2b742 guibg=NONE gui=none -hi Debug ctermfg=179 ctermbg=NONE cterm=none - - -" Underlined Group -" ---------------- -" text that stands out, html links -hi Underlined guifg=fg gui=underline -hi Underlined ctermfg=fg cterm=underline - - -" Ignore Group -" ------------ -" left blank, hidden -hi Ignore guifg=bg -hi Ignore ctermfg=0 - - -" Error Group -" ----------- -" any erroneous construct -hi Error guifg=#e37170 guibg=#432323 gui=none -hi Error ctermfg=167 ctermbg=52 cterm=none - - -" Todo Group -" ---------- -" todo, fixme, note, xxx -hi Todo guifg=#efefaf guibg=#434323 gui=bold -hi Todo ctermfg=229 ctermbg=58 cterm=bold - - -" Spelling -" -------- -" word not recognized -hi SpellBad guisp=#ee0000 gui=undercurl -hi SpellBad ctermbg=9 cterm=undercurl -" word not capitalized -hi SpellCap guisp=#eeee00 gui=undercurl -hi SpellCap ctermbg=12 cterm=undercurl -" rare word -hi SpellRare guisp=#ffa500 gui=undercurl -hi SpellRare ctermbg=13 cterm=undercurl -" wrong spelling for selected region -hi SpellLocal guisp=#ffa500 gui=undercurl -hi SpellLocal ctermbg=14 cterm=undercurl - - -" Cursor -" ------ -" character under the cursor -hi Cursor guifg=bg guibg=#a3e3ed -hi Cursor ctermfg=0 ctermbg=153 -" like cursor, but used when in IME mode -hi CursorIM guifg=bg guibg=#96cdcd -hi CursorIM ctermfg=0 ctermbg=116 -" cursor column -hi CursorColumn guifg=NONE guibg=#202438 gui=none -hi CursorColumn ctermfg=NONE ctermbg=236 cterm=none -" cursor line/row -hi CursorLine gui=NONE guibg=#202438 gui=none -hi CursorLine cterm=NONE ctermbg=236 cterm=none - - -" Misc -" ---- -" directory names and other special names in listings -hi Directory guifg=#c0e0b0 gui=none -hi Directory ctermfg=151 cterm=none -" error messages on the command line -hi ErrorMsg guifg=#ee0000 guibg=NONE gui=none -hi ErrorMsg ctermfg=196 ctermbg=NONE cterm=none -" column separating vertically split windows -hi VertSplit guifg=#777777 guibg=#363946 gui=none -hi VertSplit ctermfg=242 ctermbg=237 cterm=none -" columns where signs are displayed (used in IDEs) -hi SignColumn guifg=#9fafaf guibg=#181818 gui=none -hi SignColumn ctermfg=145 ctermbg=233 cterm=none -" line numbers -hi LineNr guifg=#818698 guibg=#363946 -hi LineNr ctermfg=102 ctermbg=237 -" match parenthesis, brackets -hi MatchParen guifg=#00ff00 guibg=NONE gui=bold -hi MatchParen ctermfg=46 ctermbg=NONE cterm=bold -" the 'more' prompt when output takes more than one line -hi MoreMsg guifg=#2e8b57 gui=none -hi MoreMsg ctermfg=29 cterm=none -" text showing what mode you are in -hi ModeMsg guifg=#76d5f8 guibg=NONE gui=none -hi ModeMsg ctermfg=117 ctermbg=NONE cterm=none -" the '~' and '@' and showbreak, '>' double wide char doesn't fit on line -hi NonText guifg=#404040 gui=none -hi NonText ctermfg=235 cterm=none -" the hit-enter prompt (show more output) and yes/no questions -hi Question guifg=fg gui=none -hi Question ctermfg=fg cterm=none -" meta and special keys used with map, unprintable characters -hi SpecialKey guifg=#405060 -hi SpecialKey ctermfg=237 -" titles for output from :set all, :autocmd, etc -hi Title guifg=#62bdde gui=none -hi Title ctermfg=74 cterm=none -"hi Title guifg=#5ec8e5 gui=none -" warning messages -hi WarningMsg guifg=#e5786d gui=none -hi WarningMsg ctermfg=173 cterm=none -" current match in the wildmenu completion -hi WildMenu guifg=#cae682 guibg=#363946 gui=bold,underline -hi WildMenu ctermfg=16 ctermbg=186 cterm=bold - - -" Diff -" ---- -" added line -hi DiffAdd guifg=#80a090 guibg=#313c36 gui=none -hi DiffAdd ctermfg=fg ctermbg=22 cterm=none -" changed line -hi DiffChange guifg=NONE guibg=#4a343a gui=none -hi DiffChange ctermfg=fg ctermbg=58 cterm=none -" deleted line -hi DiffDelete guifg=#6c6661 guibg=#3c3631 gui=none -hi DiffDelete ctermfg=fg ctermbg=52 cterm=none -" changed text within line -hi DiffText guifg=#f05060 guibg=#4a343a gui=bold -hi DiffText ctermfg=203 ctermbg=52 cterm=bold - - -" Folds -" ----- -" line used for closed folds -hi Folded guifg=#91d6f8 guibg=#363946 gui=none -hi Folded ctermfg=117 ctermbg=238 cterm=none -" column on side used to indicated open and closed folds -hi FoldColumn guifg=#91d6f8 guibg=#363946 gui=none -hi FoldColumn ctermfg=117 ctermbg=238 cterm=none - - -" Search -" ------ -" highlight incremental search text; also highlight text replaced with :s///c -hi IncSearch guifg=#66ffff gui=reverse -hi IncSearch ctermfg=87 cterm=reverse -" hlsearch (last search pattern), also used for quickfix -hi Search guibg=#e0e096 gui=none -hi Search ctermbg=214 cterm=none - - -" Popup Menu -" ---------- -" normal item in popup -"hi Pmenu guifg=#e0e0e0 guibg=#303840 gui=none -"hi Pmenu ctermfg=253 ctermbg=233 cterm=none -hi Pmenu guifg=#e0e0e0 guibg=#303840 gui=none -hi Pmenu ctermfg=253 ctermbg=237 cterm=none -" selected item in popup -hi PmenuSel guifg=#cae682 guibg=#505860 gui=none -hi PmenuSel ctermfg=186 ctermbg=239 cterm=none -" scrollbar in popup -hi PMenuSbar guibg=#505860 gui=none -hi PMenuSbar ctermbg=59 cterm=none -" thumb of the scrollbar in the popup -hi PMenuThumb guibg=#808890 gui=none -hi PMenuThumb ctermbg=102 cterm=none - - -" Status Line -" ----------- -" status line for current window -hi StatusLine guifg=#e0e0e0 guibg=#363946 gui=bold -hi StatusLine ctermfg=254 ctermbg=237 cterm=bold -" status line for non-current windows -hi StatusLineNC guifg=#767986 guibg=#363946 gui=none -hi StatusLineNC ctermfg=244 ctermbg=237 cterm=none - - -" Tab Lines -" --------- -" tab pages line, not active tab page label -hi TabLine guifg=#b6bf98 guibg=#363946 gui=none -hi TabLine ctermfg=244 ctermbg=236 cterm=none -" tab pages line, where there are no labels -hi TabLineFill guifg=#cfcfaf guibg=#363946 gui=none -hi TabLineFill ctermfg=187 ctermbg=236 cterm=none -" tab pages line, active tab page label -hi TabLineSel guifg=#efefef guibg=#414658 gui=bold -hi TabLineSel ctermfg=254 ctermbg=236 cterm=bold - - -" Visual -" ------ -" visual mode selection -hi Visual guifg=NONE guibg=#364458 -hi Visual ctermfg=NONE ctermbg=24 -" visual mode selection when vim is not owning the selection (x11 only) -hi VisualNOS guifg=fg gui=underline -hi VisualNOS ctermfg=fg cterm=underline - -" Specials for Languages -" ---------------------- - -"hi makoLine guibg=#111111 gui=none -"hi makoLine ctermbg=234 cterm=none -hi makoAttributeKey term=underline ctermfg=darkcyan gui=bold guifg=turquoise3 guibg=gray25 ctermbg=234 -hi makoAttributeValue term=underline ctermfg=red guifg=firebrick3 guibg=gray25 ctermbg=234 -"hi makoText ctermfg=gray guifg=gray55 guibg=gray25 ctermbg=234 -hi makoEnd guifg=#b3d38c gui=bold guibg=gray25 -hi makoEnd ctermfg=150 cterm=bold ctermbg=234 -hi makoDelim guifg=#e9dfaf gui=none guibg=gray25 -hi makoDelim ctermfg=223 cterm=none ctermbg=234 -hi makoEscape term=underline guibg=gray25 ctermbg=234 - - -" Specials for org-mode -" --------------------- - - -" define foreground colors for ****UNfolded**** outline heading levels -hi OL1 guifg=#7744ff ctermfg=blue -hi OL2 guifg=#aaaa22 ctermfg=brown -hi OL3 guifg=#00ccff ctermfg=cyan -hi OL4 guifg=#999999 gui=italic ctermfg=gray -hi OL5 guifg=#eeaaee ctermfg=lightgray -hi OL6 guifg=#9966ff ctermfg=yellow -hi OL7 guifg=#dd99dd ctermfg=red -hi OL8 guifg=cyan ctermfg=grey -hi OL9 guifg=magenta ctermfg=blue - -" various text item highlightings are below -hi Properties guifg=pink ctermfg=lightred -hi Tags guifg=pink ctermfg=lightred -hi Dates guifg=magenta ctermfg=magenta -hi stars guifg=#444444 ctermfg=darkgray -hi Props guifg=#ffa0a0 ctermfg=lightred -hi code guifg=orange gui=bold ctermfg=14 -hi itals gui=italic guifg=#aaaaaa ctermfg=lightgray -hi boldtext gui=bold guifg=#aaaaaa ctermfg=lightgray -hi undertext gui=underline guifg=#aaaaaa ctermfg=lightgray -hi lnumber guifg=#999999 ctermfg=gray - -hi TODO guifg=orange guibg=NONE ctermfg=14 ctermbg=NONE -hi CANCELED guifg=red guibg=NONE ctermfg=red ctermbg=NONE -hi STARTED guifg=yellow guibg=NONE ctermfg=yellow ctermbg=NONE -hi NEXT guifg=cyan guibg=NONE ctermfg=cyan ctermbg=NONE -hi DONE guifg=green guibg=NONE ctermfg=green ctermbg=NONE - -" For denite.nvim -" - -hi deniteMatchedChar guifg=#FFFFFF guibg=#5F87FF ctermfg=15 ctermbg=27 -hi link NormalFloat Pmenu - - -" Vim-Signify -" ---- -hi SignifySignAdd guifg=#80a090 guibg=#181818 gui=none -hi SignifySignAdd ctermfg=29 ctermbg=233 cterm=none -hi SignifySignChange guifg=#4a343a guibg=#181818 gui=none -hi SignifySignChange ctermfg=100 ctermbg=233 cterm=none -hi SignifySignDelete guifg=#6c6661 guibg=#181818 gui=none -hi SignifySignDelete ctermfg=124 ctermbg=233 cterm=none diff --git a/.vim/colors/dante.vim b/.vim/colors/dante.vim deleted file mode 100644 index f584889..0000000 --- a/.vim/colors/dante.vim +++ /dev/null @@ -1,83 +0,0 @@ -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" File: "/home/caciano/.vim/dante.vim" -" Created: "Thu, 23 May 2002 00:12:20 -0300 (caciano)" -" Updated: "Sat, 24 Aug 2002 14:04:21 -0300 (caciano)" -" Copyright (C) 2002, Caciano Machado <caciano@inf.ufrgs.br> -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Colorscheme Option: -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -hi clear -if exists("syntax on") - syntax reset -endif -let g:colors_name = "dante" - -" General colors -hi Normal ctermfg=gray guifg=peachpuff3 guibg=black -hi Directory term=bold ctermfg=blue guifg=royalblue -hi ErrorMsg term=standout ctermfg=white ctermbg=red guifg=white guibg=red3 -hi NonText term=bold ctermfg=darkgray guibg=gray3 guifg=gray20 -hi SpecialKey term=bold ctermfg=darkgray guifg=gray30 -hi LineNr term=underline ctermfg=darkgray guifg=ivory4 guibg=gray4 -hi IncSearch term=reverse cterm=reverse gui=reverse,bold guifg=darkgoldenrod2 -hi Search term=reverse ctermfg=black ctermbg=yellow guifg=gray10 guibg=gold2 -hi Visual term=bold,reverse cterm=bold,reverse ctermfg=gray ctermbg=black gui=bold,reverse guifg=gray40 guibg=black -hi VisualNOS term=bold,underline cterm=bold,underline gui=bold,underline -hi MoreMsg term=bold ctermfg=green gui=bold guifg=olivedrab1 -hi ModeMsg term=bold cterm=bold gui=bold -hi Question term=standout ctermfg=green gui=bold guifg=olivedrab1 -hi WarningMsg term=standout ctermfg=red gui=bold guifg=red3 -hi WildMenu term=standout ctermfg=black ctermbg=yellow guifg=black guibg=gold2 -hi Folded term=standout ctermfg=blue ctermbg=white guifg=royalblue1 guibg=white -hi FoldColumn term=standout ctermfg=blue ctermbg=white guifg=royalblue3 guibg=white -hi DiffAdd term=bold ctermbg=blue guibg=royalblue2 -hi DiffChange term=bold ctermbg=darkmagenta guibg=maroon -hi DiffDelete term=bold cterm=bold ctermfg=lightblue ctermbg=cyan gui=bold guifg=lightblue guibg=cyan4 -hi DiffText term=reverse cterm=bold ctermbg=red gui=bold guibg=red3 -hi Cursor guifg=bg guibg=fg -hi lCursor guifg=bg guibg=fg -hi StatusLine term=reverse cterm=reverse gui=reverse guifg=gray60 -hi StatusLineNC term=reverse cterm=reverse gui=reverse guifg=gray40 -hi VertSplit term=reverse cterm=reverse gui=bold,reverse guifg=gray40 -hi Title term=bold ctermfg=magenta gui=bold guifg=aquamarine - -" syntax hi colors -hi Comment term=bold ctermfg=darkcyan guifg=cyan4 -hi PreProc term=underline ctermfg=darkblue guifg=dodgerblue4 -hi Constant term=underline ctermfg=darkred guifg=firebrick3 -hi Type term=underline ctermfg=darkgreen gui=none guifg=chartreuse3 -hi Statement term=bold ctermfg=darkyellow gui=none guifg=gold3 -hi Identifier term=underline ctermfg=darkgreen guifg=darkolivegreen4 -hi Ignore term=bold ctermfg=darkgray guifg=gray45 -hi Special term=underline ctermfg=brown guifg=sienna -hi Error term=reverse ctermfg=gray ctermbg=red guifg=gray guibg=red3 -hi Todo term=standout ctermfg=black ctermbg=yellow gui=bold guifg=gray10 guibg=yellow4 -hi Underlined term=underline cterm=underline ctermfg=darkblue gui=underline guifg=slateblue -hi Number term=underline ctermfg=darkred guifg=red2 -" syntax hi links -hi link String Constant -hi link Character Constant -hi link Number Constant -hi link Boolean Constant -hi link Float Number -hi link Function Identifier -hi link Number Constant -hi link Conditional Statement -hi link Repeat Statement -hi link Label Statement -hi link Keyword Statement -hi link Exception Statement -hi link Operator Statement -hi link Include PreProc -hi link Define PreProc -hi link Macro PreProc -hi link PreCondit PreProc -hi link StorageClass Type -hi link Structure Type -hi link Typedef Type -hi link Tag Special -hi link SpecialChar Special -hi link Delimiter Special -hi link SpecialComment Special -hi link Debug Special -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" diff --git a/.vim/colors/ir_black.vim b/.vim/colors/ir_black.vim deleted file mode 100644 index 2e151d8..0000000 --- a/.vim/colors/ir_black.vim +++ /dev/null @@ -1,212 +0,0 @@ -" ir_black color scheme -" More at: http://blog.infinitered.com/entries/show/8 - - -" ******************************************************************************** -" Standard colors used in all ir_black themes: -" Note, x:x:x are RGB values -" -" normal: #f6f3e8 -" -" string: #A8FF60 168:255:96 -" string inner (punc, code, etc): #00A0A0 0:160:160 -" number: #FF73FD 255:115:253 -" comments: #7C7C7C 124:124:124 -" keywords: #96CBFE 150:203:254 -" operators: white -" class: #FFFFB6 255:255:182 -" method declaration name: #FFD2A7 255:210:167 -" regular expression: #E9C062 233:192:98 -" regexp alternate: #FF8000 255:128:0 -" regexp alternate 2: #B18A3D 177:138:61 -" variable: #C6C5FE 198:197:254 -" -" Misc colors: -" red color (used for whatever): #FF6C60 255:108:96 -" light red: #FFB6B0 255:182:176 -" -" brown: #E18964 good for special -" -" lightpurpleish: #FFCCFF -" -" Interface colors: -" background color: black -" cursor (where underscore is used): #FFA560 255:165:96 -" cursor (where block is used): white -" visual selection: #1D1E2C -" current line: #151515 21:21:21 -" search selection: #07281C 7:40:28 -" line number: #3D3D3D 61:61:61 - - -" ******************************************************************************** -" The following are the preferred 16 colors for your terminal -" Colors Bright Colors -" Black #4E4E4E #7C7C7C -" Red #FF6C60 #FFB6B0 -" Green #A8FF60 #CEFFAB -" Yellow #FFFFB6 #FFFFCB -" Blue #96CBFE #FFFFCB -" Magenta #FF73FD #FF9CFE -" Cyan #C6C5FE #DFDFFE -" White #EEEEEE #FFFFFF - - -" ******************************************************************************** -set background=dark -hi clear - -if exists("syntax_on") - syntax reset -endif - -let colors_name = "ir_black" - - -"hi Example guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE - -" General colors -hi Normal guifg=#f6f3e8 guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE -hi NonText guifg=#070707 guibg=black gui=NONE ctermfg=black ctermbg=NONE cterm=NONE - -hi Cursor guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=reverse -hi LineNr guifg=#3D3D3D guibg=black gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE - -hi VertSplit guifg=#202020 guibg=#202020 gui=NONE ctermfg=darkgray ctermbg=darkgray cterm=NONE -hi StatusLine guifg=#CCCCCC guibg=#202020 gui=italic ctermfg=white ctermbg=darkgray cterm=NONE -hi StatusLineNC guifg=black guibg=#202020 gui=NONE ctermfg=blue ctermbg=darkgray cterm=NONE - -hi Folded guifg=#a0a8b0 guibg=#384048 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE -hi Title guifg=#f6f3e8 guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=NONE -hi Visual guifg=NONE guibg=#262D51 gui=NONE ctermfg=NONE ctermbg=darkgray cterm=NONE - -hi SpecialKey guifg=#808080 guibg=#343434 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE - -hi WildMenu guifg=green guibg=yellow gui=NONE ctermfg=black ctermbg=yellow cterm=NONE -hi PmenuSbar guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=NONE -"hi Ignore guifg=gray guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE - -hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=white ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color -hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE -hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE - -" Message displayed in lower left, such as --INSERT-- -hi ModeMsg guifg=black guibg=#C6C5FE gui=BOLD ctermfg=black ctermbg=cyan cterm=BOLD - -if version >= 700 " Vim 7.x specific colors - hi CursorLine guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD - hi CursorColumn guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD - hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=BOLD ctermfg=white ctermbg=darkgray cterm=NONE - hi Pmenu guifg=#f6f3e8 guibg=#444444 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE - hi PmenuSel guifg=#000000 guibg=#cae682 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE - hi Search guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline -endif - -" Syntax highlighting -hi Comment guifg=#7C7C7C guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE -hi String guifg=#A8FF60 guibg=NONE gui=NONE ctermfg=green ctermbg=NONE cterm=NONE -hi Number guifg=#FF73FD guibg=NONE gui=NONE ctermfg=magenta ctermbg=NONE cterm=NONE - -hi Keyword guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE -hi PreProc guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE -hi Conditional guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE " if else end - -hi Todo guifg=#8f8f8f guibg=NONE gui=NONE ctermfg=red ctermbg=NONE cterm=NONE -hi Constant guifg=#99CC99 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE - -hi Identifier guifg=#C6C5FE guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE -hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE -hi Type guifg=#FFFFB6 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE -hi Statement guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE - -hi Special guifg=#E18964 guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE -hi Delimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE -hi Operator guifg=white guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE - -hi link Character Constant -hi link Boolean Constant -hi link Float Number -hi link Repeat Statement -hi link Label Statement -hi link Exception Statement -hi link Include PreProc -hi link Define PreProc -hi link Macro PreProc -hi link PreCondit PreProc -hi link StorageClass Type -hi link Structure Type -hi link Typedef Type -hi link Tag Special -hi link SpecialChar Special -hi link SpecialComment Special -hi link Debug Special - - -" Special for Ruby -hi rubyRegexp guifg=#B18A3D guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE -hi rubyRegexpDelimiter guifg=#FF8000 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE -hi rubyEscape guifg=white guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE -hi rubyInterpolationDelimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE -hi rubyControl guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE "and break, etc -"hi rubyGlobalVariable guifg=#FFCCFF guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE "yield -hi rubyStringDelimiter guifg=#336633 guibg=NONE gui=NONE ctermfg=lightgreen ctermbg=NONE cterm=NONE -"rubyInclude -"rubySharpBang -"rubyAccess -"rubyPredefinedVariable -"rubyBoolean -"rubyClassVariable -"rubyBeginEnd -"rubyRepeatModifier -"hi link rubyArrayDelimiter Special " [ , , ] -"rubyCurlyBlock { , , } - -hi link rubyClass Keyword -hi link rubyModule Keyword -hi link rubyKeyword Keyword -hi link rubyOperator Operator -hi link rubyIdentifier Identifier -hi link rubyInstanceVariable Identifier -hi link rubyGlobalVariable Identifier -hi link rubyClassVariable Identifier -hi link rubyConstant Type - - -" Special for Java -" hi link javaClassDecl Type -hi link javaScopeDecl Identifier -hi link javaCommentTitle javaDocSeeTag -hi link javaDocTags javaDocSeeTag -hi link javaDocParam javaDocSeeTag -hi link javaDocSeeTagParam javaDocSeeTag - -hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE -hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE -"hi javaClassDecl guifg=#CCFFCC guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE - - -" Special for XML -hi link xmlTag Keyword -hi link xmlTagName Conditional -hi link xmlEndTag Identifier - - -" Special for HTML -hi link htmlTag Keyword -hi link htmlTagName Conditional -hi link htmlEndTag Identifier - - -" Special for Javascript -hi link javaScriptNumber Number - - -" Special for Python -"hi link pythonEscape Keyword - - -" Special for CSharp -hi link csXmlTag Keyword - - -" Special for PHP diff --git a/.vim/colors/lucius.vim b/.vim/colors/lucius.vim deleted file mode 100644 index 067f333..0000000 --- a/.vim/colors/lucius.vim +++ /dev/null @@ -1,346 +0,0 @@ -" Vim color file -" Maintainer: Jonathan Filip <jfilip1024@gmail.com> -" Last Modified: Thu Jan 21, 2010 10:57AM -" Version: 3.2 -" -" GUI / 256 color terminal -" -" I started out trying to combine my favorite parts of other schemes and ended -" up with this (oceandeep, moria, peaksea, wombat, zenburn). -" -" This file also tries to have descriptive comments for each higlighting group -" so it is easy to understand what each part does. - - -set background=dark -hi clear -if exists("syntax_on") - syntax reset -endif -let colors_name="lucius" - -" Some other colors to save -" blue: 3eb8e5 -" green: 92d400 -" c green: d5f876, cae682 -" new blue: 002D62 -" new gray: CCCCCC - - -" Base color -" ---------- -hi Normal guifg=#e0e0e0 guibg=#202020 -hi Normal ctermfg=253 ctermbg=235 - - -" Comment Group -" ------------- -" any comment -hi Comment guifg=#606060 gui=none -hi Comment ctermfg=240 cterm=none - - -" Constant Group -" -------------- -" any constant -hi Constant guifg=#8cd0d3 gui=none -hi Constant ctermfg=116 cterm=none -" strings -hi String guifg=#80c0d9 gui=none -hi String ctermfg=110 cterm=none -" character constant -hi Character guifg=#80c0d9 gui=none -hi Character ctermfg=110 cterm=none -" numbers decimal/hex -hi Number guifg=#8cd0d3 gui=none -hi Number ctermfg=116 cterm=none -" true, false -hi Boolean guifg=#8cd0d3 gui=none -hi Boolean ctermfg=116 cterm=none -" float -hi Float guifg=#8cd0d3 gui=none -hi Float ctermfg=116 cterm=none - - -" Identifier Group -" ---------------- -" any variable name -hi Identifier guifg=#e6c080 gui=none -hi Identifier ctermfg=216 cterm=none -" function, method, class -hi Function guifg=#e6c080 gui=none -hi Function ctermfg=216 cterm=none - - -" Statement Group -" --------------- -" any statement -hi Statement guifg=#b3d38c gui=none -hi Statement ctermfg=150 cterm=none -" if, then, else -hi Conditional guifg=#b3d38c gui=none -hi Conditional ctermfg=150 cterm=none -" try, catch, throw, raise -hi Exception guifg=#b3d38c gui=none -hi Exception ctermfg=150 cterm=none -" for, while, do -hi Repeat guifg=#b3d38c gui=none -hi Repeat ctermfg=150 cterm=none -" case, default -hi Label guifg=#b3d38c gui=none -hi Label ctermfg=150 cterm=none -" sizeof, +, * -hi Operator guifg=#b3d38c gui=none -hi Operator ctermfg=150 cterm=none -" any other keyword -hi Keyword guifg=#b3d38c gui=none -hi Keyword ctermfg=150 cterm=none - - -" Preprocessor Group -" ------------------ -" generic preprocessor -hi PreProc guifg=#e9dfaf gui=none -hi PreProc ctermfg=223 cterm=none -" #include -hi Include guifg=#e9dfaf gui=none -hi Include ctermfg=223 cterm=none -" #define -hi Define guifg=#e9dfaf gui=none -hi Define ctermfg=223 cterm=none -" same as define -hi Macro guifg=#e9dfaf gui=none -hi Macro ctermfg=223 cterm=none -" #if, #else, #endif -hi PreCondit guifg=#e9dfaf gui=none -hi PreCondit ctermfg=223 cterm=none - - -" Type Group -" ---------- -" int, long, char -hi Type guifg=#93d6a9 gui=none -hi Type ctermfg=115 cterm=none -" static, register, volative -hi StorageClass guifg=#93d6a9 gui=none -hi StorageClass ctermfg=115 cterm=none -" struct, union, enum -hi Structure guifg=#93d6a9 gui=none -hi Structure ctermfg=115 cterm=none -" typedef -hi Typedef guifg=#93d6a9 gui=none -hi Typedef ctermfg=115 cterm=none - - -" Special Group -" ------------- -" any special symbol -hi Special guifg=#cca3b3 gui=none -hi Special ctermfg=181 cterm=none -" special character in a constant -hi SpecialChar guifg=#cca3b3 gui=none -hi SpecialChar ctermfg=181 cterm=none -" things you can CTRL-] -hi Tag guifg=#cca3b3 gui=none -hi Tag ctermfg=181 cterm=none -" character that needs attention -hi Delimiter guifg=#cca3b3 gui=none -hi Delimiter ctermfg=181 cterm=none -" special things inside a comment -hi SpecialComment guifg=#cca3b3 gui=none -hi SpecialComment ctermfg=181 cterm=none -" debugging statements -hi Debug guifg=#cca3b3 guibg=NONE gui=none -hi Debug ctermfg=181 ctermbg=NONE cterm=none - - -" Underlined Group -" ---------------- -" text that stands out, html links -hi Underlined guifg=fg gui=underline -hi Underlined ctermfg=fg cterm=underline - - -" Ignore Group -" ------------ -" left blank, hidden -hi Ignore guifg=bg -hi Ignore ctermfg=bg - - -" Error Group -" ----------- -" any erroneous construct -hi Error guifg=#e37170 guibg=#432323 gui=none -hi Error ctermfg=167 ctermbg=52 cterm=none - - -" Todo Group -" ---------- -" todo, fixme, note, xxx -hi Todo guifg=#efef8f guibg=NONE gui=underline -hi Todo ctermfg=228 ctermbg=NONE cterm=underline - - -" Spelling -" -------- -" word not recognized -hi SpellBad guisp=#ee0000 gui=undercurl -hi SpellBad ctermbg=9 cterm=undercurl -" word not capitalized -hi SpellCap guisp=#eeee00 gui=undercurl -hi SpellCap ctermbg=12 cterm=undercurl -" rare word -hi SpellRare guisp=#ffa500 gui=undercurl -hi SpellRare ctermbg=13 cterm=undercurl -" wrong spelling for selected region -hi SpellLocal guisp=#ffa500 gui=undercurl -hi SpellLocal ctermbg=14 cterm=undercurl - - -" Cursor -" ------ -" character under the cursor -hi Cursor guifg=bg guibg=#a3e3ed -hi Cursor ctermfg=bg ctermbg=153 -" like cursor, but used when in IME mode -hi CursorIM guifg=bg guibg=#96cdcd -hi CursorIM ctermfg=bg ctermbg=116 -" cursor column -hi CursorColumn guifg=NONE guibg=#202438 gui=none -hi CursorColumn ctermfg=NONE ctermbg=236 cterm=none -" cursor line/row -hi CursorLine gui=NONE guibg=#202438 gui=none -hi CursorLine cterm=NONE ctermbg=236 cterm=none - - -" Misc -" ---- -" directory names and other special names in listings -hi Directory guifg=#c0e0b0 gui=none -hi Directory ctermfg=151 cterm=none -" error messages on the command line -hi ErrorMsg guifg=#ee0000 guibg=NONE gui=none -hi ErrorMsg ctermfg=196 ctermbg=NONE cterm=none -" column separating vertically split windows -hi VertSplit guifg=#777777 guibg=#363946 gui=none -hi VertSplit ctermfg=242 ctermbg=237 cterm=none -" columns where signs are displayed (used in IDEs) -hi SignColumn guifg=#9fafaf guibg=#181818 gui=none -hi SignColumn ctermfg=145 ctermbg=233 cterm=none -" line numbers -hi LineNr guifg=#818698 guibg=#363946 -hi LineNr ctermfg=102 ctermbg=237 -" match parenthesis, brackets -hi MatchParen guifg=#00ff00 guibg=NONE gui=bold -hi MatchParen ctermfg=46 ctermbg=NONE cterm=bold -" the 'more' prompt when output takes more than one line -hi MoreMsg guifg=#2e8b57 gui=none -hi MoreMsg ctermfg=29 cterm=none -" text showing what mode you are in -hi ModeMsg guifg=#76d5f8 guibg=NONE gui=none -hi ModeMsg ctermfg=117 ctermbg=NONE cterm=none -" the '~' and '@' and showbreak, '>' double wide char doesn't fit on line -hi NonText guifg=#404040 gui=none -hi NonText ctermfg=235 cterm=none -" the hit-enter prompt (show more output) and yes/no questions -hi Question guifg=fg gui=none -hi Question ctermfg=fg cterm=none -" meta and special keys used with map, unprintable characters -hi SpecialKey guifg=#405060 -hi SpecialKey ctermfg=237 -" titles for output from :set all, :autocmd, etc -hi Title guifg=#62bdde gui=none -hi Title ctermfg=74 cterm=none -"hi Title guifg=#5ec8e5 gui=none -" warning messages -hi WarningMsg guifg=#e5786d gui=none -hi WarningMsg ctermfg=173 cterm=none -" current match in the wildmenu completion -hi WildMenu guifg=#cae682 guibg=#363946 gui=bold,underline -hi WildMenu ctermfg=16 ctermbg=186 cterm=bold - - -" Diff -" ---- -" added line -hi DiffAdd guifg=#80a090 guibg=#313c36 gui=none -hi DiffAdd ctermfg=108 ctermbg=22 cterm=none -" changed line -hi DiffChange guifg=NONE guibg=#4a343a gui=none -hi DiffChange ctermfg=fg ctermbg=52 cterm=none -" deleted line -hi DiffDelete guifg=#6c6661 guibg=#3c3631 gui=none -hi DiffDelete ctermfg=59 ctermbg=58 cterm=none -" changed text within line -hi DiffText guifg=#f05060 guibg=#4a343a gui=bold -hi DiffText ctermfg=203 ctermbg=52 cterm=bold - - -" Folds -" ----- -" line used for closed folds -hi Folded guifg=#91d6f8 guibg=#363946 gui=none -hi Folded ctermfg=117 ctermbg=238 cterm=none -" column on side used to indicated open and closed folds -hi FoldColumn guifg=#91d6f8 guibg=#363946 gui=none -hi FoldColumn ctermfg=117 ctermbg=238 cterm=none - - -" Search -" ------ -" highlight incremental search text; also highlight text replaced with :s///c -hi IncSearch guifg=#66ffff gui=reverse -hi IncSearch ctermfg=87 cterm=reverse -" hlsearch (last search pattern), also used for quickfix -hi Search guibg=#ffaa33 gui=none -hi Search ctermbg=214 cterm=none - - -" Popup Menu -" ---------- -" normal item in popup -hi Pmenu guifg=#e0e0e0 guibg=#303840 gui=none -hi Pmenu ctermfg=253 ctermbg=233 cterm=none -" selected item in popup -hi PmenuSel guifg=#cae682 guibg=#505860 gui=none -hi PmenuSel ctermfg=186 ctermbg=237 cterm=none -" scrollbar in popup -hi PMenuSbar guibg=#505860 gui=none -hi PMenuSbar ctermbg=59 cterm=none -" thumb of the scrollbar in the popup -hi PMenuThumb guibg=#808890 gui=none -hi PMenuThumb ctermbg=102 cterm=none - - -" Status Line -" ----------- -" status line for current window -hi StatusLine guifg=#e0e0e0 guibg=#363946 gui=bold -hi StatusLine ctermfg=254 ctermbg=237 cterm=bold -" status line for non-current windows -hi StatusLineNC guifg=#767986 guibg=#363946 gui=none -hi StatusLineNC ctermfg=244 ctermbg=237 cterm=none - - -" Tab Lines -" --------- -" tab pages line, not active tab page label -hi TabLine guifg=#b6bf98 guibg=#363946 gui=none -hi TabLine ctermfg=244 ctermbg=236 cterm=none -" tab pages line, where there are no labels -hi TabLineFill guifg=#cfcfaf guibg=#363946 gui=none -hi TabLineFill ctermfg=187 ctermbg=236 cterm=none -" tab pages line, active tab page label -hi TabLineSel guifg=#efefef guibg=#414658 gui=bold -hi TabLineSel ctermfg=254 ctermbg=236 cterm=bold - - -" Visual -" ------ -" visual mode selection -hi Visual guifg=NONE guibg=#364458 -hi Visual ctermfg=NONE ctermbg=24 -" visual mode selection when vim is not owning the selection (x11 only) -hi VisualNOS guifg=fg gui=underline -hi VisualNOS ctermfg=fg cterm=underline diff --git a/.vim/colors/ps_color.vim b/.vim/colors/ps_color.vim deleted file mode 100644 index fb3e02b..0000000 --- a/.vim/colors/ps_color.vim +++ /dev/null @@ -1,469 +0,0 @@ -" Vim colour file --- PSC -" Maintainer: Pan, Shi Zhu <Go to the following URL for my email> -" URL: http://vim.sourceforge.net/scripts/script.php?script_id=760 -" Last Change: 18 July 2006 -" Version: 2.9 -" -" Please prepend [VIM] in the title when writing e-mail to me, or it will -" be automatically treated as spam and removed. -" -" See the help document for all details, the help document will be -" installed after the script has been sourced once, do not open the -" script when you source it for the first time. -" - -" Initializations: {{{1 -" - -" without user_commands, all these are not possible -if !has("user_commands") - finish -end - -function! s:init_option(var, value) - if !exists("g:psc_".a:var) - execute "let s:".a:var." = ".a:value - else - let s:{a:var} = g:psc_{a:var} - endif -endfunction -command! -nargs=+ InitOpt call s:init_option(<f-args>) - -function! s:multi_hi(setting, ...) - let l:idx = a:0 - while l:idx > 0 - let l:hlgroup = a:{l:idx} - execute "highlight ".l:hlgroup." ".a:setting - let l:idx = l:idx - 1 - endwhile -endfunction -command! -nargs=+ MultiHi call s:multi_hi(<f-args>) - -InitOpt style 'cool' -InitOpt inversed_todo 0 -InitOpt use_default_for_cterm 0 -InitOpt statement_different_from_type 0 -if s:style == 'warm' - InitOpt fontface 'mixed' -else - InitOpt fontface 'plain' -endif - -if !has("gui_running") - call s:init_option("cterm_style", "'".s:style."'") - - " Forces 'cool' style when gui is not present Since the 'warm' style for - " terminal isn't available now, and probably never will be. - if s:cterm_style=='warm' | let s:cterm_style = 'cool' - endif - if s:use_default_for_cterm==1 | let s:cterm_style = 'default' - elseif s:use_default_for_cterm==2 | let s:cterm_style = 'defdark' - endif -endif - - -InitOpt other_style 0 - -if has("gui_running") - if s:style=='warm' || s:style=='default' - set background=light - elseif s:style=='cool' || s:style=='defdark' - set background=dark - else | let s:other_style = 1 - endif -else - if s:cterm_style=='cool' || s:cterm_style=='defdark' - set background=dark - elseif s:cterm_style=='default' - set background=light - else | let s:other_style = 1 - endif -endif - - -highlight clear - -if exists("syntax_on") - syntax reset -endif - -let s:color_name = expand("<sfile>:t:r") - -if s:other_style==0 | let g:colors_name = s:color_name - " Go from console version to gui, the color scheme should be sourced again - execute "autocmd TermChanged * if g:colors_name == '".s:color_name."' | " - \."colo ".s:color_name." | endif" -else - execute "runtime colors/".s:style.".vim" -endif - -" Command to go different schemes easier. -execute "command! -nargs=1 Colo if '".s:color_name."'!=\"<args>\" | " - \'let g:psc_style = "<args>"| endif | colo '.s:color_name - -" Give control to 'reloaded' scheme if possible -if s:style == 'reloaded' - finish -endif - -" }}}1 - -" Relevant Help: -" :h highlight-groups -" :h psc-cterm-color-table -" :ru syntax/hitest.vim -" -" Hardcoded Colors Comment: -" #aabbcc = Red aa, Green bb, Blue cc -" we must use hard-coded colours to get more 'tender' colours -" - - -" GUI: -" -" I don't want to abuse folding, but here folding is used to avoid confusion. -if s:style=='warm' - " Warm style for gui here {{{2 - " LIGHT COLOR DEFINE START - - highlight Normal guifg=#000000 guibg=#e0e0e0 - highlight Search guifg=#902000 guibg=#f8f8f8 - highlight Visual guifg=fg guibg=#a6caf0 - highlight Cursor guifg=#f0f0f0 guibg=#008000 - " The idea of CursorIM is pretty good, however, the feature is still buggy - " in the current version (Vim 7.0). - " The following line will be kept commented until the bug fixed. - " - " highlight CursorIM guifg=#f0f0f0 guibg=#800080 - highlight Special guifg=#907000 guibg=bg - highlight Comment guifg=#606000 guibg=bg - highlight Number guifg=#907000 guibg=bg - highlight Constant guifg=#007068 guibg=bg - highlight StatusLine guifg=fg guibg=#a6caf0 - highlight LineNr guifg=#686868 guibg=bg - highlight Question guifg=fg guibg=#d0d090 - highlight PreProc guifg=#009030 guibg=bg - if s:statement_different_from_type==1 - highlight Statement guifg=#4020a0 guibg=bg - else - highlight Statement guifg=#2060a8 guibg=bg - endif - highlight Type guifg=#0850a0 guibg=bg - if s:inversed_todo==1 - highlight Todo guifg=#e0e090 guibg=#000080 - else - highlight Todo guifg=#800000 guibg=#e0e090 - endif - " NOTE THIS IS IN THE WARM SECTION - highlight Error guifg=#c03000 guibg=bg - highlight Identifier guifg=#a030a0 guibg=bg - highlight ModeMsg guifg=fg guibg=#b0b0e0 - highlight VisualNOS guifg=fg guibg=#b0b0e0 - highlight SpecialKey guifg=#1050a0 guibg=bg - highlight NonText guifg=#002090 guibg=#d0d0d0 - highlight Directory guifg=#a030a0 guibg=bg - highlight ErrorMsg guifg=fg guibg=#f0b090 - highlight MoreMsg guifg=#489000 guibg=bg - highlight Title guifg=#a030a0 guibg=bg - highlight WarningMsg guifg=#b02000 guibg=bg - highlight WildMenu guifg=fg guibg=#d0d090 - highlight Folded guifg=fg guibg=#b0e0b0 - highlight FoldColumn guifg=fg guibg=#90e090 - highlight DiffAdd guifg=fg guibg=#b0b0e0 - highlight DiffChange guifg=fg guibg=#e0b0e0 - highlight DiffDelete guifg=#002090 guibg=#d0d0d0 - highlight DiffText guifg=fg guibg=#c0e080 - highlight SignColumn guifg=fg guibg=#90e090 - highlight IncSearch guifg=#f0f0f0 guibg=#806060 - highlight StatusLineNC guifg=fg guibg=#c0c0c0 - highlight VertSplit guifg=fg guibg=#c0c0c0 - highlight Underlined guifg=#6a5acd guibg=bg gui=underline - highlight Ignore guifg=bg guibg=bg - " NOTE THIS IS IN THE WARM SECTION - if v:version >= 700 - highlight SpellBad guifg=NONE guibg=NONE guisp=#c03000 - highlight SpellCap guifg=NONE guibg=NONE guisp=#2060a8 - highlight SpellRare guifg=NONE guibg=NONE guisp=#a030a0 - highlight SpellLocal guifg=NONE guibg=NONE guisp=#007068 - highlight Pmenu guifg=fg guibg=#e0b0e0 - highlight PmenuSel guifg=#f0f0f0 guibg=#806060 - highlight PmenuSbar guifg=fg guibg=#c0c0c0 - highlight PmenuThumb guifg=fg guibg=#c0e080 - highlight TabLine guifg=fg guibg=#c0c0c0 gui=underline - highlight TabLineFill guifg=fg guibg=#c0c0c0 gui=underline - highlight TabLineSel guifg=fg guibg=bg - highlight CursorColumn guifg=NONE guibg=#f0b090 - highlight CursorLine guifg=NONE guibg=NONE gui=underline - highlight MatchParen guifg=NONE guibg=#c0e080 - endif - - " LIGHT COLOR DEFINE END - " }}}2 -elseif s:style=='cool' - " Cool style for gui here {{{2 - " DARK COLOR DEFINE START - - highlight Normal guifg=#d0d0d0 guibg=#202020 - highlight Comment guifg=#d0d090 guibg=bg - highlight Constant guifg=#80c0e0 guibg=bg - highlight Number guifg=#e0c060 guibg=bg - highlight Identifier guifg=#f0c0f0 guibg=bg - if s:statement_different_from_type==1 - highlight Statement guifg=#98a8f0 guibg=bg - else - highlight Statement guifg=#c0d8f8 guibg=bg - endif - highlight PreProc guifg=#60f080 guibg=bg - highlight Type guifg=#b0d0f0 guibg=bg - highlight Special guifg=#e0c060 guibg=bg - highlight Error guifg=#f08060 guibg=bg - if s:inversed_todo==1 - highlight Todo guifg=#d0d090 guibg=#000080 - else - highlight Todo guifg=#800000 guibg=#d0d090 - endif - highlight Search guifg=#e0e0e0 guibg=#800000 - highlight Visual guifg=#000000 guibg=#a6caf0 - highlight Cursor guifg=#000000 guibg=#00f000 - " NOTE THIS IS IN THE COOL SECTION - " highlight CursorIM guifg=#000000 guibg=#f000f0 - highlight StatusLine guifg=#000000 guibg=#a6caf0 - highlight LineNr guifg=#b0b0b0 guibg=bg - highlight Question guifg=#000000 guibg=#d0d090 - highlight ModeMsg guifg=fg guibg=#000080 - highlight VisualNOS guifg=fg guibg=#000080 - highlight SpecialKey guifg=#b0d0f0 guibg=bg - highlight NonText guifg=#6080f0 guibg=#101010 - highlight Directory guifg=#80c0e0 guibg=bg - highlight ErrorMsg guifg=#d0d090 guibg=#800000 - highlight MoreMsg guifg=#c0e080 guibg=bg - highlight Title guifg=#f0c0f0 guibg=bg - highlight WarningMsg guifg=#f08060 guibg=bg - highlight WildMenu guifg=#000000 guibg=#d0d090 - highlight Folded guifg=#d0d0d0 guibg=#004000 - highlight FoldColumn guifg=#e0e0e0 guibg=#008000 - highlight DiffAdd guifg=fg guibg=#000080 - highlight DiffChange guifg=fg guibg=#800080 - highlight DiffDelete guifg=#6080f0 guibg=#202020 - highlight DiffText guifg=#000000 guibg=#c0e080 - highlight SignColumn guifg=#e0e0e0 guibg=#008000 - highlight IncSearch guifg=#000000 guibg=#d0d0d0 - highlight StatusLineNC guifg=#000000 guibg=#c0c0c0 - highlight VertSplit guifg=#000000 guibg=#c0c0c0 - highlight Underlined guifg=#80a0ff guibg=bg gui=underline - highlight Ignore guifg=#000000 guibg=bg - " NOTE THIS IS IN THE COOL SECTION - if v:version >= 700 - highlight SpellBad guifg=NONE guibg=NONE guisp=#f08060 - highlight SpellCap guifg=NONE guibg=NONE guisp=#6080f0 - highlight SpellRare guifg=NONE guibg=NONE guisp=#f0c0f0 - highlight SpellLocal guifg=NONE guibg=NONE guisp=#c0d8f8 - highlight Pmenu guifg=fg guibg=#800080 - highlight PmenuSel guifg=#000000 guibg=#d0d0d0 - highlight PmenuSbar guifg=fg guibg=#000080 - highlight PmenuThumb guifg=fg guibg=#008000 - highlight TabLine guifg=fg guibg=#008000 gui=underline - highlight TabLineFill guifg=fg guibg=#008000 gui=underline - highlight TabLineSel guifg=fg guibg=bg - highlight CursorColumn guifg=NONE guibg=#800000 - highlight CursorLine guifg=NONE guibg=NONE gui=underline - highlight MatchParen guifg=NONE guibg=#800080 - endif - - " DARK COLOR DEFINE END - " }}}2 -elseif s:style=='defdark' - highlight Normal guifg=#f0f0f0 guibg=#000000 -endif - -" Take NT gui for example, If you want to use a console font such as -" Lucida_Console with font size larger than 14, the font looks already thick, -" and the bold font for that will be too thick, you may not want it be bolded. -" The following code does this. -" -" All of the bold font may be disabled, since continuously switching between -" bold and plain font hurts consistency and will inevitably fatigue your eye! - -" Maximum 20 parameters for vim script function -" -MultiHi gui=NONE ModeMsg Search Cursor Special Comment Constant Number LineNr Question PreProc Statement Type Todo Error Identifier Normal - -MultiHi gui=NONE VisualNOS SpecialKey NonText Directory ErrorMsg MoreMsg Title WarningMsg WildMenu Folded FoldColumn DiffAdd DiffChange DiffDelete DiffText SignColumn - -" Vim 7 added stuffs -if v:version >= 700 - MultiHi gui=NONE Ignore PmenuSel PmenuSel PmenuSbar PmenuThumb TabLine TabLineFill TabLineSel - - " the gui=undercurl guisp could only support in Vim 7 - MultiHi gui=undercurl SpellBad SpellCap SpellRare SpellLocal - if s:style=="cool" || s:style=="warm" - MultiHi gui=underline TabLine TabLineFill Underlined CursorLine - else - MultiHi gui=underline TabLine Underlined - endif -endif - -" For reversed stuffs -MultiHi gui=NONE IncSearch StatusLine StatusLineNC VertSplit Visual - -if s:style=="cool" || s:style=="warm" - if s:fontface=="mixed" - MultiHi gui=bold IncSearch StatusLine StatusLineNC VertSplit Visual - endif -else - if s:fontface=="mixed" - hi StatusLine gui=bold,reverse - else - hi StatusLine gui=reverse - endif - MultiHi gui=reverse IncSearch StatusLineNC VertSplit Visual -endif - -" Enable the bold style -if s:fontface=="mixed" - MultiHi gui=bold Question DiffText Statement Type MoreMsg ModeMsg NonText Title VisualNOS DiffDelete TabLineSel -endif - - - - -" Color Term: - -" It's not quite possible to support 'cool' and 'warm' simultaneously, since -" we cannot expect a terminal to have more than 16 color names. -" - -" I assume Vim will never go to cterm mode when has("gui_running") returns 1, -" Please enlighten me if I am wrong. -" -if !has('gui_running') - " cterm settings {{{1 - if s:cterm_style=='cool' - - highlight Normal ctermfg=LightGrey ctermbg=Black - highlight Search ctermfg=White ctermbg=DarkRed - highlight Visual ctermfg=Black ctermbg=DarkCyan - highlight Cursor ctermfg=Black ctermbg=Green - highlight Special ctermfg=Yellow ctermbg=Black - highlight Comment ctermfg=DarkYellow ctermbg=Black - highlight Constant ctermfg=Blue ctermbg=Black - highlight Number ctermfg=Yellow ctermbg=Black - highlight StatusLine ctermfg=Black ctermbg=DarkCyan - highlight LineNr ctermfg=DarkGrey ctermbg=Black - highlight Question ctermfg=Black ctermbg=DarkYellow - highlight PreProc ctermfg=Green ctermbg=Black - highlight Statement ctermfg=Cyan ctermbg=Black - highlight Type ctermfg=Cyan ctermbg=Black - if s:inversed_todo==0 - highlight Todo ctermfg=DarkRed ctermbg=DarkYellow - else - highlight Todo ctermfg=DarkYellow ctermbg=DarkBlue - endif - highlight Error ctermfg=Red ctermbg=Black - highlight Identifier ctermfg=Magenta ctermbg=Black - highlight Folded ctermfg=White ctermbg=DarkGreen - highlight ModeMsg ctermfg=Grey ctermbg=DarkBlue - highlight VisualNOS ctermfg=Grey ctermbg=DarkBlue - highlight SpecialKey ctermfg=Cyan ctermbg=Black - highlight NonText ctermfg=Blue ctermbg=Black - highlight Directory ctermfg=Blue ctermbg=Black - highlight ErrorMsg ctermfg=DarkYellow ctermbg=DarkRed - highlight MoreMsg ctermfg=Green ctermbg=Black - highlight Title ctermfg=Magenta ctermbg=Black - highlight WarningMsg ctermfg=Red ctermbg=Black - highlight WildMenu ctermfg=Black ctermbg=DarkYellow - highlight FoldColumn ctermfg=White ctermbg=DarkGreen - highlight SignColumn ctermfg=White ctermbg=DarkGreen - highlight DiffText ctermfg=Black ctermbg=DarkYellow - highlight DiffDelete ctermfg=Blue ctermbg=Black - - if v:version >= 700 - highlight SpellBad ctermfg=NONE ctermbg=DarkRed - highlight SpellCap ctermfg=NONE ctermbg=DarkBlue - highlight SpellRare ctermfg=NONE ctermbg=DarkMagenta - highlight SpellLocal ctermfg=NONE ctermbg=DarkGreen - highlight Pmenu ctermfg=fg ctermbg=DarkMagenta - highlight PmenuSel ctermfg=bg ctermbg=fg - highlight PmenuSbar ctermfg=fg ctermbg=DarkBlue - highlight PmenuThumb ctermfg=fg ctermbg=DarkGreen - highlight TabLine ctermfg=fg ctermbg=DarkGreen cterm=underline - highlight TabLineFill ctermfg=fg ctermbg=DarkGreen cterm=underline - highlight TabLineSel ctermfg=fg ctermbg=bg - highlight CursorColumn ctermfg=NONE ctermbg=DarkRed - highlight CursorLine ctermfg=NONE ctermbg=NONE cterm=underline - highlight MatchParen ctermfg=NONE ctermbg=DarkMagenta - endif - if &t_Co==8 - " 8 colour terminal support, this assumes 16 colour is available through - " setting the 'bold' attribute, will get bright foreground colour. - " However, the bright background color is not available for 8-color terms. - " - " You can manually set t_Co=16 in your .vimrc to see if your terminal - " supports 16 colours, - MultiHi cterm=none DiffText Visual Cursor Comment Todo StatusLine Question DiffChange ModeMsg VisualNOS ErrorMsg WildMenu DiffAdd Folded DiffDelete Normal PmenuThumb - MultiHi cterm=bold Search Special Constant Number LineNr PreProc Statement Type Error Identifier SpecialKey NonText MoreMsg Title WarningMsg FoldColumn SignColumn Directory DiffDelete - - else - " Background > 7 is only available with 16 or more colors - - " Only use the s:fontface option when there is 16-colour(or more) - " terminal support - - MultiHi cterm=none WarningMsg Search Visual Cursor Special Comment Constant Number LineNr PreProc Todo Error Identifier Folded SpecialKey Directory ErrorMsg Normal PmenuThumb - MultiHi cterm=none WildMenu FoldColumn SignColumn DiffAdd DiffChange Question StatusLine DiffText - MultiHi cterm=reverse IncSearch StatusLineNC VertSplit - - " Well, well, bold font with color 0-7 is not possible. - " So, the Question, StatusLine, DiffText cannot act as expected. - - call s:multi_hi("cterm=".((s:fontface=="plain") ? "none" : "bold"), "Statement", "Type", "MoreMsg", "ModeMsg", "NonText", "Title", "VisualNOS", "DiffDelete", "TabLineSel") - - endif - - elseif s:cterm_style=='defdark' - highlight Normal ctermfg=LightGrey ctermbg=Black - endif - " }}}1 -endif - - -" Term: -" For console with only 4 colours (term, not cterm), we'll use the default. -" ... -" The default colorscheme is good enough for terms with no more than 4 colours -" - - -" Links: -" -if (s:style=='cool') || (s:style == 'warm') - " COLOR LINKS DEFINE START - - highlight link String Constant - " Character must be different from strings because in many languages - " (especially C, C++) a 'char' variable is scalar while 'string' is pointer, - " mistaken a 'char' for a 'string' will cause disaster! - highlight link Character Number - highlight link SpecialChar LineNr - highlight link Tag Identifier - " The following are not standard hi links, - " these are used by DrChip - highlight link Warning MoreMsg - highlight link Notice Constant - " these are used by Calendar - highlight link CalToday PreProc - " these are used by TagList - highlight link MyTagListTagName IncSearch - highlight link MyTagListTagScope Constant - - " COLOR LINKS DEFINE END -endif - - -" Clean: -" -delcommand InitOpt -delcommand MultiHi - -" vim:et:nosta:sw=2:ts=8: -" vim600:fdm=marker:fdl=1: diff --git a/.vim/colors/zenburn.vim b/.vim/colors/zenburn.vim deleted file mode 100644 index 73a18e4..0000000 --- a/.vim/colors/zenburn.vim +++ /dev/null @@ -1,245 +0,0 @@ -" Vim color file -" Maintainer: Jani Nurminen <jani.nurminen@pp4.inet.fi> -" Last Change: $Id: zenburn.vim,v 1.15 2006/09/07 15:57:46 jnurmine Exp $ -" URL: http://slinky.imukuppi.org/zenburn/ -" License: GPL -" -" Nothing too fancy, just some alien fruit salad to keep you in the zone. -" This syntax file was designed to be used with dark environments and -" low light situations. Of course, if it works during a daybright office, go -" ahead :) -" -" Owes heavily to other Vim color files! With special mentions -" to "BlackDust", "Camo" and "Desert". -" -" To install, copy to ~/.vim/colors directory. Then :colorscheme zenburn. -" See also :help syntax -" -" Credits: -" - Jani Nurminen - original Zenburn -" - Steve Hall & Cream posse - higher-contrast Visual selection -" - Kurt Maier - 256 color console coloring, low and high contrast toggle, -" bug fixing -" -" CONFIGURABLE PARAMETERS: -" -" You can use the default (don't set any parameters), or you can -" set some parameters to tweak the Zenburn colours. -" -" * You can now set a darker background for bright environments. To activate, use: -" contrast Zenburn, use: -" -" let g:zenburn_high_Contrast = 1 -" -" * To get more contrast to the Visual selection, use -" -" let g:zenburn_alternate_Visual = 1 -" -" * To use alternate colouring for Error message, use -" -" let g:zenburn_alternate_Error = 1 -" -" * The new default for Include is a duller orange. To use the original -" colouring for Include, use -" -" let g:zenburn_alternate_Include = 1 -" -" * To turn the parameter(s) back to defaults, use UNLET: -" -" unlet g:zenburn_alternate_Include -" -" Setting to 0 won't work! -" -" That's it, enjoy! -" -" TODO -" - Visual alternate color is broken? Try GVim >= 7.0.66 if you have trouble -" - IME colouring (CursorIM) -" - obscure syntax groups: check and colourize -" - add more groups if necessary - -set background=dark -hi clear -if exists("syntax_on") - syntax reset -endif -let g:colors_name="zenburn" - -hi Boolean guifg=#dca3a3 -hi Character guifg=#dca3a3 gui=bold -hi Comment guifg=#7f9f7f gui=italic -hi Conditional guifg=#f0dfaf gui=bold -hi Constant guifg=#dca3a3 gui=bold -hi Cursor guifg=#000d18 guibg=#8faf9f gui=bold -hi Debug guifg=#bca3a3 gui=bold -hi Define guifg=#ffcfaf gui=bold -hi Delimiter guifg=#8f8f8f -hi DiffAdd guifg=#709080 guibg=#313c36 gui=bold -hi DiffChange guibg=#333333 -hi DiffDelete guifg=#333333 guibg=#464646 -hi DiffText guifg=#ecbcbc guibg=#41363c gui=bold -hi Directory guifg=#dcdccc gui=bold -hi ErrorMsg guifg=#80d4aa guibg=#2f2f2f gui=bold -hi Exception guifg=#c3bf9f gui=bold -hi Float guifg=#c0bed1 -hi FoldColumn guifg=#93b3a3 guibg=#3f4040 -hi Folded guifg=#93b3a3 guibg=#3f4040 -hi Function guifg=#efef8f -hi Identifier guifg=#efdcbc -hi IncSearch guibg=#f8f893 guifg=#385f38 -hi Keyword guifg=#f0dfaf gui=bold -hi Label guifg=#dfcfaf gui=underline -hi LineNr guifg=#9fafaf guibg=#262626 -hi Macro guifg=#ffcfaf gui=bold -hi ModeMsg guifg=#ffcfaf gui=none -hi MoreMsg guifg=#ffffff gui=bold -hi NonText guifg=#404040 -hi Number guifg=#8cd0d3 -hi Operator guifg=#f0efd0 -hi PreCondit guifg=#dfaf8f gui=bold -hi PreProc guifg=#ffcfaf gui=bold -hi Question guifg=#ffffff gui=bold -hi Repeat guifg=#ffd7a7 gui=bold -hi Search guifg=#ffffe0 guibg=#284f28 -hi SpecialChar guifg=#dca3a3 gui=bold -hi SpecialComment guifg=#82a282 gui=bold -hi Special guifg=#cfbfaf -hi SpecialKey guifg=#9ece9e -hi Statement guifg=#e3ceab gui=none -hi StatusLine guifg=#2e4340 guibg=#ccdc90 -hi StatusLineNC guifg=#2e3330 guibg=#88b090 -hi StorageClass guifg=#c3bf9f gui=bold -hi String guifg=#cc9393 -hi Structure guifg=#efefaf gui=bold -hi Tag guifg=#e89393 gui=bold -hi Title guifg=#efefef gui=bold -hi Todo guifg=#dfdfdf guibg=bg gui=bold -hi Typedef guifg=#dfe4cf gui=bold -hi Type guifg=#dfdfbf gui=bold -hi Underlined guifg=#dcdccc gui=underline -hi VertSplit guifg=#303030 guibg=#688060 -hi VisualNOS guifg=#333333 guibg=#f18c96 gui=bold,underline -hi WarningMsg guifg=#ffffff guibg=#333333 gui=bold -hi WildMenu guibg=#2c302d guifg=#cbecd0 gui=underline - -" Entering Kurt zone -if &t_Co > 255 - hi Boolean ctermfg=181 - hi Character ctermfg=181 cterm=bold - hi Comment ctermfg=108 - hi Conditional ctermfg=223 cterm=bold - hi Constant ctermfg=181 cterm=bold - hi Cursor ctermfg=233 ctermbg=109 cterm=bold - hi Debug ctermfg=181 cterm=bold - hi Define ctermfg=223 cterm=bold - hi Delimiter ctermfg=245 - hi DiffAdd ctermfg=66 ctermbg=237 cterm=bold - hi DiffChange ctermbg=236 - hi DiffDelete ctermfg=236 ctermbg=238 - hi DiffText ctermfg=217 ctermbg=237 cterm=bold - hi Directory ctermfg=188 cterm=bold - hi ErrorMsg ctermfg=115 ctermbg=236 cterm=bold - hi Exception ctermfg=249 cterm=bold - hi Float ctermfg=251 - hi FoldColumn ctermfg=109 ctermbg=238 - hi Folded ctermfg=109 ctermbg=238 - hi Function ctermfg=228 - hi Identifier ctermfg=223 - hi IncSearch ctermbg=228 ctermfg=238 - hi Keyword ctermfg=223 cterm=bold - hi Label ctermfg=187 cterm=underline - hi LineNr ctermfg=248 ctermbg=235 - hi Macro ctermfg=223 cterm=bold - hi ModeMsg ctermfg=223 cterm=none - hi MoreMsg ctermfg=15 cterm=bold - hi NonText ctermfg=238 - hi Number ctermfg=116 - hi Operator ctermfg=230 - hi PreCondit ctermfg=180 cterm=bold - hi PreProc ctermfg=223 cterm=bold - hi Question ctermfg=15 cterm=bold - hi Repeat ctermfg=223 cterm=bold - hi Search ctermfg=230 ctermbg=236 - hi SpecialChar ctermfg=181 cterm=bold - hi SpecialComment ctermfg=108 cterm=bold - hi Special ctermfg=181 - hi SpecialKey ctermfg=151 - hi Statement ctermfg=187 ctermbg=234 cterm=none - hi StatusLine ctermfg=237 ctermbg=186 - hi StatusLineNC ctermfg=236 ctermbg=108 - hi StorageClass ctermfg=249 cterm=bold - hi String ctermfg=174 - hi Structure ctermfg=229 cterm=bold - hi Tag ctermfg=181 cterm=bold - hi Title ctermfg=7 ctermbg=234 cterm=bold - hi Todo ctermfg=108 ctermbg=234 cterm=bold - hi Typedef ctermfg=253 cterm=bold - hi Type ctermfg=187 cterm=bold - hi Underlined ctermfg=188 ctermbg=234 cterm=bold - hi VertSplit ctermfg=236 ctermbg=65 - hi VisualNOS ctermfg=236 ctermbg=210 cterm=bold - hi WarningMsg ctermfg=15 ctermbg=236 cterm=bold - hi WildMenu ctermbg=236 ctermfg=194 cterm=bold - if exists("g:zenburn_high_Contrast") - hi Normal ctermfg=188 ctermbg=234 - else - hi Normal ctermfg=188 ctermbg=237 - hi Cursor ctermbg=109 - hi diffadd ctermbg=237 - hi diffdelete ctermbg=238 - hi difftext ctermbg=237 - hi errormsg ctermbg=237 - hi foldcolumn ctermbg=238 - hi folded ctermbg=238 - hi incsearch ctermbg=228 - hi linenr ctermbg=238 - hi search ctermbg=238 - hi statement ctermbg=237 - hi statusline ctermbg=144 - hi statuslinenc ctermbg=108 - hi title ctermbg=237 - hi todo ctermbg=237 - hi underlined ctermbg=237 - hi vertsplit ctermbg=65 - hi visualnos ctermbg=210 - hi warningmsg ctermbg=236 - hi wildmenu ctermbg=236 - endif -endif - - -if exists("g:zenburn_high_Contrast") - " use new darker background - hi Normal guifg=#dcdccc guibg=#1f1f1f -else - " Original, lighter background - hi Normal guifg=#dcdccc guibg=#3f3f3f -endif - -if exists("g:zenburn_alternate_Visual") - " Visual with more contrast, thanks to Steve Hall & Cream posse - " gui=none fixes weird highlight problem in at least GVim 7.0.66, thanks to Kurt Maier - hi Visual guifg=#000000 guibg=#71d3b4 gui=none - hi VisualNOS guifg=#000000 guibg=#71d3b4 gui=none -else - " use default visual - hi Visual guifg=#233323 guibg=#71d3b4 gui=none - hi VisualNOS guifg=#233323 guibg=#71d3b4 gui=none -endif - -if exists("g:zenburn_alternate_Error") - " use a bit different Error - hi Error guifg=#ef9f9f guibg=#201010 gui=bold -else - " default - hi Error guifg=#e37170 guibg=#332323 gui=none -endif - -if exists("g:zenburn_alternate_Include") - " original setting - hi Include guifg=#ffcfaf gui=bold -else - " new, less contrasted one - hi Include guifg=#dfaf8f gui=bold -endif - " TODO check every syntax group that they're ok diff --git a/.vim/doc/NERD_tree.txt b/.vim/doc/NERD_tree.txt deleted file mode 100644 index 95f4c54..0000000 --- a/.vim/doc/NERD_tree.txt +++ /dev/null @@ -1,1077 +0,0 @@ -*NERD_tree.txt* A tree explorer plugin that owns your momma! - - - - omg its ... ~ - - ________ ________ _ ____________ ____ __________ ____________~ - /_ __/ / / / ____/ / | / / ____/ __ \/ __ \ /_ __/ __ \/ ____/ ____/~ - / / / /_/ / __/ / |/ / __/ / /_/ / / / / / / / /_/ / __/ / __/ ~ - / / / __ / /___ / /| / /___/ _, _/ /_/ / / / / _, _/ /___/ /___ ~ - /_/ /_/ /_/_____/ /_/ |_/_____/_/ |_/_____/ /_/ /_/ |_/_____/_____/ ~ - - - Reference Manual~ - - - - -============================================================================== -CONTENTS *NERDTree-contents* - - 1.Intro...................................|NERDTree| - 2.Functionality provided..................|NERDTreeFunctionality| - 2.1.Global commands...................|NERDTreeGlobalCommands| - 2.2.Bookmarks.........................|NERDTreeBookmarks| - 2.2.1.The bookmark table..........|NERDTreeBookmarkTable| - 2.2.2.Bookmark commands...........|NERDTreeBookmarkCommands| - 2.2.3.Invalid bookmarks...........|NERDTreeInvalidBookmarks| - 2.3.NERD tree mappings................|NERDTreeMappings| - 2.4.The filesystem menu...............|NERDTreeFilesysMenu| - 3.Options.................................|NERDTreeOptions| - 3.1.Option summary....................|NERDTreeOptionSummary| - 3.2.Option details....................|NERDTreeOptionDetails| - 4.Hacking the NERD tree...................|NERDTreeHacking| - 5.About...................................|NERDTreeAbout| - 6.Changelog...............................|NERDTreeChangelog| - 7.Credits.................................|NERDTreeCredits| - 8.License.................................|NERDTreeLicense| - -============================================================================== -1. Intro *NERDTree* - -What is this "NERD tree"?? - -The NERD tree allows you to explore your filesystem and to open files and -directories. It presents the filesystem to you in the form of a tree which you -manipulate with the keyboard and/or mouse. It also allows you to perform -simple filesystem operations. - -The following features and functionality are provided by the NERD tree: - * Files and directories are displayed in a hierarchical tree structure - * Different highlighting is provided for the following types of nodes: - * files - * directories - * sym-links - * windows .lnk files - * read-only files - * executable files - * Many (customisable) mappings are provided to manipulate the tree: - * Mappings to open/close/explore directory nodes - * Mappings to open files in new/existing windows/tabs - * Mappings to change the current root of the tree - * Mappings to navigate around the tree - * ... - * Directories and files can be bookmarked. - * Most NERD tree navigation can also be done with the mouse - * Filtering of tree content (can be toggled at runtime) - * custom file filters to prevent e.g. vim backup files being displayed - * optional displaying of hidden files (. files) - * files can be "turned off" so that only directories are displayed - * A textual filesystem menu is provided which allows you to - create/delete/move file and directory nodes as well as copy (for - supported OSs) - * The position and size of the NERD tree window can be customised - * The order in which the nodes in the tree are listed can be customised. - * A model of your filesystem is created/maintained as you explore it. This - has several advantages: - * All filesystem information is cached and is only re-read on demand - * If you revisit a part of the tree that you left earlier in your - session, the directory nodes will be opened/closed as you left them - * The script remembers the cursor position and window position in the NERD - tree so you can toggle it off (or just close the tree window) and then - reopen it (with NERDTreeToggle) the NERD tree window will appear exactly - as you left it - * You can have a separate NERD tree for each tab, share trees across tabs, - or a mix of both. - * By default the script overrides the default file browser (netw), so if - you :edit a directory a (slighly modified) NERD tree will appear in the - current window - -============================================================================== -2. Functionality provided *NERDTreeFunctionality* - ------------------------------------------------------------------------------- -2.1. Global Commands *NERDTreeGlobalCommands* - -:NERDTree [<start-directory> | <bookmark>] *:NERDTree* - Opens a fresh NERD tree. The root of the tree depends on the argument - given. There are 3 cases: If no argument is given, the current directory - will be used. If a directory is given, that will be used. If a bookmark - name is given, the corresponding directory will be used. For example: > - :NERDTree /home/marty/vim7/src - :NERDTree foo (foo is the name of a bookmark) -< -:NERDTreeFromBookmark <bookmark> *:NERDTreeFromBookmark* - Opens a fresh NERD tree with the root initialized to the dir for - <bookmark>. This only reason to use this command over :NERDTree is for - the completion (which is for bookmarks rather than directories). - -:NERDTreeToggle [<start-directory> | <bookmark>] *:NERDTreeToggle* - If a NERD tree already exists for this tab, it is reopened and rendered - again. If no NERD tree exists for this tab then this command acts the - same as the |:NERDTree| command. - -:NERDTreeMirror *:NERDTreeMirror* - Shares an existing NERD tree, from another tab, in the current tab. - Changes made to one tree are reflected in both as they are actually the - same buffer. - - If only one other NERD tree exists, that tree is automatically mirrored. If - more than one exists, the script will ask which tree to mirror. - -:NERDTreeClose *:NERDTreeClose* - Close the NERD tree in this tab. - ------------------------------------------------------------------------------- -2.2. Bookmarks *NERDTreeBookmarks* - -Bookmarks in the NERD tree are a way to tag files or directories of interest. -For example, you could use bookmarks to tag all of your project directories. - ------------------------------------------------------------------------------- -2.2.1. The Bookmark Table *NERDTreeBookmarkTable* - -If the bookmark table is active (see |NERDTree-B| and -|'NERDTreeShowBookmarks'|), it will be rendered above the tree. You can double -click bookmarks or use the |NERDTree-o| mapping to activate them. See also, -|NERDTree-t| and |NERDTree-T| - ------------------------------------------------------------------------------- -2.2.2. Bookmark commands *NERDTreeBookmarkCommands* - -Note that the following commands are only available in the NERD tree buffer. - -:Bookmark <name> - Bookmark the current node as <name>. If there is already a <name> - bookmark, it is overwritten. <name> must not contain spaces. - -:BookmarkToRoot <bookmark> - Make the directory corresponding to <bookmark> the new root. If a treenode - corresponding to <bookmark> is already cached somewhere in the tree then - the current tree will be used, otherwise a fresh tree will be opened. - Note that if <bookmark> points to a file then its parent will be used - instead. - -:RevealBookmark <bookmark> - If the node is cached under the current root then it will be revealed - (i.e. directory nodes above it will be opened) and the cursor will be - placed on it. - -:OpenBookmark <bookmark> - <bookmark> must point to a file. The file is opened as though |NERDTree-o| - was applied. If the node is cached under the current root then it will be - revealed and the cursor will be placed on it. - -:ClearBookmarks [<bookmarks>] - Remove all the given bookmarks. If no bookmarks are given then remove all - bookmarks on the current node. - -:ClearAllBookmarks - Remove all bookmarks. - -:ReadBookmarks - Re-read the bookmarks in the |'NERDTreeBookmarksFile'|. - -See also |:NERDTree| and |:NERDTreeFromBookmark|. - ------------------------------------------------------------------------------- -2.2.3. Invalid Bookmarks *NERDTreeInvalidBookmarks* - -If invalid bookmarks are detected, the script will issue an error message and -the invalid bookmarks will become unavailable for use. - -These bookmarks will still be stored in the bookmarks file (see -|'NERDTreeBookmarksFile'|), down the bottom. There will always be a blank line -after the valid bookmarks but before the invalid ones. - -Each line in the bookmarks file represents one bookmark. The proper format is: -<bookmark name><space><full path to the bookmark location> - -After you have corrected any invalid bookmarks, either restart vim, or go -:ReadBookmarks from the NERD tree window. - ------------------------------------------------------------------------------- -2.3. NERD tree Mappings *NERDTreeMappings* - -Default Description~ help-tag~ -Key~ - -o.......Open files, directories and bookmarks....................|NERDTree-o| -go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go| -t.......Open selected node/bookmark in a new tab.................|NERDTree-t| -T.......Same as 't' but keep the focus on the current tab........|NERDTree-T| -i.......Open selected file in a split window.....................|NERDTree-i| -gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi| -s.......Open selected file in a new vsplit.......................|NERDTree-s| -gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs| -!.......Execute the current file.................................|NERDTree-!| -O.......Recursively open the selected directory..................|NERDTree-O| -x.......Close the current nodes parent...........................|NERDTree-x| -X.......Recursively close all children of the current node.......|NERDTree-X| -e.......Edit the current dif.....................................|NERDTree-e| - -double-click.......same as the |NERDTree-o| map. -middle-click.......same as |NERDTree-i| for files, same as - |NERDTree-e| for dirs. - -D.......Delete the current bookmark .............................|NERDTree-D| - -P.......Jump to the root node....................................|NERDTree-P| -p.......Jump to current nodes parent.............................|NERDTree-p| -K.......Jump up inside directories at the current tree depth.....|NERDTree-K| -J.......Jump down inside directories at the current tree depth...|NERDTree-J| -<C-j>...Jump down to the next sibling of the current directory...|NERDTree-c-j| -<C-k>...Jump up to the previous sibling of the current directory.|NERDTree-c-k| - -C.......Change the tree root to the selected dir.................|NERDTree-C| -u.......Move the tree root up one directory......................|NERDTree-u| -U.......Same as 'u' except the old root node is left open........|NERDTree-U| -r.......Recursively refresh the current directory................|NERDTree-r| -R.......Recursively refresh the current root.....................|NERDTree-R| -m.......Display the filesystem menu..............................|NERDTree-m| -cd......Change the CWD to the dir of the selected node...........|NERDTree-cd| - -I.......Toggle whether hidden files displayed....................|NERDTree-I| -f.......Toggle whether the file filters are used.................|NERDTree-f| -F.......Toggle whether files are displayed.......................|NERDTree-F| -B.......Toggle whether the bookmark table is displayed...........|NERDTree-B| - -q.......Close the NERDTree window................................|NERDTree-q| -?.......Toggle the display of the quick help.....................|NERDTree-?| - ------------------------------------------------------------------------------- - *NERDTree-o* -Default key: o -Map option: NERDTreeMapActivateNode -Applies to: files and directories. - -If a file node is selected, it is opened in the previous window. - -If a directory is selected it is opened or closed depending on its current -state. - -If a bookmark that links to a directory is selected then that directory -becomes the new root. - -If a bookmark that links to a file is selected then that file is opened in the -previous window. - ------------------------------------------------------------------------------- - *NERDTree-go* -Default key: go -Map option: None -Applies to: files. - -If a file node is selected, it is opened in the previous window, but the -cursor does not move. - -The key combo for this mapping is always "g" + NERDTreeMapActivateNode (see -|NERDTree-o|). - ------------------------------------------------------------------------------- - *NERDTree-t* -Default key: t -Map option: NERDTreeMapOpenInTab -Applies to: files and directories. - -Opens the selected file in a new tab. If a directory is selected, a fresh -NERD Tree for that directory is opened in a new tab. - -If a bookmark which points to a directory is selected, open a NERD tree for -that directory in a new tab. If the bookmark points to a file, open that file -in a new tab. - ------------------------------------------------------------------------------- - *NERDTree-T* -Default key: T -Map option: NERDTreeMapOpenInTabSilent -Applies to: files and directories. - -The same as |NERDTree-t| except that the focus is kept in the current tab. - ------------------------------------------------------------------------------- - *NERDTree-i* -Default key: i -Map option: NERDTreeMapOpenSplit -Applies to: files. - -Opens the selected file in a new split window and puts the cursor in the new -window. - ------------------------------------------------------------------------------- - *NERDTree-gi* -Default key: gi -Map option: None -Applies to: files. - -The same as |NERDTree-i| except that the cursor is not moved. - -The key combo for this mapping is always "g" + NERDTreeMapOpenSplit (see -|NERDTree-i|). - ------------------------------------------------------------------------------- - *NERDTree-s* -Default key: s -Map option: NERDTreeMapOpenVSplit -Applies to: files. - -Opens the selected file in a new vertically split window and puts the cursor in -the new window. - ------------------------------------------------------------------------------- - *NERDTree-gs* -Default key: gs -Map option: None -Applies to: files. - -The same as |NERDTree-s| except that the cursor is not moved. - -The key combo for this mapping is always "g" + NERDTreeMapOpenVSplit (see -|NERDTree-s|). - ------------------------------------------------------------------------------- - *NERDTree-!* -Default key: ! -Map option: NERDTreeMapExecute -Applies to: files. - -Executes the selected file, prompting for arguments first. - ------------------------------------------------------------------------------- - *NERDTree-O* -Default key: O -Map option: NERDTreeMapOpenRecursively -Applies to: directories. - -Recursively opens the selelected directory. - -All files and directories are cached, but if a directory would not be -displayed due to file filters (see |'NERDTreeIgnore'| |NERDTree-f|) or the -hidden file filter (see |'NERDTreeShowHidden'|) then its contents are not -cached. This is handy, especially if you have .svn directories. - ------------------------------------------------------------------------------- - *NERDTree-x* -Default key: x -Map option: NERDTreeMapCloseDir -Applies to: files and directories. - -Closes the parent of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-X* -Default key: X -Map option: NERDTreeMapCloseChildren -Applies to: directories. - -Recursively closes all children of the selected directory. - -Tip: To quickly "reset" the tree, use |NERDTree-P| with this mapping. - ------------------------------------------------------------------------------- - *NERDTree-e* -Default key: e -Map option: NERDTreeMapOpenExpl -Applies to: files and directories. - -|:edit|s the selected directory, or the selected file's directory. This could -result in a NERD tree or a netrw being opened, depending on -|'NERDTreeHijackNetrw'|. - ------------------------------------------------------------------------------- - *NERDTree-D* -Default key: D -Map option: NERDTreeMapDeleteBookmark -Applies to: lines in the bookmarks table - -Deletes the currently selected bookmark. - ------------------------------------------------------------------------------- - *NERDTree-P* -Default key: P -Map option: NERDTreeMapJumpRoot -Applies to: no restrictions. - -Jump to the tree root. - ------------------------------------------------------------------------------- - *NERDTree-p* -Default key: p -Map option: NERDTreeMapJumpParent -Applies to: files and directories. - -Jump to the parent node of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-K* -Default key: K -Map option: NERDTreeMapJumpFirstChild -Applies to: files and directories. - -Jump to the first child of the current nodes parent. - -If the cursor is already on the first node then do the following: - * loop back thru the siblings of the current nodes parent until we find an - open dir with children - * go to the first child of that node - ------------------------------------------------------------------------------- - *NERDTree-J* -Default key: J -Map option: NERDTreeMapJumpLastChild -Applies to: files and directories. - -Jump to the last child of the current nodes parent. - -If the cursor is already on the last node then do the following: - * loop forward thru the siblings of the current nodes parent until we find - an open dir with children - * go to the last child of that node - ------------------------------------------------------------------------------- - *NERDTree-c-j* -Default key: <C-j> -Map option: NERDTreeMapJumpNextSibling -Applies to: files and directories. - -Jump to the next sibling of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-c-k* -Default key: <C-k> -Map option: NERDTreeMapJumpPrevSibling -Applies to: files and directories. - -Jump to the previous sibling of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-C* -Default key: C -Map option: NERDTreeMapChdir -Applies to: directories. - -Make the selected directory node the new tree root. If a file is selected, its -parent is used. - ------------------------------------------------------------------------------- - *NERDTree-u* -Default key: u -Map option: NERDTreeMapUpdir -Applies to: no restrictions. - -Move the tree root up a dir (like doing a "cd .."). - ------------------------------------------------------------------------------- - *NERDTree-U* -Default key: U -Map option: NERDTreeMapUpdirKeepOpen -Applies to: no restrictions. - -Like |NERDTree-u| except that the old tree root is kept open. - ------------------------------------------------------------------------------- - *NERDTree-r* -Default key: r -Map option: NERDTreeMapRefresh -Applies to: files and directories. - -If a dir is selected, recursively refresh that dir, i.e. scan the filesystem -for changes and represent them in the tree. - -If a file node is selected then the above is done on it's parent. - ------------------------------------------------------------------------------- - *NERDTree-R* -Default key: R -Map option: NERDTreeMapRefreshRoot -Applies to: no restrictions. - -Recursively refresh the tree root. - ------------------------------------------------------------------------------- - *NERDTree-m* -Default key: m -Map option: NERDTreeMapFilesystemMenu -Applies to: files and directories. - -Display the filesystem menu. See |NERDTreeFilesysMenu| for details. - ------------------------------------------------------------------------------- - *NERDTree-I* -Default key: I -Map option: NERDTreeMapToggleHidden -Applies to: no restrictions. - -Toggles whether hidden files (i.e. "dot files") are displayed. - ------------------------------------------------------------------------------- - *NERDTree-f* -Default key: f -Map option: NERDTreeMapToggleFilters -Applies to: no restrictions. - -Toggles whether file filters are used. See |'NERDTreeIgnore'| for details. - ------------------------------------------------------------------------------- - *NERDTree-F* -Default key: F -Map option: NERDTreeMapToggleFiles -Applies to: no restrictions. - -Toggles whether file nodes are displayed. - ------------------------------------------------------------------------------- - *NERDTree-B* -Default key: B -Map option: NERDTreeMapToggleBookmarks -Applies to: no restrictions. - -Toggles whether the bookmarks table is displayed. - ------------------------------------------------------------------------------- - *NERDTree-q* -Default key: q -Map option: NERDTreeMapQuit -Applies to: no restrictions. - -Closes the NERDtree window. - ------------------------------------------------------------------------------- - *NERDTree-?* -Default key: ? -Map option: NERDTreeMapHelp -Applies to: no restrictions. - -Toggles whether the quickhelp is displayed. - ------------------------------------------------------------------------------- -2.3. The filesystem menu *NERDTreeFilesysMenu* - -The purpose of the filesystem menu is to allow you to perform basic filesystem -operations quickly from the NERD tree rather than the console. - -The filesystem menu can be accessed with 'm' mapping and has four supported -operations: > - 1. Adding nodes. - 2. Move nodes. - 3. Deleting nodes. - 3. Copying nodes. -< -1. Adding nodes: -To add a node move the cursor onto (or anywhere inside) the directory you wish -to create the new node inside. Select the 'add node' option from the -filesystem menu and type a filename. If the filename you type ends with a '/' -character then a directory will be created. Once the operation is completed, -the cursor is placed on the new node. - -2. Move nodes: -To move/rename a node, put the cursor on it and select the 'move' option from -the filesystem menu. Enter the new location for the node and it will be -moved. If the old file is open in a buffer, you will be asked if you wish to -delete that buffer. Once the operation is complete the cursor will be placed -on the renamed node. - -3. Deleting nodes: -To delete a node put the cursor on it and select the 'delete' option from the -filesystem menu. After confirmation the node will be deleted. If a file is -deleted but still exists as a buffer you will be given the option to delete -that buffer. - -4. Copying nodes: -To copy a node put the cursor on it and select the 'copy' option from the -filesystem menu. Enter the new location and you're done. Note: copying is -currently only supported for *nix operating systems. If someone knows a -one line copying command for windows that doesnt require user confirmation -then id be grateful if you'd email me. - -============================================================================== -3. Customisation *NERDTreeOptions* - - ------------------------------------------------------------------------------- -3.1. Customisation summary *NERDTreeOptionSummary* - -The script provides the following options that can customise the behaviour the -NERD tree. These options should be set in your vimrc. - -|'loaded_nerd_tree'| Turns off the script. - -|'NERDChristmasTree'| Tells the NERD tree to make itself colourful - and pretty. - -|'NERDTreeAutoCenter'| Controls whether the NERD tree window centers - when the cursor moves within a specified - distance to the top/bottom of the window. -|'NERDTreeAutoCenterThreshold'| Controls the sensitivity of autocentering. - -|'NERDTreeCaseSensitiveSort'| Tells the NERD tree whether to be case - sensitive or not when sorting nodes. - -|'NERDTreeChDirMode'| Tells the NERD tree if/when it should change - vim's current working directory. - -|'NERDTreeHighlightCursorline'| Tell the NERD tree whether to highlight the - current cursor line. - -|'NERDTreeHijackNetrw'| Tell the NERD tree whether to replace the netrw - autocommands for exploring local directories. - -|'NERDTreeIgnore'| Tells the NERD tree which files to ignore. - -|'NERDTreeBookmarksFile'| Where the bookmarks are stored. - -|'NERDTreeMouseMode'| Tells the NERD tree how to handle mouse - clicks. - -|'NERDTreeQuitOnOpen'| Closes the tree window after opening a file. - -|'NERDTreeShowBookmarks'| Tells the NERD tree whether to display the - bookmarks table on startup. - -|'NERDTreeShowFiles'| Tells the NERD tree whether to display files - in the tree on startup. - -|'NERDTreeShowHidden'| Tells the NERD tree whether to display hidden - files on startup. - -|'NERDTreeShowLineNumbers'| Tells the NERD tree whether to display line - numbers in the tree window. - -|'NERDTreeSortOrder'| Tell the NERD tree how to sort the nodes in - the tree. - -|'NERDTreeStatusline'| Set a statusline for NERD tree windows. - -|'NERDTreeWinPos'| Tells the script where to put the NERD tree - window. - -|'NERDTreeWinSize'| Sets the window size when the NERD tree is - opened. - ------------------------------------------------------------------------------- -3.2. Customisation details *NERDTreeOptionDetails* - -To enable any of the below options you should put the given line in your -~/.vimrc - - *'loaded_nerd_tree'* -If this plugin is making you feel homicidal, it may be a good idea to turn it -off with this line in your vimrc: > - let loaded_nerd_tree=1 -< ------------------------------------------------------------------------------- - *'NERDChristmasTree'* -Values: 0 or 1. -Default: 1. - -If this option is set to 1 then some extra syntax highlighting elements are -added to the nerd tree to make it more colourful. - -Set it to 0 for a more vanilla looking tree. - ------------------------------------------------------------------------------- - *'NERDTreeAutoCenter'* -Values: 0 or 1. -Default: 1 - -If set to 1, the NERD tree window will center around the cursor if it moves to -within |'NERDTreeAutoCenterThreshold'| lines of the top/bottom of the window. - -This is ONLY done in response to tree navigation mappings, -i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-c-K| |NERDTree-p| -|NERDTree-P| - -The centering is done with a |zz| operation. - ------------------------------------------------------------------------------- - *'NERDTreeAutoCenterThreshold'* -Values: Any natural number. -Default: 3 - -This option controls the "sensitivity" of the NERD tree auto centering. See -|'NERDTreeAutoCenter'| for details. - ------------------------------------------------------------------------------- - *'NERDTreeCaseSensitiveSort'* -Values: 0 or 1. -Default: 0. - -By default the NERD tree does not sort nodes case sensitively, i.e. nodes -could appear like this: > - bar.c - Baz.c - blarg.c - boner.c - Foo.c -< -But, if you set this option to 1 then the case of the nodes will be taken into -account. The above nodes would then be sorted like this: > - Baz.c - Foo.c - bar.c - blarg.c - boner.c -< ------------------------------------------------------------------------------- - *'NERDTreeChDirMode'* - -Values: 0, 1 or 2. -Default: 0. - -Use this option to tell the script when (if at all) to change the current -working directory (CWD) for vim. - -If it is set to 0 then the CWD is never changed by the NERD tree. - -If set to 1 then the CWD is changed when the NERD tree is first loaded to the -directory it is initialized in. For example, if you start the NERD tree with > - :NERDTree /home/marty/foobar -< -then the CWD will be changed to /home/marty/foobar and will not be changed -again unless you init another NERD tree with a similar command. - -If the option is set to 2 then it behaves the same as if set to 1 except that -the CWD is changed whenever the tree root is changed. For example, if the CWD -is /home/marty/foobar and you make the node for /home/marty/foobar/baz the new -root then the CWD will become /home/marty/foobar/baz. - ------------------------------------------------------------------------------- - *'NERDTreeHighlightCursorline'* -Values: 0 or 1. -Default: 1. - -If set to 1, the current cursor line in the NERD tree buffer will be -highlighted. This is done using the |cursorline| option. - ------------------------------------------------------------------------------- - *'NERDTreeHijackNetrw'* -Values: 0 or 1. -Default: 1. - -If set to 1, doing a > - :edit <some directory> -< -will open up a "secondary" NERD tree instead of a netrw in the target window. - -Secondary NERD trees behaves slighly different from a regular trees in the -following respects: - 1. 'o' will open the selected file in the same window as the tree, - replacing it. - 2. you can have as many secondary tree as you want in the same tab. - ------------------------------------------------------------------------------- - *'NERDTreeIgnore'* -Values: a list of regular expressions. -Default: ['\~$']. - -This option is used to specify which files the NERD tree should ignore. It -must be a list of regular expressions. When the NERD tree is rendered, any -files/dirs that match any of the regex's in 'NERDTreeIgnore' wont be -displayed. - -For example if you put the following line in your vimrc: > - let NERDTreeIgnore=['\.vim$', '\~$'] -< -then all files ending in .vim or ~ will be ignored. - -Note: to tell the NERD tree not to ignore any files you must use the following -line: > - let NERDTreeIgnore=[] -< - -The file filters can be turned on and off dynamically with the |NERDTree-f| -mapping. - ------------------------------------------------------------------------------- - *'NERDTreeBookmarksFile'* -Values: a path -Default: $HOME/.NERDTreeBookmarks - -This is where bookmarks are saved. See |NERDTreeBookmarkCommands|. - ------------------------------------------------------------------------------- - *'NERDTreeMouseMode'* -Values: 1, 2 or 3. -Default: 1. - -If set to 1 then a double click on a node is required to open it. -If set to 2 then a single click will open directory nodes, while a double -click will still be required for file nodes. -If set to 3 then a single click will open any node. - -Note: a double click anywhere on a line that a tree node is on will -activate it, but all single-click activations must be done on name of the node -itself. For example, if you have the following node: > - | | |-application.rb -< -then (to single click activate it) you must click somewhere in -'application.rb'. - ------------------------------------------------------------------------------- - *'NERDTreeQuitOnOpen'* - -Values: 0 or 1. -Default: 0 - -If set to 1, the NERD tree window will close after opening a file with the -|NERDTree-o| or |NERDTree-i| mappings. - ------------------------------------------------------------------------------- - *'NERDTreeShowBookmarks'* -Values: 0 or 1. -Default: 0. - -If this option is set to 1 then the bookmarks table will be displayed. - -This option can be toggled dynamically, per tree, with the |NERDTree-B| -mapping. - ------------------------------------------------------------------------------- - *'NERDTreeShowFiles'* -Values: 0 or 1. -Default: 1. - -If this option is set to 1 then files are displayed in the NERD tree. If it is -set to 0 then only directories are displayed. - -This option can be toggled dynamically, per tree, with the |NERDTree-F| -mapping and is useful for drastically shrinking the tree when you are -navigating to a different part of the tree. - ------------------------------------------------------------------------------- - *'NERDTreeShowHidden'* -Values: 0 or 1. -Default: 0. - -This option tells vim whether to display hidden files by default. This option -can be dynamically toggled, per tree, with the |NERDTree-I| mapping. Use one -of the follow lines to set this option: > - let NERDTreeShowHidden=0 - let NERDTreeShowHidden=1 -< - ------------------------------------------------------------------------------- - *'NERDTreeShowLineNumbers'* -Values: 0 or 1. -Default: 0. - -This option tells vim whether to display line numbers for the NERD tree -window. Use one of the follow lines to set this option: > - let NERDTreeShowLineNumbers=0 - let NERDTreeShowLineNumbers=1 -< - ------------------------------------------------------------------------------- - *'NERDTreeSortOrder'* -Values: a list of regular expressions. -Default: ['\/$', '*', '\.swp$', '\.bak$', '\~$'] - -This option is set to a list of regular expressions which are used to -specify the order of nodes under their parent. - -For example, if the option is set to: > - ['\.vim$', '\.c$', '\.h$', '*', 'foobar'] -< -then all .vim files will be placed at the top, followed by all .c files then -all .h files. All files containing the string 'foobar' will be placed at the -end. The star is a special flag: it tells the script that every node that -doesnt match any of the other regexps should be placed here. - -If no star is present in 'NERDTreeSortOrder' then one is automatically -appended to the array. - -The regex '\/$' should be used to match directory nodes. - -After this sorting is done, the files in each group are sorted alphabetically. - -Other examples: > - (1) ['*', '\/$'] - (2) [] - (3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$', '\.bak$', '\~$'] -< -1. Directories will appear last, everything else will appear above. -2. Everything will simply appear in alphabetical order. -3. Dirs will appear first, then ruby and php. Swap files, bak files and vim - backup files will appear last with everything else preceding them. - ------------------------------------------------------------------------------- - *'NERDTreeStatusline'* -Values: Any valid statusline setting. -Default: %{b:NERDTreeRoot.path.strForOS(0)} - -Tells the script what to use as the |'statusline'| setting for NERD tree -windows. - -Note that the statusline is set using |:let-&| not |:set| so escaping spaces -isn't necessary. - -Setting this option to -1 will will deactivate it so that your global -statusline setting is used instead. - ------------------------------------------------------------------------------- - *'NERDTreeWinPos'* -Values: "left" or "right" -Default: "left". - -This option is used to determine where NERD tree window is placed on the -screen. - -This option makes it possible to use two different explorer plugins -simultaneously. For example, you could have the taglist plugin on the left of -the window and the NERD tree on the right. - ------------------------------------------------------------------------------- - *'NERDTreeWinSize'* -Values: a positive integer. -Default: 31. - -This option is used to change the size of the NERD tree when it is loaded. - -============================================================================== -4. Hacking the NERD tree *NERDTreeHacking* - -Public functions ~ - -The script provides 2 public functions for your hacking pleasure. Their -signatures are: > - function! NERDTreeGetCurrentNode() - function! NERDTreeGetCurrentPath() -< -The first returns the node object that the cursor is currently on, while the -second returns the corresponding path object. - -This is probably a good time to mention that the script implements prototype -style OO. To see the functions that each class provides you can read look at -the code. - -Use the node objects to manipulate the structure of the tree. Use the path -objects to access the files/directories the tree nodes represent. - -The NERD tree filetype ~ - -NERD tree buffers have a filetype of "nerdtree". You can use this to hack the -NERD tree via autocommands (on |FileType|) or via an ftplugin. - -For example, putting this code in ~/.vim/ftplugin/nerdtree.vim would override -the o mapping, making it open the selected node in a new gvim instance. > - - nnoremap <silent> <buffer> o :call <sid>openInNewVimInstance()<cr> - function! s:openInNewVimInstance() - let p = NERDTreeGetCurrentPath() - if p != {} - silent exec "!gvim " . p.strForOS(1) . "&" - endif - endfunction -< -This way you can add new mappings or :commands or override any existing -mapping. - -============================================================================== -5. About *NERDTreeAbout* - -The author of the NERD tree is a terrible terrible monster called Martyzilla -who gobbles up small children with milk and sugar for breakfast. - -He can be reached at martin_grenfell at msn.com. He would love to hear from -you, so feel free to send him suggestions and/or comments about this plugin. -Don't be shy --- the worst he can do is slaughter you and stuff you in the -fridge for later ;) - -The latest stable versions can be found at - http://www.vim.org/scripts/script.php?script_id=1658 - -The latest dev versions are on github - http://github.com/scrooloose/nerdtree - - -============================================================================== -6. Changelog *NERDTreeChangelog* - -3.1.0 - New features: - - add mappings to open files in a vsplit, see :help NERDTree-s and :help - NERDTree-gs - - make the statusline for the nerd tree window default to something - hopefully more useful. See :help 'NERDTreeStatusline' - Bugfixes: - - make the hijack netrw functionality work when vim is started with "vim - <some dir>" (thanks to Alf Mikula for the patch). - - fix a bug where the CWD wasnt being changed for some operations even when - NERDTreeChDirMode==2 (thanks to Lucas S. Buchala) - - add -bar to all the nerd tree :commands so they can chain with other - :commands (thanks to tpope) - - fix bugs when ignorecase was set (thanks to nach) - - fix a bug with the relative path code (thanks to nach) - - fix a bug where doing a :cd would cause :NERDTreeToggle to fail (thanks nach) - - -3.0.1 - Bugfixes: - - fix bugs with :NERDTreeToggle and :NERDTreeMirror when 'hidden - was not set - - fix a bug where :NERDTree <path> would fail if <path> was relative and - didnt start with a ./ or ../ Thanks to James Kanze. - - make the q mapping work with secondary (:e <dir> style) trees, - thanks to jamessan - - fix a bunch of small bugs with secondary trees - - More insane refactoring. - -3.0.0 - - hijack netrw so that doing an :edit <directory> will put a NERD tree in - the window rather than a netrw browser. See :help 'NERDTreeHijackNetrw' - - allow sharing of trees across tabs, see :help :NERDTreeMirror - - remove "top" and "bottom" as valid settings for NERDTreeWinPos - - change the '<tab>' mapping to 'i' - - change the 'H' mapping to 'I' - - lots of refactoring - -============================================================================== -7. Credits *NERDTreeCredits* - -Thanks to the following people for testing, bug reports, ideas etc. Without -you I probably would have got bored of the hacking the NERD tree and -just downloaded pr0n instead. - - Tim Carey-Smith (halorgium) - Vigil - Nick Brettell - Thomas Scott Urban - Terrance Cohen - Yegappan Lakshmanan - Jason Mills - Michael Geddes (frogonwheels) - Yu Jun - Michael Madsen - AOYAMA Shotaro - Zhang Weiwu - Niels Aan de Brugh - Olivier Yiptong - Zhang Shuhan - Cory Echols - Piotr Czachur - Yuan Jiang - Matan Nassau - Maxim Kim - Charlton Wang - Matt Wozniski (godlygeek) - knekk - Sean Chou - Ryan Penn - Simon Peter Nicholls - Michael Foobar - Tomasz Chomiuk - Denis Pokataev - Tim Pope (tpope) - James Kanze - James Vega (jamessan) - Frederic Chanal (nach) - Alf Mikula - Lucas S. Buchala - -============================================================================== -8. License *NERDTreeLicense* - -The NERD tree is released under the wtfpl. -See http://sam.zoy.org/wtfpl/COPYING. diff --git a/.vim/doc/bufexplorer.txt b/.vim/doc/bufexplorer.txt deleted file mode 100644 index 9af0682..0000000 --- a/.vim/doc/bufexplorer.txt +++ /dev/null @@ -1,442 +0,0 @@ -*bufexplorer.txt* Buffer Explorer Last Change: 19 Nov 2008 - -Buffer Explorer *buffer-explorer* *bufexplorer* - Version 7.2.2 - -Plugin for easily exploring (or browsing) Vim |:buffers|. - -|bufexplorer-usage| Usage -|bufexplorer-installation| Installation -|bufexplorer-customization| Customization -|bufexplorer-changelog| Change Log -|bufexplorer-todo| Todo -|bufexplorer-credits| Credits - -For Vim version 7.0 and above. -This plugin is only available if 'compatible' is not set. - -{Vi does not have any of this} - -============================================================================== -INSTALLATION *bufexplorer-installation* - -To install: - - Download the bufexplorer.zip. - - Extract the zip archive into your runtime directory. - The archive contains plugin/bufexplorer.vim, and doc/bufexplorer.txt. - - Start Vim or goto an existing instance of Vim. - - Execute the following command: -> - :helptag <your runtime directory/doc -< - This will generate all the help tags for any file located in the doc - directory. - -============================================================================== -USAGE *bufexplorer-usage* - -To start exploring in the current window, use: > - \be OR :BufExplorer -To start exploring in a newly split horizontal window, use: > - \bs or :HSBufExplorer -To start exploring in a newly split vertical window, use: > - \bv or :VSBufExplorer - -If you would like to use something other than '\', you may simply change the -leader (see |mapleader|). - -Note: If the current buffer is modified when bufexplorer started, the current - window is always split and the new bufexplorer is displayed in that new - window. - -Commands to use once exploring: - - <enter> Opens the buffer that is under the cursor into the current - window. - <F1> Toggle help information. - <leftmouse> Opens the buffer that is under the cursor into the current - window. - <shift-enter> Opens the buffer that is under the cursor in another tab. - d |:wipeout| the buffer under the cursor from the list. - When a buffers is wiped, it will not be shown when unlisted - buffer are displayed. - D |:delete| the buffer under the cursor from the list. - The buffer's 'buflisted' is cleared. This allows for the buffer - to be displayed again using the 'show unlisted' command. - f Toggles whether you are taken to the active window when - selecting a buffer or not. - p Toggles the showing of a split filename/pathname. - q Quit exploring. - r Reverses the order the buffers are listed in. - R Toggles relative path/absolute path. - s Selects the order the buffers are listed in. Either by buffer - number, file name, file extension, most recently used (MRU), or - full path. - t Opens the buffer that is under the cursor in another tab. - u Toggles the showing of "unlisted" buffers. - -Once invoked, Buffer Explorer displays a sorted list (MRU is the default -sort method) of all the buffers that are currently opened. You are then -able to move the cursor to the line containing the buffer's name you are -wanting to act upon. Once you have selected the buffer you would like, -you can then either open it, close it(delete), resort the list, reverse -the sort, quit exploring and so on... - -=============================================================================== -CUSTOMIZATION *bufexplorer-customization* - - *g:bufExplorerDefaultHelp* -To control whether the default help is displayed or not, use: > - let g:bufExplorerDefaultHelp=0 " Do not show default help. - let g:bufExplorerDefaultHelp=1 " Show default help. -The default is to show the default help. - - *g:bufExplorerDetailedHelp* -To control whether detailed help is display by, use: > - let g:bufExplorerDetailedHelp=0 " Do not show detailed help. - let g:bufExplorerDetailedHelp=1 " Show detailed help. -The default is NOT to show detailed help. - - *g:bufExplorerFindActive* -To control whether you are taken to the active window when selecting a buffer, -use: > - let g:bufExplorerFindActive=0 " Do not go to active window. - let g:bufExplorerFindActive=1 " Go to active window. -The default is to be taken to the active window. - - *g:bufExplorerReverseSort* -To control whether to sort the buffer in reverse order or not, use: > - let g:bufExplorerReverseSort=0 " Do not sort in reverse order. - let g:bufExplorerReverseSort=1 " Sort in reverse order. -The default is NOT to sort in reverse order. - - *g:bufExplorerShowDirectories* -Directories usually show up in the list from using a command like ":e .". -To control whether to show directories in the buffer list or not, use: > - let g:bufExplorerShowDirectories=1 " Show directories. - let g:bufExplorerShowDirectories=0 " Don't show directories. -The default is to show directories. - - *g:bufExplorerShowRelativePath* -To control whether to show absolute paths or relative to the current -directory, use: > - let g:bufExplorerShowRelativePath=0 " Show absolute paths. - let g:bufExplorerShowRelativePath=1 " Show relative paths. -The default is to show absolute paths. - - *g:bufExplorerShowUnlisted* -To control whether to show unlisted buffer or not, use: > - let g:bufExplorerShowUnlisted=0 " Do not show unlisted buffers. - let g:bufExplorerShowUnlisted=1 " Show unlisted buffers. -The default is to NOT show unlisted buffers. - - *g:bufExplorerSortBy* -To control what field the buffers are sorted by, use: > - let g:bufExplorerSortBy='extension' " Sort by file extension. - let g:bufExplorerSortBy='fullpath' " Sort by full file path name. - let g:bufExplorerSortBy='mru' " Sort by most recently used. - let g:bufExplorerSortBy='name' " Sort by the buffer's name. - let g:bufExplorerSortBy='number' " Sort by the buffer's number. -The default is to sort by mru. - - *g:bufExplorerSplitBelow* -To control where the new split window will be placed above or below the -current window, use: > - let g:bufExplorerSplitBelow=1 " Split new window below current. - let g:bufExplorerSplitBelow=0 " Split new window above current. -The default is to use what ever is set by the global &splitbelow -variable. - - *g:bufExplorerSplitOutPathName* -To control whether to split out the path and file name or not, use: > - let g:bufExplorerSplitOutPathName=1 " Split the path and file name. - let g:bufExplorerSplitOutPathName=0 " Don't split the path and file - " name. -The default is to split the path and file name. - - *g:bufExplorerSplitRight* -To control where the new vsplit window will be placed to the left or right of -current window, use: > - let g:bufExplorerSplitRight=0 " Split left. - let g:bufExplorerSplitRight=1 " Split right. -The default is to use the global &splitright. - -=============================================================================== -CHANGE LOG *bufexplorer-changelog* - -7.2.2 - Fix: - * Thanks to David L. Dight for spotting and fixing an issue when - using ctrl^. bufexplorer would incorrectly handle the previous - buffer so that when ctrl^ was pressed the incorrect file was opened. -7.2.1 - Fix: - * Thanks to Dimitar for spotting and fixing a feature that was - inadvertently left out of the previous version. The feature was - when bufexplorer was used together with WinManager, you could use - the tab key to open a buffer in a split window. -7.2.0 - Enhancements: - * For all those missing the \bs and \bv commands, these have now - returned. Thanks to Phil O'Connell for asking for the return of - these missing features and helping test out this version. - Fixes: - * Fixed problem with the bufExplorerFindActive code not working - correctly. - * Fixed an incompatibility between bufexplorer and netrw that caused - buffers to be incorrectly removed from the MRU list. -7.1.7 - Fixes: - * TaCahiroy fixed several issues related to opening a buffer in a - tab. -7.1.6 - Fixes: - * Removed ff=unix from modeline in bufexplorer.txt. Found by Bill - McCarthy. -7.1.5 - Fixes: - * Could not open unnamed buffers. Fixed by TaCahiroy. -7.1.4 - Fixes: - * Sometimes when a file's path has 'white space' in it, extra buffers - would be created containing each piece of the path. i.e: - opening c:\document and settings\test.txt would create a buffer - named "and" and a buffer named "Documents". This was reported and - fixed by TaCa Yoss. -7.1.3 - Fixes: - * Added code to allow only one instance of the plugin to run at a - time. Thanks Dennis Hostetler. -7.1.2 - Fixes: - * Fixed a jumplist issue spotted by JiangJun. I overlooked the - 'jumplist' and with a couple calls to 'keepjumps', everything is - fine again. - * Went back to just having a plugin file, no autoload file. By having - the autoload, WinManager was no longer working and without really - digging into the cause, it was easier to go back to using just a - plugin file. -7.1.1 - Fixes: - * A problem spotted by Thomas Arendsen Hein. - When running Vim (7.1.94), error E493 was being thrown. - Enhancements: - * Added 'D' for 'delete' buffer as the 'd' command was a 'wipe' - buffer. -7.1.0 - Another 'major' update, some by Dave Larson, some by me. - * Making use of 'autoload' now to make the plugin load quicker. - * Removed '\bs' and '\bv'. These are now controlled by the user. The - user can issue a ':sp' or ':vs' to create a horizontal or vertical - split window and then issue a '\be' - * Added handling of tabs. -7.0.17 - Fixed issue with 'drop' command. - Various enhancements and improvements. -7.0.16 - Fixed issue reported by Liu Jiaping on non Windows systems, which was - ... - Open file1, open file2, modify file1, open bufexplorer, you get the - following error: - - --------8<-------- - Error detected while processing function - <SNR>14_StartBufExplorer..<SNR>14_SplitOpen: - line 4: - E37: No write since last change (add ! to override) - - But the worse thing is, when I want to save the current buffer and - type ':w', I get another error message: - E382: Cannot write, 'buftype' option is set - --------8<-------- - -7.0.15 - Thanks to Mark Smithfield for suggesting bufexplorer needed to handle - the ':args' command. -7.0.14 - Thanks to Randall Hansen for removing the requirement of terminal - versions to be recompiled with 'gui' support so the 'drop' command - would work. The 'drop' command is really not needed in terminal - versions. -7.0.13 - Fixed integration with WinManager. - Thanks to Dave Eggum for another update. - - Fix: The detailed help didn't display the mapping for toggling - the split type, even though the split type is displayed. - - Fixed incorrect description in the detailed help for toggling - relative or full paths. - - Deprecated s:ExtractBufferNbr(). Vim's str2nr() does the same - thing. - - Created a s:Set() function that sets a variable only if it hasn't - already been defined. It's useful for initializing all those - default settings. - - Removed checks for repetitive command definitions. They were - unnecessary. - - Made the help highlighting a little more fancy. - - Minor reverse compatibility issue: Changed ambiguous setting - names to be more descriptive of what they do (also makes the code - easier to follow): - Changed bufExplorerSortDirection to bufExplorerReverseSort - Changed bufExplorerSplitType to bufExplorerSplitVertical - Changed bufExplorerOpenMode to bufExplorerUseCurrentWindow - - When the BufExplorer window closes, all the file-local marks are - now deleted. This may have the benefit of cleaning up some of the - jumplist. - - Changed the name of the parameter for StartBufExplorer from - "split" to "open". The parameter is a string which specifies how - the buffer will be open, not if it is split or not. - - Deprecated DoAnyMoreBuffersExist() - it is a one line function - only used in one spot. - - Created four functions (SplitOpen(), RebuildBufferList(), - UpdateHelpStatus() and ReSortListing()) all with one purpose - to - reduce repeated code. - - Changed the name of AddHeader() to CreateHelp() to be more - descriptive of what it does. It now returns an array instead of - updating the window directly. This has the benefit of making the - code more efficient since the text the function returns is used a - little differently in the two places the function is called. - - Other minor simplifications. -7.0.12 - MAJOR Update. - This version will ONLY run with Vim version 7.0 or greater. - Dave Eggum has made some 'significant' updates to this latest - version: - - Added BufExplorerGetAltBuf() global function to be used in the - users rulerformat. - - Added g:bufExplorerSplitRight option. - - Added g:bufExplorerShowRelativePath option with mapping. - - Added current line highlighting. - - The split type can now be changed whether bufexplorer is opened - in split mode or not. - - Various major and minor bug fixes and speed improvements. - - Sort by extension. - Other improvements/changes: - - Changed the help key from '?' to <F1> to be more 'standard'. - - Fixed splitting of vertical bufexplorer window. - Hopefully I have not forgot something :) -7.0.11 - Fixed a couple of highlighting bugs, reported by David Eggum. He also - changed passive voice to active on a couple of warning messages. -7.0.10 - Fixed bug report by Xiangjiang Ma. If the 'ssl' option is set, - the slash character used when displaying the path was incorrect. -7.0.9 - Martin Grenfell found and eliminated an annoying bug in the - bufexplorer/winmanager integration. The bug was were an - annoying message would be displayed when a window was split or - a new file was opened in a new window. Thanks Martin! -7.0.8 - Thanks to Mike Li for catching a bug in the WinManager integration. - The bug was related to the incorrect displaying of the buffer - explorer's window title. -7.0.7 - Thanks to Jeremy Cowgar for adding a new enhancement. This - enhancement allows the user to press 'S', that is capital S, which - will open the buffer under the cursor in a newly created split - window. -7.0.6 - Thanks to Larry Zhang for finding a bug in the "split" buffer code. - If you force set g:bufExplorerSplitType='v' in your vimrc, and if you - tried to do a \bs to split the bufexplorer window, it would always - split horizontal, not vertical. He also found that I had a typeo in - that the variable g:bufExplorerSplitVertSize was all lower case in - the documentation which was incorrect. -7.0.5 - Thanks to Mun Johl for pointing out a bug that if a buffer was - modified, the '+' was not showing up correctly. -7.0.4 - Fixed a problem discovered first by Xiangjiang Ma. Well since I've - been using vim 7.0 and not 6.3, I started using a function (getftype) - that is not in 6.3. So for backward compatibility, I conditionaly use - this function now. Thus, the g:bufExplorerShowDirectories feature is - only available when using vim 7.0 and above. -7.0.3 - Thanks to Erwin Waterlander for finding a problem when the last - buffer was deleted. This issue got me to rewrite the buffer display - logic (which I've wanted to do for sometime now). - Also great thanks to Dave Eggum for coming up with idea for - g:bufExplorerShowDirectories. Read the above information about this - feature. -7.0.2 - Thanks to Thomas Arendsen Hein for finding a problem when a user - has the default help turned off and then brought up the explorer. An - E493 would be displayed. -7.0.1 - Thanks to Erwin Waterlander for finding a couple problems. - The first problem allowed a modified buffer to be deleted. Opps! The - second problem occurred when several files were opened, BufExplorer - was started, the current buffer was deleted using the 'd' option, and - then BufExplorer was exited. The deleted buffer was still visible - while it is not in the buffers list. Opps again! -7.0.0 - Thanks to Shankar R. for suggesting to add the ability to set - the fixed width (g:bufExplorerSplitVertSize) of a new window - when opening bufexplorer vertically and fixed height - (g:bufExplorerSplitHorzSize) of a new window when opening - bufexplorer horizontally. By default, the windows are normally - split to use half the existing width or height. -6.3.0 - Added keepjumps so that the jumps list would not get cluttered with - bufexplorer related stuff. -6.2.3 - Thanks to Jay Logan for finding a bug in the vertical split position - of the code. When selecting that the window was to be split - vertically by doing a '\bv', from then on, all splits, i.e. '\bs', - were split vertically, even though g:bufExplorerSplitType was not set - to 'v'. -6.2.2 - Thanks to Patrik Modesto for adding a small improvement. For some - reason his bufexplorer window was always showing up folded. He added - 'setlocal nofoldenable' and it was fixed. -6.2.1 - Thanks goes out to Takashi Matsuo for added the 'fullPath' sorting - logic and option. -6.2.0 - Thanks goes out to Simon Johann-Ganter for spotting and fixing a - problem in that the last search pattern is overridden by the search - pattern for blank lines. -6.1.6 - Thanks to Artem Chuprina for finding a pesky bug that has been around - for sometime now. The <esc> key mapping was causing the buffer - explored to close prematurely when vim was run in an xterm. The <esc> - key mapping is now removed. -6.1.5 - Thanks to Khorev Sergey. Added option to show default help or not. -6.1.4 - Thanks goes out to Valery Kondakoff for suggesting the addition of - setlocal nonumber and foldcolumn=0. This allows for line numbering - and folding to be turned off temporarily while in the explorer. -6.1.3 - Added folding. Did some code cleanup. Added the ability to force the - newly split window to be temporarily vertical, which was suggested by - Thomas Glanzmann. -6.1.2 - Now pressing the <esc> key will quit, just like 'q'. - Added folds to hide winmanager configuration. - If anyone had the 'C' option in their cpoptions they would receive - a E10 error on startup of BufExplorer. cpo is now saved, updated and - restored. Thanks to Charles E Campbell, Jr. - Attempted to make sure there can only be one BufExplorer window open - at a time. -6.1.1 - Thanks to Brian D. Goodwin for adding toupper to FileNameCmp. This - way buffers sorted by name will be in the correct order regardless of - case. -6.0.16 - Thanks to Andre Pang for the original patch/idea to get bufexplorer - to work in insertmode/modeless mode (evim). Added Initialize - and Cleanup autocommands to handle commands that need to be - performed when starting or leaving bufexplorer. -6.0.15 - Srinath Avadhanulax added a patch for winmanager.vim. -6.0.14 - Fix a few more bug that I thought I already had fixed. Thanks - to Eric Bloodworth for adding 'Open Mode/Edit in Place'. Added - vertical splitting. -6.0.13 - Thanks to Charles E Campbell, Jr. for pointing out some embarrassing - typos that I had in the documentation. I guess I need to run - the spell checker more :o) -6.0.12 - Thanks to Madoka Machitani, for the tip on adding the augroup command - around the MRUList autocommands. -6.0.11 - Fixed bug report by Xiangjiang Ma. '"=' was being added to the - search history which messed up hlsearch. -6.0.10 - Added the necessary hooks so that the Srinath Avadhanula's - winmanager.vim script could more easily integrate with this script. - Tried to improve performance. -6.0.9 - Added MRU (Most Recently Used) sort ordering. -6.0.8 - Was not resetting the showcmd command correctly. - Added nifty help file. -6.0.7 - Thanks to Brett Carlane for some great enhancements. Some are added, - some are not, yet. Added highlighting of current and alternate - filenames. Added splitting of path/filename toggle. Reworked - ShowBuffers(). - Changed my email address. -6.0.6 - Copyright notice added. Needed this so that it could be distributed - with Debian Linux. Fixed problem with the SortListing() function - failing when there was only one buffer to display. -6.0.5 - Fixed problems reported by David Pascoe, in that you where unable to - hit 'd' on a buffer that belonged to a files that no longer existed - and that the 'yank' buffer was being overridden by the help text when - the bufexplorer was opened. -6.0.4 - Thanks to Charles Campbell, Jr. for making this plugin more plugin - *compliant*, adding default keymappings of <Leader>be and <Leader>bs - as well as fixing the 'w:sortDirLabel not being defined' bug. -6.0.3 - Added sorting capabilities. Sort taken from explorer.vim. -6.0.2 - Can't remember. -6.0.1 - Initial release. - -=============================================================================== -TODO *bufexplorer-todo* - -- The issuing of a ':bd' command does not always remove the buffer number from - the MRU list. - -=============================================================================== -CREDITS *bufexplorer-credits* - -Author: Jeff Lanzarotta <delux256-vim at yahoo dot com> - -Credit must go out to Bram Moolenaar and all the Vim developers for -making the world's best editor (IMHO). I also want to thank everyone who -helped and gave me suggestions. I wouldn't want to leave anyone out so I -won't list names. - -=============================================================================== -vim:tw=78:noet:wrap:ts=8:ft=help:norl: diff --git a/.vim/doc/cocoa.txt b/.vim/doc/cocoa.txt deleted file mode 100644 index 93cd2af..0000000 --- a/.vim/doc/cocoa.txt +++ /dev/null @@ -1,151 +0,0 @@ -*cocoa.txt* Plugin for Cocoa/Objective-C development. - -cocoa.vim *cocoa* -Last Change: September 08, 2009 -Author: Michael Sanders - -|cocoa-introduction| Introduction -|cocoa-installation| Installation -|cocoa-overview| Overview of features -|cocoa-mappings| Mappings -|cocoa-commands| Commands -|cocoa-license| License -|cocoa-contact| Contact - -For Vim version 7.0 or later. -This plugin only works if 'compatible' is not set. -{Vi does not have any of these features.} - -============================================================================== -INTRODUCTION *cocoa-intro* - -Cocoa.vim is a collection of scripts designed to make it easier to develop -Cocoa/Objective-C applications. It includes enhanced syntax highlighting, code -completion, documentation lookup, as well as a number of other features that -can be used to integrate Vim with Xcode, allowing you to essentially replace -Xcode's editor with Vim. - -============================================================================== -INSTALLATION *cocoa-installation* - -Documentation lookup and code completion for Cocoa.vim are currently -Leopard-only (although the other parts should work on any platform). To -install, simply unzip cocoa.zip to your home vim directory (typically ~/.vim). - - *cocoa-suggested-plugins* -The code completion in cocoa.vim uses snipMate, if you have it installed, to -allow you to conveniently <tab> over the parameters in functions and -methods. If you like cocoa.vim, you may also find objc_matchbracket.vim -useful. - - *leopard-security-alert* -Documentation works by showing the page in your default browser, which -apparently causes Leopard to warn you of opening an html file for every word -you look up. To fix this, see this page: http://tinyurl.com/remove-annoying-alert - -============================================================================== -FEATURE OVERVIEW *cocoa-features* - - 1. Enhanced syntax highlighting; Vim's syntax highlighting for - Objective-C seemed a bit incomplete to me, so I have added a few - niceties, such as highlighting Cocoa keywords and differentiating - the method name and passed objects in method calls and definitions. - 2. Xcode-like mappings; mappings such as <d-r> (where "d" is "command") - to build & run and <d-0> to switch to the project window help to - integrate Xcode and Vim. For a complete list of the mappings in - cocoa.vim, see |cocoa-mappings|. - 3. Methods for the current file can be listed and navigated to with - the |:ListMethods| command. - 4. A template of methods declared in a header file (.h) can be built - in an implementation file (.m) with |:BuildMethods|. - 5. Cocoa/C Documentation can be looked up with the |:CocoaDoc| command, - or simply with Vim's |K|. - 6. Code completion for classes, methods, functions, constants, types, - and notifications can be invoked with <c-x><c-o>. Parameters for - methods and functions are automatically converted to snippets to - <tab> over if you have snipMate installed. - -============================================================================== -MAPPINGS *cocoa-mappings* *g:objc_man_key* - -Cocoa.vim maps the following keys, some for convenience and others to -integrate with Xcode: -(Disclaimer: Sorry, I could not use the swirly symbols because vim/git was -having encoding issues. Just pretend that e.g. <d-r> means cmd-r.) - - |<Leader>|A - Alternate between header (.h) and implementation (.m) file - K - Look up documentation for word under cursor[1] - <d-m-up> - <Leader>A - <d-r> - Build & Run (Go) - <d-cr> - CMD-R - <d-b> - Build - <shift-k> - Clean - <d-0> - Go to Project - <d-2> - :ListMethods - <F5> (in insert mode) - Show omnicompletion menu - - ([1] This can be customized by the variable g:objc_man_key.) - -============================================================================== -COMMANDS *cocoa-commands* - - *:ListMethods* -:ListMethods Open a split window containing the methods, functions, - and #pragma marks of the current file. - *:BuildMethods* -:BuildMethods [headerfile] - Build a template of methods in an implementation (.m) - from a list declared in a header file (.h). If no - argument is given, the corresponding header file is - used (e.g. "foo.m" -> "foo.h"). - -============================================================================== -CODE COMPLETION *cocoa-completion* - -When cocoa.vim is installed the 'omnifunc' is automatically set to -'cocoacomplete#Complete'. This allows you to complete classes, functions, -methods, etc. with <c-x><c-o>. These keywords are saved from header files in -~/.vim/lib/cocoa_indexes; they have been built for you, although you can build -them again by running ~/.vim/lib/extras/cocoa_definitions.py. - -Completions with parameters (i.e., functions and methods) are automatically -converted to |snipMate| if it is installed. To invoke the snippet, simply -press a whitespace character (space, tab, or return), and then navigate the -snippet as you would in snipMate. - -============================================================================== -LICENSE *cocoa-license* - -Cocoa.vim is released under the MIT license: - -Copyright © 2009 Michael Sanders. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -The software is provided "as is", without warranty of any kind, express or -implied, including but not limited to the warranties of merchantability, -fitness for a particular purpose and noninfringement. In no event shall the -authors or copyright holders be liable for any claim, damages or other -liability, whether in an action of contract, tort or otherwise, arising from, -out of or in connection with the software or the use or other dealings in the -software. - -============================================================================== -CONTACT *cocoa-contact* *cocoa-author* - -To contact the author (Michael Sanders), you may email: - - msanders42+cocoa.vim <at> gmail <dot> com - -Thanks for your interest in the script! - -============================================================================== -vim:tw=78:ts=8:ft=help:norl:enc=utf-8: diff --git a/.vim/doc/matchit.txt b/.vim/doc/matchit.txt deleted file mode 100644 index 8a3a96e..0000000 --- a/.vim/doc/matchit.txt +++ /dev/null @@ -1,406 +0,0 @@ -*matchit.txt* Extended "%" matching - -For instructions on installing this file, type - :help matchit-install -inside Vim. - -For Vim version 6.3. Last change: 2007 Aug 29 - - - VIM REFERENCE MANUAL by Benji Fisher - -*matchit* *matchit.vim* - -1. Extended matching with "%" |matchit-intro| -2. Activation |matchit-activate| -3. Configuration |matchit-configure| -4. Supporting a New Language |matchit-newlang| -5. Known Bugs and Limitations |matchit-bugs| - -The functionality mentioned here is a plugin, see |add-plugin|. -This plugin is only available if 'compatible' is not set. -You can avoid loading this plugin by setting the "loaded_matchit" variable -in your |vimrc| file: > - :let loaded_matchit = 1 - -{Vi does not have any of this} - -============================================================================== -1. Extended matching with "%" *matchit-intro* - - *matchit-%* -% Cycle forward through matching groups, such as "if", "else", "endif", - as specified by |b:match_words|. - - *g%* *v_g%* *o_g%* -g% Cycle backwards through matching groups, as specified by - |b:match_words|. For example, go from "if" to "endif" to "else". - - *[%* *v_[%* *o_[%* -[% Go to [count] previous unmatched group, as specified by - |b:match_words|. Similar to |[{|. - - *]%* *v_]%* *o_]%* -]% Go to [count] next unmatched group, as specified by - |b:match_words|. Similar to |]}|. - - *v_a%* -a% In Visual mode, select the matching group, as specified by - |b:match_words|, containing the cursor. Similar to |v_a[|. - A [count] is ignored, and only the first character of the closing - pattern is selected. - -In Vim, as in plain vi, the percent key, |%|, jumps the cursor from a brace, -bracket, or paren to its match. This can be configured with the 'matchpairs' -option. The matchit plugin extends this in several ways: - - You can match whole words, such as "if" and "endif", not just - single characters. You can also specify a |regular-expression|. - You can define groups with more than two words, such as "if", - "else", "endif". Banging on the "%" key will cycle from the "if" to - the first "else", the next "else", ..., the closing "endif", and back - to the opening "if". Nested structures are skipped. Using |g%| goes - in the reverse direction. - By default, words inside comments and strings are ignored, unless - the cursor is inside a comment or string when you type "%". If the - only thing you want to do is modify the behavior of "%" so that it - behaves this way, you do not have to define |b:match_words|, since the - script uses the 'matchpairs' option as well as this variable. - -See |matchit-details| for details on what the script does, and |b:match_words| -for how to specify matching patterns. - -MODES: *matchit-modes* *matchit-v_%* *matchit-o_%* - -Mostly, % and related motions (|g%| and |[%| and |]%|) work just like built-in -|motion| commands in |Operator-pending| and |Visual| modes. However, you -cannot make these motions |linewise| or |characterwise|, since the |:omap|s -that define them start with "v" in order to make the default behavior -inclusive. (See |o_v|.) In other words, "dV%" will not work. The -work-around is to go through Visual mode: "V%d" will work. - -LANGUAGES: *matchit-languages* - -Currently, the following languages are supported: Ada, ASP with VBS, Csh, -DTD, Entity, Essbase, Fortran, HTML, JSP (same as HTML), LaTeX, Lua, Pascal, -SGML, Shell, Tcsh, Vim, XML. Other languages may already have support via -the default |filetype-plugin|s in the standard vim distribution. - -To support a new language, see |matchit-newlang| below. - -DETAILS: *matchit-details* *matchit-parse* - -Here is an outline of what matchit.vim does each time you hit the "%" key. If -there are |backref|s in |b:match_words| then the first step is to produce a -version in which these back references have been eliminated; if there are no -|backref|s then this step is skipped. This step is called parsing. For -example, "\(foo\|bar\):end\1" is parsed to yield -"\(foo\|bar\):end\(foo\|bar\)". This can get tricky, especially if there are -nested groups. If debugging is turned on, the parsed version is saved as -|b:match_pat|. - - *matchit-choose* -Next, the script looks for a word on the current line that matches the pattern -just constructed. It includes the patterns from the 'matchpairs' option. -The goal is to do what you expect, which turns out to be a little complicated. -The script follows these rules: - - Insist on a match that ends on or after the cursor. - Prefer a match that includes the cursor position (that is, one that - starts on or before the cursor). - Prefer a match that starts as close to the cursor as possible. - If more than one pattern in |b:match_words| matches, choose the one - that is listed first. - -Examples: - - Suppose you > - :let b:match_words = '<:>,<tag>:</tag>' -< and hit "%" with the cursor on or before the "<" in "a <tag> is born". - The pattern '<' comes first, so it is preferred over '<tag>', which - also matches. If the cursor is on the "t", however, then '<tag>' is - preferred, because this matches a bit of text containing the cursor. - If the two groups of patterns were reversed then '<' would never be - preferred. - - Suppose you > - :let b:match_words = 'if:end if' -< (Note the space!) and hit "%" with the cursor at the end of "end if". - Then "if" matches, which is probably not what you want, but if the - cursor starts on the "end " then "end if" is chosen. (You can avoid - this problem by using a more complicated pattern.) - -If there is no match, the cursor does not move. (Before version 1.13 of the -script, it would fall back on the usual behavior of |%|). If debugging is -turned on, the matched bit of text is saved as |b:match_match| and the cursor -column of the start of the match is saved as |b:match_col|. - -Next, the script looks through |b:match_words| (original and parsed versions) -for the group and pattern that match. If debugging is turned on, the group is -saved as |b:match_ini| (the first pattern) and |b:match_tail| (the rest). If -there are |backref|s then, in addition, the matching pattern is saved as -|b:match_word| and a table of translations is saved as |b:match_table|. If -there are |backref|s, these are determined from the matching pattern and -|b:match_match| and substituted into each pattern in the matching group. - -The script decides whether to search forwards or backwards and chooses -arguments for the |searchpair()| function. Then, the cursor is moved to the -start of the match, and |searchpair()| is called. By default, matching -structures inside strings and comments are ignored. This can be changed by -setting |b:match_skip|. - -============================================================================== -2. Activation *matchit-activate* - -You can use this script as a plugin, by copying it to your plugin directory. -See |add-global-plugin| for instructions. You can also add a line to your -|vimrc| file, such as > - :source $VIMRUNTIME/macros/matchit.vim -or > - :runtime macros/matchit.vim -Either way, the script should start working the next time you start up Vim. - -(Earlier versions of the script did nothing unless a |buffer-variable| named -|b:match_words| was defined. Even earlier versions contained autocommands -that set this variable for various file types. Now, |b:match_words| is -defined in many of the default |filetype-plugin|s instead.) - -For a new language, you can add autocommands to the script or to your vimrc -file, but the recommended method is to add a line such as > - let b:match_words = '\<foo\>:\<bar\>' -to the |filetype-plugin| for your language. See |b:match_words| below for how -this variable is interpreted. - -TROUBLESHOOTING *matchit-troubleshoot* - -The script should work in most installations of Vim. It may not work if Vim -was compiled with a minimal feature set, for example if the |+syntax| option -was not enabled. If your Vim has support for syntax compiled in, but you do -not have |syntax| highlighting turned on, matchit.vim should work, but it may -fail to skip matching groups in comments and strings. If the |filetype| -mechanism is turned off, the |b:match_words| variable will probably not be -defined automatically. - -============================================================================== -3. Configuration *matchit-configure* - -There are several variables that govern the behavior of matchit.vim. Note -that these are variables local to the buffer, not options, so use |:let| to -define them, not |:set|. Some of these variables have values that matter; for -others, it only matters whether the variable has been defined. All of these -can be defined in the |filetype-plugin| or autocommand that defines -|b:match_words| or "on the fly." - -The main variable is |b:match_words|. It is described in the section below on -supporting a new language. - - *MatchError* *matchit-hl* *matchit-highlight* -MatchError is the highlight group for error messages from the script. By -default, it is linked to WarningMsg. If you do not want to be bothered by -error messages, you can define this to be something invisible. For example, -if you use the GUI version of Vim and your command line is normally white, you -can do > - :hi MatchError guifg=white guibg=white -< - *b:match_ignorecase* -If you > - :let b:match_ignorecase = 1 -then matchit.vim acts as if 'ignorecase' is set: for example, "end" and "END" -are equivalent. If you > - :let b:match_ignorecase = 0 -then matchit.vim treats "end" and "END" differently. (There will be no -b:match_infercase option unless someone requests it.) - - *b:match_debug* -Define b:match_debug if you want debugging information to be saved. See -|matchit-debug|, below. - - *b:match_skip* -If b:match_skip is defined, it is passed as the skip argument to -|searchpair()|. This controls when matching structures are skipped, or -ignored. By default, they are ignored inside comments and strings, as -determined by the |syntax| mechanism. (If syntax highlighting is turned off, -nothing is skipped.) You can set b:match_skip to a string, which evaluates to -a non-zero, numerical value if the match is to be skipped or zero if the match -should not be skipped. In addition, the following special values are -supported by matchit.vim: - s:foo becomes (current syntax item) =~ foo - S:foo becomes (current syntax item) !~ foo - r:foo becomes (line before cursor) =~ foo - R:foo becomes (line before cursor) !~ foo -(The "s" is meant to suggest "syntax", and the "r" is meant to suggest -"regular expression".) - -Examples: - - You can get the default behavior with > - :let b:match_skip = 's:comment\|string' -< - If you want to skip matching structures unless they are at the start - of the line (ignoring whitespace) then you can > - :let b:match_skip = 'R:^\s*' -< Do not do this if strings or comments can span several lines, since - the normal syntax checking will not be done if you set b:match_skip. - - In LaTeX, since "%" is used as the comment character, you can > - :let b:match_skip = 'r:%' -< Unfortunately, this will skip anything after "\%", an escaped "%". To - allow for this, and also "\\%" (an excaped backslash followed by the - comment character) you can > - :let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%' -< - See the $VIMRUNTIME/ftplugin/vim.vim for an example that uses both - syntax and a regular expression. - -============================================================================== -4. Supporting a New Language *matchit-newlang* - *b:match_words* -In order for matchit.vim to support a new language, you must define a suitable -pattern for |b:match_words|. You may also want to set some of the -|matchit-configure| variables, as described above. If your language has a -complicated syntax, or many keywords, you will need to know something about -Vim's |regular-expression|s. - -The format for |b:match_words| is similar to that of the 'matchpairs' option: -it is a comma (,)-separated list of groups; each group is a colon(:)-separated -list of patterns (regular expressions). Commas and backslashes that are part -of a pattern should be escaped with backslashes ('\:' and '\,'). It is OK to -have only one group; the effect is undefined if a group has only one pattern. -A simple example is > - :let b:match_words = '\<if\>:\<endif\>,' - \ . '\<while\>:\<continue\>:\<break\>:\<endwhile\>' -(In Vim regular expressions, |\<| and |\>| denote word boundaries. Thus "if" -matches the end of "endif" but "\<if\>" does not.) Then banging on the "%" -key will bounce the cursor between "if" and the matching "endif"; and from -"while" to any matching "continue" or "break", then to the matching "endwhile" -and back to the "while". It is almost always easier to use |literal-string|s -(single quotes) as above: '\<if\>' rather than "\\<if\\>" and so on. - -Exception: If the ":" character does not appear in b:match_words, then it is -treated as an expression to be evaluated. For example, > - :let b:match_words = 'GetMatchWords()' -allows you to define a function. This can return a different string depending -on the current syntax, for example. - -Once you have defined the appropriate value of |b:match_words|, you will -probably want to have this set automatically each time you edit the -appropriate file type. The recommended way to do this is by adding the -definition to a |filetype-plugin| file. - -Tips: Be careful that your initial pattern does not match your final pattern. -See the example above for the use of word-boundary expressions. It is usually -better to use ".\{-}" (as many as necessary) instead of ".*" (as many as -possible). See |\{-|. For example, in the string "<tag>label</tag>", "<.*>" -matches the whole string whereas "<.\{-}>" and "<[^>]*>" match "<tag>" and -"</tag>". - - *matchit-spaces* *matchit-s:notend* -If "if" is to be paired with "end if" (Note the space!) then word boundaries -are not enough. Instead, define a regular expression s:notend that will match -anything but "end" and use it as follows: > - :let s:notend = '\%(\<end\s\+\)\@<!' - :let b:match_words = s:notend . '\<if\>:\<end\s\+if\>' -< *matchit-s:sol* -This is a simplified version of what is done for Ada. The s:notend is a -|script-variable|. Similarly, you may want to define a start-of-line regular -expression > - :let s:sol = '\%(^\|;\)\s*' -if keywords are only recognized after the start of a line or after a -semicolon (;), with optional white space. - - *matchit-backref* *matchit-\1* -In any group, the expressions |\1|, |\2|, ..., |\9| refer to parts of the -INITIAL pattern enclosed in |\(|escaped parentheses|\)|. These are referred -to as back references, or backrefs. For example, > - :let b:match_words = '\<b\(o\+\)\>:\(h\)\1\>' -means that "bo" pairs with "ho" and "boo" pairs with "hoo" and so on. Note -that "\1" does not refer to the "\(h\)" in this example. If you have -"\(nested \(parentheses\)\) then "\d" refers to the d-th "\(" and everything -up to and including the matching "\)": in "\(nested\(parentheses\)\)", "\1" -refers to everything and "\2" refers to "\(parentheses\)". If you use a -variable such as |s:notend| or |s:sol| in the previous paragraph then remember -to count any "\(" patterns in this variable. You do not have to count groups -defined by |\%(\)|. - -It should be possible to resolve back references from any pattern in the -group. For example, > - :let b:match_words = '\(foo\)\(bar\):more\1:and\2:end\1\2' -would not work because "\2" cannot be determined from "morefoo" and "\1" -cannot be determined from "andbar". On the other hand, > - :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1' -should work (and have the same effect as "foobar:barfoo:endfoobar"), although -this has not been thoroughly tested. - -You can use |zero-width| patterns such as |\@<=| and |\zs|. (The latter has -not been thouroughly tested in matchit.vim.) For example, if the keyword "if" -must occur at the start of the line, with optional white space, you might use -the pattern "\(^\s*\)\@<=if" so that the cursor will end on the "i" instead of -at the start of the line. For another example, if HTML had only one tag then -one could > - :let b:match_words = '<:>,<\@<=tag>:<\@<=/tag>' -so that "%" can bounce between matching "<" and ">" pairs or (starting on -"tag" or "/tag") between matching tags. Without the |\@<=|, the script would -bounce from "tag" to the "<" in "</tag>", and another "%" would not take you -back to where you started. - -DEBUGGING *matchit-debug* *:MatchDebug* - -If you are having trouble figuring out the appropriate definition of -|b:match_words| then you can take advantage of the same information I use when -debugging the script. This is especially true if you are not sure whether -your patterns or my script are at fault! To make this more convenient, I have -made the command :MatchDebug, which defines the variable |b:match_debug| and -creates a Matchit menu. This menu makes it convenient to check the values of -the variables described below. You will probably also want to read -|matchit-details| above. - -Defining the variable |b:match_debug| causes the script to set the following -variables, each time you hit the "%" key. Several of these are only defined -if |b:match_words| includes |backref|s. - - *b:match_pat* -The b:match_pat variable is set to |b:match_words| with |backref|s parsed. - *b:match_match* -The b:match_match variable is set to the bit of text that is recognized as a -match. - *b:match_col* -The b:match_col variable is set to the cursor column of the start of the -matching text. - *b:match_wholeBR* -The b:match_wholeBR variable is set to the comma-separated group of patterns -that matches, with |backref|s unparsed. - *b:match_iniBR* -The b:match_iniBR variable is set to the first pattern in |b:match_wholeBR|. - *b:match_ini* -The b:match_ini variable is set to the first pattern in |b:match_wholeBR|, -with |backref|s resolved from |b:match_match|. - *b:match_tail* -The b:match_tail variable is set to the remaining patterns in -|b:match_wholeBR|, with |backref|s resolved from |b:match_match|. - *b:match_word* -The b:match_word variable is set to the pattern from |b:match_wholeBR| that -matches |b:match_match|. - *b:match_table* -The back reference '\'.d refers to the same thing as '\'.b:match_table[d] in -|b:match_word|. - -============================================================================== -5. Known Bugs and Limitations *matchit-bugs* - -Just because I know about a bug does not mean that it is on my todo list. I -try to respond to reports of bugs that cause real problems. If it does not -cause serious problems, or if there is a work-around, a bug may sit there for -a while. Moral: if a bug (known or not) bothers you, let me know. - -The various |:vmap|s defined in the script (%, |g%|, |[%|, |]%|, |a%|) may -have undesired effects in Select mode |Select-mode-mapping|. At least, if you -want to replace the selection with any character in "ag%[]" there will be a -pause of |'updatetime'| first. - -It would be nice if "\0" were recognized as the entire pattern. That is, it -would be nice if "foo:\end\0" had the same effect as "\(foo\):\end\1". I may -try to implement this in a future version. (This is not so easy to arrange as -you might think!) - -============================================================================== -vim:tw=78:fo=tcq2: diff --git a/.vim/doc/project.txt b/.vim/doc/project.txt deleted file mode 100644 index 8f85c23..0000000 --- a/.vim/doc/project.txt +++ /dev/null @@ -1,710 +0,0 @@ -*project.txt* Plugin for managing multiple projects with multiple sources - For Vim version 6.x and Vim version 7.x. - Last Change: Fri 13 Oct 2006 10:20:13 AM EDT - - - By Aric Blumer - aricvim email-at-sign charter.net - - *project* *project-plugin* - Contents: - - Commands...................|project-invoking| - Inheritance.............|project-inheritance| - Mappings...................|project-mappings| - Adding Mappings.....|project-adding-mappings| - Settings...................|project-settings| - Example File................|project-example| - Tips...........................|project-tips| - - -You can use this plugin's basic functionality to set up a list of -frequently-accessed files for easy navigation. The list of files will be -displayed in a window on the left side of the Vim window, and you can press -<Return> or double-click on filenames in the list to open the files. I find -this easier to use than having to navigate a directory hierarchy with the -|file-explorer|. - -You can also instruct the Plugin to change to a directory and to run Vim -scripts when you select a file. These scripts can, for example, modify the -environment to include compilers in $PATH. This makes it very easy to use -quickfix with multiple projects that use different environments. - -Other features include: - o Loading/Unloading all the files in a Project (\l, \L, \w, and \W) - o Grepping all the files in a Project (\g and \G) - o Running a user-specified script on a file (can be used to launch an - external program on the file) (\1 through \9) - o Running a user-specified script on all the files in a Project - (\f1-\f9 and \F1-\F9) - o High degree of user-configurability - o Also works with |netrw| using the XXXX://... notation where XXXX is - ftp, rcp, scp, or http. - -All of this is specified within a simple text file and a few global variables -in your vimrc file. - -You must set 'nocompatible' in your |vimrc| file to use this plugin. You can -stop the plugin from being loaded by setting the "loaded_project" variable: > - :let loaded_project = 1 - - -============================================================================== -COMMANDS *project-invoking* - -You can use the plugin by placing it in your plugin directory (e.g., -~/.vim/plugin). See |add-global-plugin|. When you start vim the next time, you -then enter the command > - :Project -or > - :Project {file} - -If you do not specify the filename, $HOME/.vimprojects is used. - -To have Vim come up with the Project Window enabled automatically (say, from a -GUI launcher), run Vim like this: [g]vim +Project - -Note that you can invoke :Project on only one file at a time. If you wish to -change the Project File, do a :bwipe in the Project Buffer, then re-invoke the -Plugin as described above. - -Several Projects can be kept and displayed in the same file, each in a fold -delimited by { and } (see |fold.txt|). There can be any number of nested -folds to provide you with a Project hierarchy. Any line without a { or a } in -the file is considered to be a filename. Blank lines are ignored, and any -text after a # is ignored. - -Because the plugin uses standard Vim folds, you can use any of the -|fold-commands|. You can double-click on the first line of a fold to open and -close it. You can select a file to open by putting the cursor on its name and -pressing <Return> or by double-clicking on it. The plugin will create a new -window to the right or use the |CTRL-W_p| equivalent if it exists. - - *project-syntax* -Each Project Entry has this form: - -project_entry ::= - <Description>={projpath} [{options}] { - [ filename ] - [ project_entry ] - } - -{options} is one or more of the following (on the same line): - CD={path} - in={filename} - out={filename} - filter="{pat}" - flags={flag} - -Note that a project_entry can reside within a project_entry. This allows you -to set up a hierarchy within your Project. - -The <Description> will be displayed in the foldtext and cannot contain "=". -There can be no space character directly on either side of the =. - -The {projpath} is the path in which the files listed in the Project's fold -will be found, and it may contain environment variables. If the path is a -relative path, then the plugin constructs the whole path from the Project's -parent, grandparent, etc., all the way up the hierarchy. An outermost -project_entry must have an absolute path. See the |project-inheritance| -example below. {projpath} may contain spaces, but they must be escaped like -normal Vim escapes. Here are two examples of the same directory: -> - Example=/my/directory/with\ spaces { - } - Example="/my/directory/with spaces" { - } - -I recommend this for Windows: > - - Example="c:\My Documents" { - } - -But Vim is smart enough to do this, too: > - - Example=c:\My\ Documents { - } - -CD= provides the directory that Vim will change to when you select a file in -that fold (using |:cd|). This allows you, for example, to enter |:make| to use -the local Makefile. A CD=. means that Vim will make {projpath} or its -inherited equivalent the current working directory. When CD is omitted, the -directory is not changed. There can be no space on either side of the =. The -value of CD can also be a relative path from a parent's CD. See the -|project-inheritance| example below. This directive is ignored for |netrw| -projects. Spaces are allowed in the path as for {projpath}. - -in= and out= provide the means to run arbitrary Vim scripts whenever you enter -or leave a file's buffer (see the |BufEnter| and |BufLeave| autocommand -events). The idea is to have a Vim script that sets up or tears down the -environment for the Project like this: - -in.vim: > - let $PROJECT_HOME='~/my_project' - " Put the compiler in $PATH - if $PATH !~ '/path/to/my/compiler' - let $PATH=$PATH.':/path/to/my/compiler' - endif - -out.vim: > - " Remove compiler from $PATH - if $PATH =~ '/path/to/my/compiler' - let $PATH=substitute($PATH, ':/path/to/my/compiler', '', 'g') - endif - -Then you can use :make with the proper environment depending on what file you -are currently editing. If the path to the script is relative, then it is -relative from {projpath}. These directives are inherited by Subprojects -unless the Subproject specifies its own. For use with |netrw| projects, the -paths specified for in= and out= must be absolute and local. - -filter= specifies a |glob()| file pattern. It is used to regenerate the list -of files in a Project fold when using the \r (<LocalLeader>r) map in the -Project Window. The filter value must be in quotes because it can contain -multiple file patterns. If filter is omitted, then the * pattern is used. -There can be no space on either side of the =. A Subproject will inherit the -filter of its parent unless it specifies its own filter. - -flags= provides the means to enable/disable features for a particular fold. -The general mnemonic scheme is for lower case to turn something off and upper -case to turn something on. {flag} can contain any of the following -characters: - - flag Description ~ - - l Turn off recursion for this fold for \L. Subfolds are also - blocked from the recursion. - - r Turn off refresh. When present, do not refresh this fold when - \r or \R is used. This does not affect subfold recursion. - - S Turn on sorting for refresh and create. - - s Turn off sorting for refresh and create. - - T Turn on top gravity. Forces folds to the top of the current - fold when refreshing. It has the same affect as the 'T' flag - in g:proj_flags, but controls the feature on a per-fold basis. - - t Turn off top gravity. Forces folds to the bottom of the - current fold when refreshing. - - w Turn off recursion for this fold for \W. Subfolds are also - blocked from the recursion. - - -Flags are not inherited by Subprojects. - -Any text outside a fold is ignored. - - -============================================================================== -INHERITANCE *project-inheritance* - -It's best to show inheritance by comparing these two Project Files: -> - Parent=~/my_project CD=. filter="Make* *.mk" flags=r { - Child1=c_code { - } - Child2=include CD=. filter="*.h" { - } - } - -Child1's path is "~/my_project/c_code" because ~/my_project is inherited. It -also inherits the CD from Parent. Since Parent has CD=., the Parent's cwd is -"~/my_project". Child1 therefore inherits a CD of "~/my_project". Finally, -Child1 inherits the filter from Parent. The flags are not inherited. - -Child2 only inherits the "~/my_project" from Parent. - -Thus, the example above is exactly equivalent to this: -> - Parent=~/my_project CD=. filter="Make* *.mk" flags=r { - Child1=~/my_project/c_code CD=~/my_project filter="Make* *.mk" { - } - Child2=~/my_project/include CD=~/my_project/include filter="*.h" { - } - } - -(For a real Project, Child1 would not want to inherit its parent's filter, but -this example shows the concept.) You can always enter \i to display what the -cursor's project inherits. - - -============================================================================== -MAPPINGS *project-mappings* - -Map Action ~ - -\r Refreshes the Project fold that the cursor is in by placing in the - fold all the files that match the filter. The Project is refreshed - using an indent of one space for every foldlevel in the hierarchy. - - You may place a "# pragma keep" (without the quotes) at the end of a - line, and the file entry on that line will not be removed when you - refresh. This is useful, for example, when you have . as an entry so - you can easily browse the directory. - - Note that this mapping is actually <LocalLeader>r, and the default of - |<LocalLeader>| is \. - - This does not work for Projects using |netrw|. - -\R Executes \r recursively in the current fold and all folds below. - This does not work for Projects using |netrw|. - -\c Creates a Project fold entry. It asks for the description, the path - to the files, the CD parameter, and the filename |glob()| pattern. - From this information, it will create the Project Entry below the - cursor. - - This does not work for Projects using |netrw|. - -\C Creates a Project fold entry like \c, but recursively includes all the - subdirectories. - -<Return> - Select a file to open in the |CTRL-W_p| window or in a new window. If - the cursor is on a fold, open or close it. - -<S-Return> -\s - Same as <Return> but horizontally split the target window. - <LocalLeader>s is provided for those terminals that don't recognize - <S-Return>. - -\S - Load all files in a project by doing horizontal splits. - -<C-Return> -\o - Same as <Return> but ensure that the opened file is the only other - window. <LocalLeader>o is provided for those terminals that don't - recognize <C-Return>. - -<M-Return> -\v - Same as <Return> but only display the file--the cursor stays in the - Project Window. - -<2-LeftMouse> - (Double-click) If on a closed fold, open it. If on an open fold - boundary, close it. If on a filename, open the file in the |CTRL-W_p| - window or in a new window. - -<S-2-LeftMouse> - Same as <S-Return>. - -<C-2-LeftMouse> - Same as <C-Return>. - -<RightMouse> - Increase the width of the Project Window by g:proj_window_increment or - toggle between a width of - g:proj_window_width + g:proj_window_increment - and - g:proj_window_width. - - Whether you toggle or monotonically increase the width is determined - by the 't' flag of the g:proj_flags variable (see |project-flags|). - - Note that a Right Mouse click will not automatically place the cursor - in the Project Window if it is in a different window. The window will - go back to the g:proj_window_width width when you leave the window. - -<space> Same as <RightMouse> - -<CTRL-Up> -\<Up> - Move the text or fold under the cursor up one row. This may not work - in a terminal because the terminal is unaware of this key combination. - <LocalLeader><Up> is provided for those terminals that don't recognize - <C-Up>. - - -<CTRL-Down> -\<Down> - Move the text or fold under the cursor down one row. This may not work - in a terminal because the terminal is unaware of this key combination. - <LocalLeader><Down> is provided for those terminals that don't - recognize <C-Down>. - -\i Show in the status line the completely resolved and inherited - parameters for the fold the cursor is in. This is intended for - debugging your relative path and inherited parameters for manually - entered Projects. - -\I Show in the status line the completely resolved filename. Uses the - Project_GetFname(line('.')) function. - -\1 - \9 - Run the command specified in g:proj_run{x} where {x} is the number - of the key. See the documentation of g:proj_run1 below. - -\f1-\f9 - Run the command specified in g:proj_run_fold{x} where {x} is the - number of the key. The command is run on the files at the current - Project level. See the |project-settings| below. - -\F1-\F9 - Run the command specified in g:proj_run_fold{x} where {x} is the - number of the key. The command is run on the files at the current - Project level and all Subprojects. See the |project-settings| below. - -\0 Display the commands that are defined for \1 through \9. - -\f0 Display the commands that are defined for \f1 through \f9 and \F1 - through \F0. Same as \F0. - -\l Load all the files in the current Project level into Vim. While files - are being loaded, you may press any key to stop. - -\L Load all the files in the current Project and all Subprojects into - Vim. Use this mapping with caution--I wouldn't suggest using \L to - load a Project with thousands of files. (BTW, my Project file has more - than 5,300 files in it!) While files are being loaded, you may press - any key to stop. - -\w Wipe all the files in the current Project level from Vim. (If files - are modified, they will be saved first.) While files are being wiped, - you may press any key to stop. - -\W Wipe all the files in the current Project and all Subprojects from - Vim. (If files are modified, they will be saved first.) While files - are being wiped, you may press any key to stop. - -\g Grep all the files in the current Project level. - -\G Grep all the files in the current Project level and all Subprojects. - -\e Set up the Environment for the Project File as though you had selected - it with <Return>. This allows you to do a \e and a :make without - having to open any files in the project. - -\E Explore (using |file-explorer|) the directory of the project the - cursor is in. Does not work with netrw. - -<F12> When the 'g' flag is present in g:proj_flags (see |project-flags|) - this key toggles the Project Window open and closed. You may remap - this toggle function by putting the following in your vimrc and - replacing <Leader>P with whatever key combination you wish: - - nmap <silent> <Leader>P <Plug>ToggleProject - -Note that the Project Plugin remaps :help because the Help Window and the -Project Window get into a fight over placement. The mapping avoids the -problem. - -============================================================================== -ADDING MAPPINGS *project-adding-mappings* - -You can add your own mappings or change the mappings of the plugin by placing -them in the file $HOME/.vimproject_mappings. This file, if it exists, will be -sourced when the plugin in loaded. Here is an example that will count the -number of entries in a project when you press \K (Kount, C is taken :-): > - - function! s:Wc() - let b:loadcount=0 - function! SpawnExec(infoline, fname, lineno, data) - let b:loadcount = b:loadcount + 1 - if getchar(0) != 0 | let b:stop_everything=1 | endif - endfunction - call Project_ForEach(1, line('.'), "*SpawnExec", 0, '') - delfunction SpawnExec - echon b:loadcount." Files\r" - unlet b:loadcount - if exists("b:stop_everything") - unlet b:stop_everything - echon "Aborted.\r" - endif - endfunction - - nnoremap <buffer> <silent> <LocalLeader>K :call <SID>Wc()<CR> - -Here's another example of how I integrated the use of perforce with the plugin -in my $HOME/.vimproject_mappings: -> - function! s:DoP4(cmd) - let name=Project_GetFname(line('.')) - let dir=substitute(name, '\(.*\)/.*', '\1', 'g') - exec 'cd '.dir - exec "!".a:cmd.' '.Project_GetFname(line('.')) - cd - - endfunction - - nmap <buffer> <silent> \pa :call <SID>DoP4("p4add")<CR> - nmap <buffer> <silent> \pe :call <SID>DoP4("p4edit")<CR> -< -(Note that I CD to the directory the file is in so I can pick of the $P4CONFIG -file. See the perforce documentation.) - -This creates the mappings \pe to check out the file for edit and \pa to add -the file to the depot. - -Here is another example where I remap the <Return> mapping to use an external -program to launch a special kind of file (in this case, it launches ee to view -a jpg file). It is a bit contrived, but it works. -> - let s:sid = substitute(maparg('<Return>', 'n'), '.*\(<SNR>.\{-}\)_.*', '\1', '') - function! s:LaunchOrWhat() - let fname=Project_GetFname(line('.')) - if fname =~ '\.jpg$' - exec 'silent! !ee "'.fname.'"&' - else - call {s:sid}_DoFoldOrOpenEntry('', 'e') - endif - endfunction - nnoremap <buffer> <silent> <Return> \|:call <SID>LaunchOrWhat()<CR> -< -If the file ends in .jpg, the external program is launched, otherwise the -original mapping of <Return> is run. - -============================================================================== -SETTINGS *project-settings* - -You can set these variables in your vimrc file before the plugin is loaded to -change its default behavior - -g:proj_window_width - The width of the Project Window that the plugin attempts to maintain. - Default: 24 - - The Project Plugin is not always successful in keeping the window - where I want it with the size specified here, but it does a decent - job. - -g:proj_window_increment - The increment by which to increase the width of the Project Window - when pressing <space> or clicking the <LeftMouse>. Default: 100 - (See |project-mappings|.) - - *project-flags* -g:proj_flags - Default: "imst" - Various flags to control the behavior of the Project Plugin. This - variable can contain any of the following character flags. - - flag Description ~ - - b When present, use the |browse()| when selecting directories - for \c and \C. This is off by default for Windows, because - the windows browser does not allow you to select directories. - - c When present, the Project Window will automatically close when - you select a file. - - F Float the Project Window. That is, turn off automatic - resizing and placement. This allows placement between other - windows that wish to share similar placement at the side of - the screen. It is also particularly helpful for external - window managers. - - g When present, the mapping for <F12> will be created to toggle - the Project Window open and closed. - - i When present, display the filename and the current working - directory in the command line when a file is selected for - opening. - - l When present, the Project Plugin will use the |:lcd| command - rather than |:cd| to change directories when you select a file - to open. This flag is really obsolete and not of much use - because of L below. - - L Similar to l, but install a BufEnter/Leave |:autocommand| to - ensure that the current working directory is changed to the - one specified in the fold CD specification whenever that - buffer is active. (|:lcd| only changes the CWD for a window, - not a buffer.) - - m Turn on mapping of the |CTRL-W_o| and |CTRL-W_CTRL_O| normal - mode commands to make the current buffer the only visible - buffer, but keep the Project Window visible, too. - - n When present, numbers will be turned on for the project - window. - - s When present, the Project Plugin will use syntax highlighting - in the Project Window. - - S Turn on sorting for refresh and create. - - t When present, toggle the size of the window rather than just - increase the size when pressing <space> or right-clicking. - See the entry for <RightMouse> in |project-mappings|. - - T When present, put Subproject folds at the top of the fold when - refreshing. - - v When present, use :vimgrep rather than :grep when using \G. - -g:proj_run1 ... g:proj_run9 - Contains a Vim command to execute on the file. See the - mappings of \1 to \9 above. - - %f is replaced with the full path and filename - %F is replaced with the full path and filename with spaces - quoted - %n is replaced with the filename alone - %N is replaced with the filename alone with spaces quoted - %h is replaced with the home directory - %H is replaced with the home directory with spaces quoted - %r is replaced with the directory relative to the CD path - %R is replaced with the directory relative to the CD path - with spaces quoted - %d is replaced with the CD directory. - %D is replaced with the CD directory.with spaces quoted - %% is replaced with a single % that is not used in - expansion. - - (Deprecated: %s is also replaced with the full path and - filename for backward compatibility.) - - For example, gvim will be launched on the file under the - cursor when you enter \3 if the following is in your vimrc - file: > - let g:proj_run3='silent !gvim %f' -< Here are a few other examples: > - let g:proj_run1='!p4 edit %f' - let g:proj_run2='!p4 add %f' - let g:proj_run4="echo 'Viewing %f'|sil !xterm -e less %f &" -< - On Windows systems you will want to put the %f, %h, and %d in - single quotes to avoid \ escaping. - -g:proj_run_fold1 ... g:proj_run_fold9 - Contains a Vim command to execute on the files in a fold. See - the mappings of \f1 to \f9 and \F1 to \F9 above. - - %f is the filename, %h is replaced with the project home - directory, and %d is replaced with the CD directory. Multiple - filenames can be handled in two ways: - - The first (default) way is to have %f replaced with all the - absolute filenames, and the command is run once. The second - is to have the command run for each of the non-absolute - filenames (%f is replaced with one filename at a time). To - select the second behavior, put an '*' character at the - beginning of the g:proj_run_fold{x} variable. (The '*' is - stripped before the command is run.) - - For example, note the difference between the following: > - let g:proj_run_fold3="*echo '%h/%f'" - let g:proj_run_fold4="echo '%f'" -< - Note that on Windows systems, you will want the %f, %h, and %c - within single quotes, or the \ in the paths will cause - problems. The alternative is to put them in |escape()|. - - -============================================================================== -PROJECT EXAMPLE FILE *project-example* - -Here is an example ~/.vimprojects file: > - - 1 My Project=~/c/project CD=. in=in.vim out=out.vim flags=r { - 2 Makefile - 3 in.vim - 4 out.vim - 5 GUI Files=. filter="gui*.c gui*.h" { - 6 gui_window.c - 7 gui_dialog.c - 8 gui_list.c - 9 gui.h # Header file - 10 } - 11 Database Files=. filter="data*.c data*.h" { - 12 data_read.c - 13 data_write.c - 14 data.h - 15 } - 16 OS-Specific Files { - 17 Win32=. filter="os_win32*.c os_win32*.h" { - 18 os_win32_gui.c - 19 os_win32_io.c - 20 } - 21 Unix=. filter="os_unix*.c os_unix*.h" { - 22 os_unix_gui.c - 23 os_unix_io.c - 24 } - 25 } - 26 } - -(Don't type in the line numbers, of course.) - - -============================================================================== -TIPS ON USING PROJECT PLUGIN *project-tips* - -1. You can create a Project Entry by entering this: > - - Label=~/wherever CD=. filter="*.c *.h" { - } -< - Then you can put the cursor in the fold and press \r. The script will fill - in the files (C files in this case) from this directory for you. This is - equivalent to \c without any dialogs. - -2. You can edit the Project File at any time to add, remove, or reorder files - in the Project list. - -3. If the Project Window ever gets closed, you can just enter > - :Project -< to bring it back again. (You don't need to give it the filename; the - plugin remembers.) - - If you have the 'm' flag set in g:proj_flags, then you get the Project - Window to show up again by pressing |CTRL-W_o|. This, of course, will - close any other windows that may be open that the cursor is not in. - -4. Adding files to a Project is very easy. To add, for example, the 'more.c' - file to the Project, just insert the filename in the Project Entry then - hit <Return> on it. - -5. When |quickfix| loads files, it is not equivalent to pressing <Return> on - a filename, so the directory will not be changed and the scripts will not - be run. (If I could make this otherwise, I would.) The solution is to use - the \L key to load all of the files in the Project before running - quickfix. - -6. If the Project window gets a bit cluttered with folds partially - open/closed, you can press |zM| to close everything and tidy it up. - -7. For advanced users, I am exporting the function Project_GetAllFnames() - which returns all the filenames within a fold and optionally all its - Subprojects. Also, I export Project_ForEach() for running a function for - each filename in the project. See the code for examples on how to use - these. Finally, I export Project_GetFname(line_number) so that you can - write your own mappings and get the filename for it. - -8. Some people have asked how to do a global mapping to take the cursor to - the Project window. One of my goals for the plugin is for it to be as - self-contained as possible, so I'm not going to add it by default. But you - can put this in your vimrc: -> - nmap <silent> <Leader>P :Project<CR> - -< -9. You can put the . entry in a project, and it will launch the - |file-explorer| plugin on the directory. To avoid removal when you - refresh, make the entry look like this: -> - . # pragma keep -< -============================================================================== -THANKS - - The following people have sent me patches to help with the Project - Plugin development: - - Tomas Zellerin - Lawrence Kesteloot - Dave Eggum - A Harrison - Thomas Link - Richard Bair - Eric Arnold - Peter Jones - Eric Van Dewoestine - - - vim:ts=8 sw=8 noexpandtab tw=78 ft=help: diff --git a/.vim/doc/ps_color.txt b/.vim/doc/ps_color.txt deleted file mode 100644 index 158dd57..0000000 --- a/.vim/doc/ps_color.txt +++ /dev/null @@ -1,603 +0,0 @@ -*ps_color.txt* PSC For Vim version 7.0 Last change: 18 July 2006 - - -PERSONAL COLOUR SWITCHER *ps_colour* *pscolor* - - -Author: Pan, Shi Zhu. <see vim online for my e-mail> - -============================================================================== -CONTENTS *psc* *psc-contents* - - 1. Contents.....................|psc-contents| - 2. PSC Overview.................|psc-overview| - 3. PSC Installation.............|psc-usage| - 4. PSC Options..................|psc-options| - 5. PSC under color term ........|psc-cterm| - 6. PSC FAQ and Tips ............|psc-faq| - 7. PSC Release notes............|psc-release-notes| - 8. PSC Todo List................|psc-todo| - -For release notes, please see the header of ps_color.vim - -============================================================================== -PSC FEATURES OVERVIEW *psc-features* *psc-overview* - - Features ~ - - . PSC is firstly a color scheme which have both dark and light - background styles. - . It can have the same appearance in [cterm] as in [gui]. - . It is designed with gentle color to minimize fatigue of eye. - . It also works with other color schemes. - . Default foreground and background can easily be changed, it is more - configurable than most other color schemes - . Works with the optional tool reloaded.vim, can change the whole - color scheme in Hue,Saturation,Luminance color space. - - Design Concern ~ - - At the first glance this color scheme may look pretty 'dull', don't be - afraid, this is quite normal. Bear in mind that a text editor is not - a photo album, if a text editor looks exciting you may not be able to - stare at it for a long time. - - Predefined Vim Syntax highlighting can be too colorful or contrasty so - that many programmers prefer to switch off the syntax highlighting at - work. That is not a good idea because you will lost the advantages of - syntax high-lighting. It is often the case that we have to work for - 300+ minutes, then I decide to do-it-myself. - - Many user-defined color schemes in vim.sf.net tend to achieve low - contrast by having a strong color-cast, i.e. looks blueish or - yellowish or reddish. This does look comfortable at first, however, - any type of color-cast will cause the eyes less sensitive for - particular color after a long-time work session, and that's no good to - health. - - Efforts had been made to ensure no color-cast for this scheme, all - elementary colors like RGB and CYMK are evenly used. Like TeX, - 'consistency' is the principle this color scheme based on. Default - values which hurt consistency are amended according to the vim script - syntax/hitest.vim - - There are 3 parameters to describe a color: Hue, Saturation and - Brightness. In this color scheme, the saturation is low and the - brightness are designed to be very close to each other in order not to - fatigue our eyes after a whole day's programming work. - - Portability ~ - - Different monitor settings led to different look. In this color - scheme, it is assumed that the monitor adjust at 6500k color - temperature with a good gamma curve. If you have a 9300k monitor or - if the gamma curve is not optimal, the appearance may be less - comfortable, use adobe gamma loader or similar tools to adjust - your monitor if your monitor do not have the option to change color - temperature and/or gamma curve. - - Needless to say, VI is an editor originally designed to do edit tasks - in a text terminal, and VIM is an improved version of VI. Its a shame - that a color scheme cannot have a satisfactory appearance in cterm. - The cterm compatibility should be considered high priority when - designing ViM color scheme. - - I had made much attempt to make support for 8-color terminals, - however, 8 colors is not enough to represent a color scheme. Finally - I end up making the cterm support for 16-color terminal. Have to say - sorry if the color scheme sucks in your 8-color terminal, I had tried - my best. More details about cterm please see |psc-cterm|. - - *psc-about-background* - About the Background ~ - - We have talked about off-white backgrounds, any background which is - not black, grey or white should be changed constantly in order not to - make the eyes less sensitive to particular color. i.e. you can use - blue background on Monday, red background on Tuesday, green background - on Wednesday, but if you use blue background everyday, that's no good - to your health. - - Now we talk about the brightness of the background. Why dark - background is preferred over others? There are many reasons, such as, - the monitor emits lower radiation for black background. You may have - lots of similar reasons... - - But I'll talk about something you may not know: -> - It is easier to distinguish foreground colors on a dark background - than on a light background. - - At the same time, it is easier to distinguish background colors on - a light background than on a dark background. - - We will mainly change foreground colors for syntax highlighting. -< - Hence, we can reduce the contrast and saturation of the color in - a dark-background scheme, while retain the readability. Schemes with - white background usually comes with higher contrast and saturation. - This is probably the most important reason that the color scheme is - designed to be dark-background instead of light one. - - Now we came to know, that change the foreground color is enough to - emphasis text in a dark background, while for a white background, we - need to change the font shape (bold or italic, etc.), or change the - background color to effectively emphasis the text. This is probably - the reason Vim default scheme has bold properties for highlighting - groups, because the default scheme is a light background one. - - No one knows what color scheme is best for you, except yourself. Try! - -============================================================================== -PSC INSTALLATION *psc-usage* - - Step 1, Enable the color scheme ~ - - To use PSC is simple, just put ps_color.vim into your - [runtimepath]/colors and append the line > - - colorscheme ps_color -< - to your |.vimrc|. The [runtimepath] can be any directory listed in - |vimfiles|, normally your $HOME/.vim in Unix or $HOME/vimfiles in - Windows. - - Step 2, Install the help document ~ - - The help document will be automatically installed when the colorscheme - be sourced the first time. If it is not, type :colo ps_color now. - - After successfully installed the help document, you can use > - - :help psc-options -< - to go to the following section. - -============================================================================== -PSC OPTIONS *psc-options* - - You can let these options in your ~/.vimrc, most options works for - both GUI and cterm, only some of them do not work for both. - - Options set using the 'let' command must present [BEFORE] the color - scheme been sourced. - - *psc_style* - Style ~ -> - let psc_style='cool' - let psc_style='warm' - let psc_style='default' - let psc_style='defdark' -< - This selects between styles of colors, - The 'cool' is the default, dark background. - The 'warm' is the alternative, light background scheme. - - See |psc-about-background| for more knowledge about the background, - and the differences of two style. - - The 'default' and 'defdark' refers to Vim system default color scheme. - Which are provided only for reference. - - Let psc_style to any string other than the above 4 will switch to the - specified color scheme. For example, let psc_style='desert' and then - activate the ps_color, the color scheme will be chosen according to - desert.vim color scheme. - - *psc_cterm_style* - Color Term Style ~ -> - let psc_cterm_style='cool' -< - This is exactly the same to psc_style, except that it only affects the - console version of vim in a color terminal, the 'warm' is not - available for cterm. - By default, it will be set to the same value as 'psc_style'. You can - change it if you want different style in cterm from gui. - - - *psc_fontface* - Font face ~ -> - let psc_fontface='plain' - let psc_fontface='mixed' -< - The Vim default behavior is the 'mixed', however, the mixed font style - in a dark colorscheme is not optimal. This color uses 'plain' for - 'cool' style, i.e. No texts are bolded font. For 'warm', the default - is still 'mixed', If you want the mixed style in which the highlighted - statements are bolded font, choose this. If you want all texts be - bolded, choose 'plain' and specify a bolded guifont or terminal font. - - In GUI, this option also works for other color schemes. You can - disable the bold font and use your favorite color scheme. See - |psc-faq-ffothers| for detail. - - *psc_inversed_todo* - Inversed Todo ~ -> - let psc_inversed_todo=1 -< - When set to 1, the TODO group will be dark background with light font, - Otherwise, the TODO group have light background with dark foreground. - Default is 0. - - *psc_use_default_for_cterm* - Use default for cterm (obsoleted)~ - - This option is Obsoleted, retained only for backward compatibility, - see |psc_cterm_style| for alternative. - - *psc_statement_different_from_type* - Statement different from type ~ -> - let psc_statement_different_from_type=1 -< - The Statement-group and Type-group are easy to distinguish, different - color for them are not necessary, I use similar color for S-group - & T-group in order not to make the screen too 'colorful', also this - saves a color name for cterm. But if you do want the Statement & Type - to be different color, try 'let statement_different_from_type=1' in - your .vimrc file, which is available only for GUI. Since the color - names in cterm is limited to 16 we cannot have too many different - colors in cterm. - Default is 0, i.e. they have very similar color. - - *psc-change-background* - Changing the Background color ~ - - You may prefer a black background over the dark one, and it is - possible to customize it, this may make life more interesting. To do - this is quite straight forward for GUI, just define the Normal - highlight in your .gvimrc, [AFTER] the color scheme has been sourced. - - For example: -> - highlight Normal guibg=#000000 -< - The #103040 will give a taste similar to oceandeep, #152535 for - hhazure, #303030 for desert, #404040 for zenburn... Replace #103040 - with any color you like. You can do the same to guifg foreground if - you are careful enough, remember this is only possible for GUI. - - You can do this to the NonText group also, for example. -> - highlight NonText guibg=#202020 -< - will give you a taste similar to most color schemes on vim.sf.net, in - which the NonText has a different background than Normal text. - However, this is only useful in GUI, in cterm, there are only - 8 background colors, so it is wise not to have a different color. - - If you want more variations, please try the optional utility - reloaded.vim, this optional utility provides an amazing level of - customization. - - Quick switching between warm and cold styles ~ - - Here is an example to define hot key of different style switching, - note that I had only given this example without actually define it. - You can choose to define it in .vimrc or anyway you prefer. -> - nnoremap <Leader>pc :let psc_style='cool'<CR>:colo ps_color<CR> - nnoremap <Leader>pw :let psc_style='warm'<CR>:colo ps_color<CR> -< - Alternatively, you can use the capitalized :Colo command, like - :Colo cool or :Colo warm - -============================================================================== -PSC WITH CTERM *psc-cterm* - - Colour Term ~ - - The cterm color is designed mainly in these terminals: -> - 1. Cygwin bash shell in NT command prompt box - 2. XTERM and RXVT - 3. Other color terminals which have at least 16 colors -< - *psc-cterm-nt* - In Windows NT Prompt console you can change the exact value of each - color, so you can have the same color with your GUI version of Vim, - for 'cool' color style you just change the color according to the - |psc-cterm-color-table|, for how to redefine the color of Windows NT - prompt console please see Windows Help. - - NT Cygwin bash shell console supports 16 foreground colors by add bold - attribute to 8 color, the cterm=bold specifies which should be bright - color, so totally the 16 color foreground is available, but color - name DarkXXX and LightXXX are the same. - - The pre-configured Cygwin.lnk is available for download on my web page - for Vim, but the site seems down, and the my site would not be on - recently, you may need to change colors in the Properties menu... - - Cygwin is highly recommended for Vim user if you are using Windows NT - based systems (e.g. NT 4.0, Win2k, WinXP, Win2003, etc). But Cygwin is - not that versatile under Windows 95/98/ME. I'm not sure whether this - works for DOS DJGPP or Windows 95 console version of Vim because - I don't have the system, in case you encountered problem please - contact me, if you like. - - *psc-cterm-xterm* - XTERM is a much more feature-rich terminal than Windows Console so the - support is much better, add the following recommend line into your - .Xdefaults and you can achieve the same color as in GUI version. - - Add the following into your .Xdefaults: - This works for XTERM and RXVT. -> - XTerm*color0: #000000 - XTerm*color1: #800000 - XTerm*color2: #008000 - XTerm*color3: #d0d090 - XTerm*color4: #000080 - XTerm*color5: #800080 - XTerm*color6: #a6caf0 - XTerm*color7: #d0d0d0 - XTerm*color8: #b0b0b0 - XTerm*color9: #f08060 - XTerm*color10: #60f080 - XTerm*color11: #e0c060 - XTerm*color12: #80c0e0 - XTerm*color13: #f0c0f0 - XTerm*color14: #c0d8f8 - XTerm*color15: #e0e0e0 - XTerm*cursorColor: #00f000 - - ! The following are recommended but optional - XTerm*reverseVideo: False - XTerm*background: #000000 - XTerm*foreground: #d0d0d0 - XTerm*boldMode: False -< - There is an assumption that your RXVT or XTERM supports 16 colors, - most RXVTs and XTERMs support this, if yours do not, get a source of - RXVT and recompile it. - - Sometimes the color mode are not recognized well, or you do not want - bright foreground be bolded. If this is the case, add the following in - your .vimrc (before the color scheme been sourced) -> - if &term=='xterm' " Change 'xterm' to your term name if necessary - set t_Co=16 - endif -< - If the t_Co=16 have problem, set t_Co=8 and :colo ps_color again. - vice versa. - - My rxvt works well with t_Co=16: > - Rxvt v2.7.10 - released: 26 MARCH 2003 - Options: - XPM,transparent,utmp,menubar,frills,linespace,multichar_languages, - scrollbars=rxvt+NeXT+xterm,.Xdefaults -< But I've know that my rxvt v2.6.4 in another machine has problem with - t_Co=16, if that is the case, set t_Co=8 instead. - - *psc-cterm-others* - For other terminals, you can manually set the color according to the - following table - - Hints for Manually set the color (for 'cool' style only): - *psc-cterm-color-table* - Color name Hex value Decimal value ~ - 0 Black = #000000 0,0,0 - 4 DarkBlue = #000080 0,0,128 - 2 DarkGreen = #008000 0,128,0 - 6 DarkCyan = #a6caf0 166,202,240 - 1 DarkRed = #800000 128,0,0 - 5 DarkMagenta = #800080 128,0,128 - 3 DarkYellow = #d0d090 208,208,144 - 7 Grey = #d0d0d0 208,208,208 - 8 DarkGrey = #b0b0b0 176,176,176 - 12 Blue = #80c0e0 128,192,224 - 10 Green = #60f080 96,240,128 - 14 Cyan = #c0d8f8 192,216,248 - 9 Red = #f08060 240,128,96 - 13 LMag. = #f0c0f0 240,192,240 - 11 Yellow = #e0c060 224,192,96 - 15 White = #e0e0e0 224,224,224 - - *psc-cterm-incompatible* - If your color terminal does only have 8 colors and cannot achieve 16 - colors with cterm=bold, you may want to switch to other color schemes - to gain more readability. Anyway, you can specify in your .vimrc to - use different color scheme under different consoles and GUI. - For example: -> - let psc_cterm_style = 'foobarcolor' - let psc_style = 'cool' - colo ps_color -< - The 'foobarcolor' means the color scheme you want to choose, such as - 'desert', I recommend to try vim default schemes 'default' and - 'defdark' before experience others. - -============================================================================== -PSC FAQ AND TIPS *psc-faq* *psc-tips* -> - Q: What is meant by `PS' ? -< - A: PS means: PostScript, PhotoShop, PerSonal, ... or anything you can - imagine and anything you want it do be. -> - Q: How to obtain the same appreance as gui in color term? -< - A: This need some work around, see |psc-cterm| for details. - Generally speaking, you should ensure your color term has support - for 16 foreground colors, and each color is customizable. - - *psc-faq-ffothers* > - Q: How to use psc_fontface with other colorschemes? -< - A: Make sure you had sourced :colo ps_color in your .vimrc, then you - can use the Capitalized :Colo instead of :colo - e.g. you want to use 'murphy', just type :Colo murphy after you - sourced the ps_color, the 'defdark', 'cool', 'warm' can also be - used here. -> - Q: I updated from v2.0 to v2.3 or above, why the cterm color scheme - for Comment is different? -< - A: The color map of DarkYellow and Yellow have been exchanged, - You need to reconfigure your terminal to meet the change, - see |psc-cterm-color-table| for guide, or if you are using xterm - compatible terminal, just update the .XDefaults according to - |psc-cterm-xterm|. -> - Q: What do you mean by 'Vanilla Windows'? -< - A: People often argue that Windows is not a REAL operating system. - Well, I agree this, but only for vanilla windows. i.e. with no - plug-ins installed. Vanilla windows is a very limited platform, - since it is not POSIX compliant. - - There are currently many working around to make Windows POSIX - Compliant, do you still mind which OS to use when it is POSIX - Compliant? I don't. If you installed Cygwin kernel in your - NT-based Windows, the Windows will be more or less POSIX compliant - and you can use it in the same way as you use any Unix, BSD, - Solaris, Linux, XWindow, etc... What is more, Cygwin is not the - only kernel which makes Windows POSIX Compliant, make a google - search and you will find many alternatives. -> - Q: How to change the Normal background color? Why don't you use - different background for NonText group? -< - A: This is for compatibility, since we have to use only 8 colors as - background in a color terminal. For GUI you can change this, see - |psc-change-background| for details. -> - Q: I updated from 2.81- to 2.82+, why the default background changed? -< - A: This is for Bram's guideline, that dark schemes with black - background has too much contrast. - - However, you can change it back. see |psc-change-background| for - details. - -============================================================================== -PSC RELEASE NOTES *psc-release-notes* - - 2.90 Release Note: ~ - - Upon the release of Vim 7, many new highlight groups have been added. - - A style has been tuned a little to increase contrast. - - - 2.83 Release Note: ~ - - This is an identical version, but my e-mail address changed. - - - 2.82 Release Note: ~ - - Fixed bug with the reversed group for the Vim default, or other - schemes. - - Fixed bug with the Diff mode fg mistaken as fg. - - Shrink the script a lot to improve load performance, moved the release - notes into document. - - Change the default gui background color to #202020 (Dark Grey) - - - 2.81 Release Note: ~ - - Provided a separate utility reloaded.vim to fine tune the GUI color - scheme based on Hue, Saturation and Brightness(Luminance). - - Added some groups to meet the need of reloaded.vim, no essential - change. - - 2.8 Release Note: ~ - - Bugfix : when psc_style=='mixed', the visual got reversed wrong. - - 'mixed' is now the default for 'warm' style. - - changed the function name to lower case. - - removed pre-2.0 compatibility, (the non-psc version of s-d-f-t). - - Added variable psc_cterm_style, see |psc_cterm_style| - - Added group Underline - - Tuned the function call. - - 2.7 Release Note: ~ - - Now it is possible to change the Background, - see :h psc-change-background for details. - - Linked the Tag group to Identifier. - - NonText as Notice is not good for 'warm', changed to Constant. - - Added links for the most popular plugins: taglist, calendar - - Tuned the 'Statement' color when different from Type (gui only). - - Re-adjusted cterm scheme according to syntax/hitest.vim - - The 'defdark' style for cterm is not functioning, fixed. - - Many 'cosmetic' changes, makes no difference for functionality. - - Use of DrChip's help extractor to auto-install help document. - - Added command define, :Colo - - 2.6 Release Note: ~ - - As stated in the v2.3, the only 'todo' thing seems to be the 'warm' - style, now in this version I had been working on it. - - There also are some minor fixes for the document, to be more friendly - for new readers. - - The 'StatusLine' of 'cold' style is modified by mistake in the v2.3, - this time the bug is fixed. - - The 'Directory' in GUI 'cold' style is different from 'cterm' one, - now fixed. - - 2.3 Release Note: ~ - - This is an incompatible update, main changes are in 'cterm'. - A new group 'SignColumn' had been added, new links added for engspchk - v52, hundreds of typos fixed in the document, thanks to the engspchk. - - The support for 8-color cterm is slightly better now, but the mappings - of the DarkYellow and Yellow are exchanged, you need to update the - .Xdefaults or your terminal configuration before apply this update if - you are using v2.0. Guide for redefinition the color value is - available in the document, make sure you had updated the ps_color.txt, - then see |psc-cterm-color-table| - - 2.0 Release Note: ~ - - There've been great enhancement since this version, so I'd choose to - bump the version number to 2. This version comes with Vim online help, - if you had installed ps_color.txt, you can see for details in - |pscolor| - - n/a Release: ~ - - Initial upload, can be called as v1.8 - - -============================================================================== -PSC TODO LIST *psc-todo* - - . Fix the remain bugs. - . Follow the new Vim versions for new added highlighting group - . This cannot work in Vim Tiny mode, and will never work! - -============================================================================== - -vim:tw=78:ts=8:noet:ft=help:fo+=t:norl:noet: diff --git a/.vim/doc/snipMate.txt b/.vim/doc/snipMate.txt deleted file mode 100644 index 704d44a..0000000 --- a/.vim/doc/snipMate.txt +++ /dev/null @@ -1,286 +0,0 @@ -*snipMate.txt* Plugin for using TextMate-style snippets in Vim. - -snipMate *snippet* *snippets* *snipMate* -Last Change: July 13, 2009 - -|snipMate-description| Description -|snipMate-syntax| Snippet syntax -|snipMate-usage| Usage -|snipMate-settings| Settings -|snipMate-features| Features -|snipMate-disadvantages| Disadvantages to TextMate -|snipMate-contact| Contact - -For Vim version 7.0 or later. -This plugin only works if 'compatible' is not set. -{Vi does not have any of these features.} - -============================================================================== -DESCRIPTION *snipMate-description* - -snipMate.vim implements some of TextMate's snippets features in Vim. A -snippet is a piece of often-typed text that you can insert into your -document using a trigger word followed by a <tab>. - -For instance, in a C file using the default installation of snipMate.vim, if -you type "for<tab>" in insert mode, it will expand a typical for loop in C: > - - for (i = 0; i < count; i++) { - - } - - -To go to the next item in the loop, simply <tab> over to it; if there is -repeated code, such as the "i" variable in this example, you can simply -start typing once it's highlighted and all the matches specified in the -snippet will be updated. To go in reverse, use <shift-tab>. - -============================================================================== -SYNTAX *snippet-syntax* - -Snippets can be defined in two ways. They can be in their own file, named -after their trigger in 'snippets/<filetype>/<trigger>.snippet', or they can be -defined together in a 'snippets/<filetype>.snippets' file. Note that dotted -'filetype' syntax is supported -- e.g., you can use > - - :set ft=html.eruby - -to activate snippets for both HTML and eRuby for the current file. - -The syntax for snippets in *.snippets files is the following: > - - snippet trigger - expanded text - more expanded text - -Note that the first hard tab after the snippet trigger is required, and not -expanded in the actual snippet. The syntax for *.snippet files is the same, -only without the trigger declaration and starting indentation. - -Also note that snippets must be defined using hard tabs. They can be expanded -to spaces later if desired (see |snipMate-indenting|). - -"#" is used as a line-comment character in *.snippets files; however, they can -only be used outside of a snippet declaration. E.g.: > - - # this is a correct comment - snippet trigger - expanded text - snippet another_trigger - # this isn't a comment! - expanded text -< -This should hopefully be obvious with the included syntax highlighting. - - *snipMate-${#}* -Tab stops ~ - -By default, the cursor is placed at the end of a snippet. To specify where the -cursor is to be placed next, use "${#}", where the # is the number of the tab -stop. E.g., to place the cursor first on the id of a <div> tag, and then allow -the user to press <tab> to go to the middle of it: - > - snippet div - <div id="${1}"> - ${2} - </div> -< - *snipMate-placeholders* *snipMate-${#:}* *snipMate-$#* -Placeholders ~ - -Placeholder text can be supplied using "${#:text}", where # is the number of -the tab stop. This text then can be copied throughout the snippet using "$#", -given # is the same number as used before. So, to make a C for loop: > - - snippet for - for (${2:i}; $2 < ${1:count}; $1++) { - ${4} - } - -This will cause "count" to first be selected and change if the user starts -typing. When <tab> is pressed, the "i" in ${2}'s position will be selected; -all $2 variables will default to "i" and automatically be updated if the user -starts typing. -NOTE: "$#" syntax is used only for variables, not for tab stops as in TextMate. - -Variables within variables are also possible. For instance: > - - snippet opt - <option value="${1:option}">${2:$1}</option> - -Will, as usual, cause "option" to first be selected and update all the $1 -variables if the user starts typing. Since one of these variables is inside of -${2}, this text will then be used as a placeholder for the next tab stop, -allowing the user to change it if he wishes. - -To copy a value throughout a snippet without supplying default text, simply -use the "${#:}" construct without the text; e.g.: > - - snippet foo - ${1:}bar$1 -< *snipMate-commands* -Interpolated Vim Script ~ - -Snippets can also contain Vim script commands that are executed (via |eval()|) -when the snippet is inserted. Commands are given inside backticks (`...`); for -TextMates's functionality, use the |system()| function. E.g.: > - - snippet date - `system("date +%Y-%m-%d")` - -will insert the current date, assuming you are on a Unix system. Note that you -can also (and should) use |strftime()| for this example. - -Filename([{expr}] [, {defaultText}]) *snipMate-filename* *Filename()* - -Since the current filename is used often in snippets, a default function -has been defined for it in snipMate.vim, appropriately called Filename(). - -With no arguments, the default filename without an extension is returned; -the first argument specifies what to place before or after the filename, -and the second argument supplies the default text to be used if the file -has not been named. "$1" in the first argument is replaced with the filename; -if you only want the filename to be returned, the first argument can be left -blank. Examples: > - - snippet filename - `Filename()` - snippet filename_with_default - `Filename('', 'name')` - snippet filename_foo - `filename('$1_foo')` - -The first example returns the filename if it the file has been named, and an -empty string if it hasn't. The second returns the filename if it's been named, -and "name" if it hasn't. The third returns the filename followed by "_foo" if -it has been named, and an empty string if it hasn't. - - *multi_snip* -To specify that a snippet can have multiple matches in a *.snippets file, use -this syntax: > - - snippet trigger A description of snippet #1 - expand this text - snippet trigger A description of snippet #2 - expand THIS text! - -In this example, when "trigger<tab>" is typed, a numbered menu containing all -of the descriptions of the "trigger" will be shown; when the user presses the -corresponding number, that snippet will then be expanded. - -To create a snippet with multiple matches using *.snippet files, -simply place all the snippets in a subdirectory with the trigger name: -'snippets/<filetype>/<trigger>/<name>.snippet'. - -============================================================================== -USAGE *snipMate-usage* - - *'snippets'* *g:snippets_dir* -Snippets are by default looked for any 'snippets' directory in your -'runtimepath'. Typically, it is located at '~/.vim/snippets/' on *nix or -'$HOME\vimfiles\snippets\' on Windows. To change that location or add another -one, change the g:snippets_dir variable in your |.vimrc| to your preferred -directory, or use the |ExtractSnips()|function. This will be used by the -|globpath()| function, and so accepts the same syntax as it (e.g., -comma-separated paths). - -ExtractSnipsFile({directory}, {filetype}) *ExtractSnipsFile()* *.snippets* - -ExtractSnipsFile() extracts the specified *.snippets file for the given -filetype. A .snippets file contains multiple snippet declarations for the -filetype. It is further explained above, in |snippet-syntax|. - -ExtractSnips({directory}, {filetype}) *ExtractSnips()* *.snippet* - -ExtractSnips() extracts *.snippet files from the specified directory and -defines them as snippets for the given filetype. The directory tree should -look like this: 'snippets/<filetype>/<trigger>.snippet'. If the snippet has -multiple matches, it should look like this: -'snippets/<filetype>/<trigger>/<name>.snippet' (see |multi_snip|). - - *ResetSnippets()* -The ResetSnippets() function removes all snippets from memory. This is useful -to put at the top of a snippet setup file for if you would like to |:source| -it multiple times. - - *list-snippets* *i_CTRL-R_<Tab>* -If you would like to see what snippets are available, simply type <c-r><tab> -in the current buffer to show a list via |popupmenu-completion|. - -============================================================================== -SETTINGS *snipMate-settings* *g:snips_author* - -The g:snips_author string (similar to $TM_FULLNAME in TextMate) should be set -to your name; it can then be used in snippets to automatically add it. E.g.: > - - let g:snips_author = 'Hubert Farnsworth' - snippet name - `g:snips_author` -< - *snipMate-expandtab* *snipMate-indenting* -If you would like your snippets to be expanded using spaces instead of tabs, -just enable 'expandtab' and set 'softtabstop' to your preferred amount of -spaces. If 'softtabstop' is not set, 'shiftwidth' is used instead. - - *snipMate-remap* -snipMate does not come with a setting to customize the trigger key, but you -can remap it easily in the two lines it's defined in the 'after' directory -under 'plugin/snipMate.vim'. For instance, to change the trigger key -to CTRL-J, just change this: > - - ino <tab> <c-r>=TriggerSnippet()<cr> - snor <tab> <esc>i<right><c-r>=TriggerSnippet()<cr> - -to this: > - ino <c-j> <c-r>=TriggerSnippet()<cr> - snor <c-j> <esc>i<right><c-r>=TriggerSnippet()<cr> - -============================================================================== -FEATURES *snipMate-features* - -snipMate.vim has the following features among others: - - The syntax of snippets is very similar to TextMate's, allowing - easy conversion. - - The position of the snippet is kept transparently (i.e. it does not use - markers/placeholders written to the buffer), which allows you to escape - out of an incomplete snippet, something particularly useful in Vim. - - Variables in snippets are updated as-you-type. - - Snippets can have multiple matches. - - Snippets can be out of order. For instance, in a do...while loop, the - condition can be added before the code. - - [New] File-based snippets are supported. - - [New] Triggers after non-word delimiters are expanded, e.g. "foo" - in "bar.foo". - - [New] <shift-tab> can now be used to jump tab stops in reverse order. - -============================================================================== -DISADVANTAGES *snipMate-disadvantages* - -snipMate.vim currently has the following disadvantages to TextMate's snippets: - - There is no $0; the order of tab stops must be explicitly stated. - - Placeholders within placeholders are not possible. E.g.: > - - '<div${1: id="${2:some_id}}">${3}</div>' -< - In TextMate this would first highlight ' id="some_id"', and if - you hit delete it would automatically skip ${2} and go to ${3} - on the next <tab>, but if you didn't delete it it would highlight - "some_id" first. You cannot do this in snipMate.vim. - - Regex cannot be performed on variables, such as "${1/.*/\U&}" - - Placeholders cannot span multiple lines. - - Activating snippets in different scopes of the same file is - not possible. - -Perhaps some of these features will be added in a later release. - -============================================================================== -CONTACT *snipMate-contact* *snipMate-author* - -To contact the author (Michael Sanders), please email: - msanders42+snipmate <at> gmail <dot> com - -I greatly appreciate any suggestions or improvements offered for the script. - -============================================================================== - -vim:tw=78:ts=8:ft=help:norl: diff --git a/.vim/doc/tags b/.vim/doc/tags deleted file mode 100644 index 5ee54bc..0000000 --- a/.vim/doc/tags +++ /dev/null @@ -1,354 +0,0 @@ -'NERDChristmasTree' NERD_tree.txt /*'NERDChristmasTree'* -'NERDTreeAutoCenter' NERD_tree.txt /*'NERDTreeAutoCenter'* -'NERDTreeAutoCenterThreshold' NERD_tree.txt /*'NERDTreeAutoCenterThreshold'* -'NERDTreeBookmarksFile' NERD_tree.txt /*'NERDTreeBookmarksFile'* -'NERDTreeCaseSensitiveSort' NERD_tree.txt /*'NERDTreeCaseSensitiveSort'* -'NERDTreeChDirMode' NERD_tree.txt /*'NERDTreeChDirMode'* -'NERDTreeHighlightCursorline' NERD_tree.txt /*'NERDTreeHighlightCursorline'* -'NERDTreeHijackNetrw' NERD_tree.txt /*'NERDTreeHijackNetrw'* -'NERDTreeIgnore' NERD_tree.txt /*'NERDTreeIgnore'* -'NERDTreeMouseMode' NERD_tree.txt /*'NERDTreeMouseMode'* -'NERDTreeQuitOnOpen' NERD_tree.txt /*'NERDTreeQuitOnOpen'* -'NERDTreeShowBookmarks' NERD_tree.txt /*'NERDTreeShowBookmarks'* -'NERDTreeShowFiles' NERD_tree.txt /*'NERDTreeShowFiles'* -'NERDTreeShowHidden' NERD_tree.txt /*'NERDTreeShowHidden'* -'NERDTreeShowLineNumbers' NERD_tree.txt /*'NERDTreeShowLineNumbers'* -'NERDTreeSortOrder' NERD_tree.txt /*'NERDTreeSortOrder'* -'NERDTreeStatusline' NERD_tree.txt /*'NERDTreeStatusline'* -'NERDTreeWinPos' NERD_tree.txt /*'NERDTreeWinPos'* -'NERDTreeWinSize' NERD_tree.txt /*'NERDTreeWinSize'* -'loaded_nerd_tree' NERD_tree.txt /*'loaded_nerd_tree'* -'snippets' snipMate.txt /*'snippets'* -.snippet snipMate.txt /*.snippet* -.snippets snipMate.txt /*.snippets* -:BuildMethods cocoa.txt /*:BuildMethods* -:CVSEdit vcscommand.txt /*:CVSEdit* -:CVSEditors vcscommand.txt /*:CVSEditors* -:CVSUnedit vcscommand.txt /*:CVSUnedit* -:CVSWatch vcscommand.txt /*:CVSWatch* -:CVSWatchAdd vcscommand.txt /*:CVSWatchAdd* -:CVSWatchOff vcscommand.txt /*:CVSWatchOff* -:CVSWatchOn vcscommand.txt /*:CVSWatchOn* -:CVSWatchRemove vcscommand.txt /*:CVSWatchRemove* -:CVSWatchers vcscommand.txt /*:CVSWatchers* -:ListMethods cocoa.txt /*:ListMethods* -:MatchDebug matchit.txt /*:MatchDebug* -:NERDTree NERD_tree.txt /*:NERDTree* -:NERDTreeClose NERD_tree.txt /*:NERDTreeClose* -:NERDTreeFromBookmark NERD_tree.txt /*:NERDTreeFromBookmark* -:NERDTreeMirror NERD_tree.txt /*:NERDTreeMirror* -:NERDTreeToggle NERD_tree.txt /*:NERDTreeToggle* -:VCSAdd vcscommand.txt /*:VCSAdd* -:VCSAnnotate vcscommand.txt /*:VCSAnnotate* -:VCSBlame vcscommand.txt /*:VCSBlame* -:VCSCommit vcscommand.txt /*:VCSCommit* -:VCSDelete vcscommand.txt /*:VCSDelete* -:VCSDiff vcscommand.txt /*:VCSDiff* -:VCSGotoOriginal vcscommand.txt /*:VCSGotoOriginal* -:VCSInfo vcscommand.txt /*:VCSInfo* -:VCSLock vcscommand.txt /*:VCSLock* -:VCSLog vcscommand.txt /*:VCSLog* -:VCSRemove vcscommand.txt /*:VCSRemove* -:VCSRevert vcscommand.txt /*:VCSRevert* -:VCSReview vcscommand.txt /*:VCSReview* -:VCSStatus vcscommand.txt /*:VCSStatus* -:VCSUnlock vcscommand.txt /*:VCSUnlock* -:VCSUpdate vcscommand.txt /*:VCSUpdate* -:VCSVimDiff vcscommand.txt /*:VCSVimDiff* -ExtractSnips() snipMate.txt /*ExtractSnips()* -ExtractSnipsFile() snipMate.txt /*ExtractSnipsFile()* -Filename() snipMate.txt /*Filename()* -MatchError matchit.txt /*MatchError* -NERDTree NERD_tree.txt /*NERDTree* -NERDTree-! NERD_tree.txt /*NERDTree-!* -NERDTree-? NERD_tree.txt /*NERDTree-?* -NERDTree-B NERD_tree.txt /*NERDTree-B* -NERDTree-C NERD_tree.txt /*NERDTree-C* -NERDTree-D NERD_tree.txt /*NERDTree-D* -NERDTree-F NERD_tree.txt /*NERDTree-F* -NERDTree-I NERD_tree.txt /*NERDTree-I* -NERDTree-J NERD_tree.txt /*NERDTree-J* -NERDTree-K NERD_tree.txt /*NERDTree-K* -NERDTree-O NERD_tree.txt /*NERDTree-O* -NERDTree-P NERD_tree.txt /*NERDTree-P* -NERDTree-R NERD_tree.txt /*NERDTree-R* -NERDTree-T NERD_tree.txt /*NERDTree-T* -NERDTree-U NERD_tree.txt /*NERDTree-U* -NERDTree-X NERD_tree.txt /*NERDTree-X* -NERDTree-c-j NERD_tree.txt /*NERDTree-c-j* -NERDTree-c-k NERD_tree.txt /*NERDTree-c-k* -NERDTree-contents NERD_tree.txt /*NERDTree-contents* -NERDTree-e NERD_tree.txt /*NERDTree-e* -NERDTree-f NERD_tree.txt /*NERDTree-f* -NERDTree-gi NERD_tree.txt /*NERDTree-gi* -NERDTree-go NERD_tree.txt /*NERDTree-go* -NERDTree-gs NERD_tree.txt /*NERDTree-gs* -NERDTree-i NERD_tree.txt /*NERDTree-i* -NERDTree-m NERD_tree.txt /*NERDTree-m* -NERDTree-o NERD_tree.txt /*NERDTree-o* -NERDTree-p NERD_tree.txt /*NERDTree-p* -NERDTree-q NERD_tree.txt /*NERDTree-q* -NERDTree-r NERD_tree.txt /*NERDTree-r* -NERDTree-s NERD_tree.txt /*NERDTree-s* -NERDTree-t NERD_tree.txt /*NERDTree-t* -NERDTree-u NERD_tree.txt /*NERDTree-u* -NERDTree-x NERD_tree.txt /*NERDTree-x* -NERDTreeAbout NERD_tree.txt /*NERDTreeAbout* -NERDTreeBookmarkCommands NERD_tree.txt /*NERDTreeBookmarkCommands* -NERDTreeBookmarkTable NERD_tree.txt /*NERDTreeBookmarkTable* -NERDTreeBookmarks NERD_tree.txt /*NERDTreeBookmarks* -NERDTreeChangelog NERD_tree.txt /*NERDTreeChangelog* -NERDTreeCredits NERD_tree.txt /*NERDTreeCredits* -NERDTreeFilesysMenu NERD_tree.txt /*NERDTreeFilesysMenu* -NERDTreeFunctionality NERD_tree.txt /*NERDTreeFunctionality* -NERDTreeGlobalCommands NERD_tree.txt /*NERDTreeGlobalCommands* -NERDTreeHacking NERD_tree.txt /*NERDTreeHacking* -NERDTreeInvalidBookmarks NERD_tree.txt /*NERDTreeInvalidBookmarks* -NERDTreeLicense NERD_tree.txt /*NERDTreeLicense* -NERDTreeMappings NERD_tree.txt /*NERDTreeMappings* -NERDTreeOptionDetails NERD_tree.txt /*NERDTreeOptionDetails* -NERDTreeOptionSummary NERD_tree.txt /*NERDTreeOptionSummary* -NERDTreeOptions NERD_tree.txt /*NERDTreeOptions* -NERD_tree.txt NERD_tree.txt /*NERD_tree.txt* -ResetSnippets() snipMate.txt /*ResetSnippets()* -VCSCommandCVSDiffOpt vcscommand.txt /*VCSCommandCVSDiffOpt* -VCSCommandCVSExec vcscommand.txt /*VCSCommandCVSExec* -VCSCommandCommitOnWrite vcscommand.txt /*VCSCommandCommitOnWrite* -VCSCommandDeleteOnHide vcscommand.txt /*VCSCommandDeleteOnHide* -VCSCommandDiffSplit vcscommand.txt /*VCSCommandDiffSplit* -VCSCommandDisableAll vcscommand.txt /*VCSCommandDisableAll* -VCSCommandDisableExtensionMappings vcscommand.txt /*VCSCommandDisableExtensionMappings* -VCSCommandDisableMappings vcscommand.txt /*VCSCommandDisableMappings* -VCSCommandEdit vcscommand.txt /*VCSCommandEdit* -VCSCommandEnableBufferSetup vcscommand.txt /*VCSCommandEnableBufferSetup* -VCSCommandMapPrefix vcscommand.txt /*VCSCommandMapPrefix* -VCSCommandMappings vcscommand.txt /*VCSCommandMappings* -VCSCommandResultBufferNameExtension vcscommand.txt /*VCSCommandResultBufferNameExtension* -VCSCommandResultBufferNameFunction vcscommand.txt /*VCSCommandResultBufferNameFunction* -VCSCommandSVKExec vcscommand.txt /*VCSCommandSVKExec* -VCSCommandSVNDiffExt vcscommand.txt /*VCSCommandSVNDiffExt* -VCSCommandSVNDiffOpt vcscommand.txt /*VCSCommandSVNDiffOpt* -VCSCommandSVNExec vcscommand.txt /*VCSCommandSVNExec* -VCSCommandSplit vcscommand.txt /*VCSCommandSplit* -VCSCommandVCSTypeOverride vcscommand.txt /*VCSCommandVCSTypeOverride* -[% matchit.txt /*[%* -]% matchit.txt /*]%* -b:VCSCommandCommand vcscommand.txt /*b:VCSCommandCommand* -b:VCSCommandOriginalBuffer vcscommand.txt /*b:VCSCommandOriginalBuffer* -b:VCSCommandSourceFile vcscommand.txt /*b:VCSCommandSourceFile* -b:VCSCommandVCSType vcscommand.txt /*b:VCSCommandVCSType* -b:match_col matchit.txt /*b:match_col* -b:match_debug matchit.txt /*b:match_debug* -b:match_ignorecase matchit.txt /*b:match_ignorecase* -b:match_ini matchit.txt /*b:match_ini* -b:match_iniBR matchit.txt /*b:match_iniBR* -b:match_match matchit.txt /*b:match_match* -b:match_pat matchit.txt /*b:match_pat* -b:match_skip matchit.txt /*b:match_skip* -b:match_table matchit.txt /*b:match_table* -b:match_tail matchit.txt /*b:match_tail* -b:match_wholeBR matchit.txt /*b:match_wholeBR* -b:match_word matchit.txt /*b:match_word* -b:match_words matchit.txt /*b:match_words* -bufexplorer bufexplorer.txt /*bufexplorer* -bufexplorer-changelog bufexplorer.txt /*bufexplorer-changelog* -bufexplorer-credits bufexplorer.txt /*bufexplorer-credits* -bufexplorer-customization bufexplorer.txt /*bufexplorer-customization* -bufexplorer-installation bufexplorer.txt /*bufexplorer-installation* -bufexplorer-todo bufexplorer.txt /*bufexplorer-todo* -bufexplorer-usage bufexplorer.txt /*bufexplorer-usage* -bufexplorer.txt bufexplorer.txt /*bufexplorer.txt* -buffer-explorer bufexplorer.txt /*buffer-explorer* -cocoa cocoa.txt /*cocoa* -cocoa-author cocoa.txt /*cocoa-author* -cocoa-commands cocoa.txt /*cocoa-commands* -cocoa-completion cocoa.txt /*cocoa-completion* -cocoa-contact cocoa.txt /*cocoa-contact* -cocoa-features cocoa.txt /*cocoa-features* -cocoa-installation cocoa.txt /*cocoa-installation* -cocoa-intro cocoa.txt /*cocoa-intro* -cocoa-license cocoa.txt /*cocoa-license* -cocoa-mappings cocoa.txt /*cocoa-mappings* -cocoa-suggested-plugins cocoa.txt /*cocoa-suggested-plugins* -cocoa.txt cocoa.txt /*cocoa.txt* -cs surround.txt /*cs* -cvscommand-changes vcscommand.txt /*cvscommand-changes* -drawit DrawIt.txt /*drawit* -drawit-a DrawIt.txt /*drawit-a* -drawit-b DrawIt.txt /*drawit-b* -drawit-brush DrawIt.txt /*drawit-brush* -drawit-c DrawIt.txt /*drawit-c* -drawit-contents DrawIt.txt /*drawit-contents* -drawit-drawing DrawIt.txt /*drawit-drawing* -drawit-e DrawIt.txt /*drawit-e* -drawit-erase DrawIt.txt /*drawit-erase* -drawit-example DrawIt.txt /*drawit-example* -drawit-f DrawIt.txt /*drawit-f* -drawit-history DrawIt.txt /*drawit-history* -drawit-l DrawIt.txt /*drawit-l* -drawit-manual DrawIt.txt /*drawit-manual* -drawit-modes DrawIt.txt /*drawit-modes* -drawit-move DrawIt.txt /*drawit-move* -drawit-moving DrawIt.txt /*drawit-moving* -drawit-options DrawIt.txt /*drawit-options* -drawit-protect DrawIt.txt /*drawit-protect* -drawit-s DrawIt.txt /*drawit-s* -drawit-setbrush DrawIt.txt /*drawit-setbrush* -drawit-setdrawit DrawIt.txt /*drawit-setdrawit* -drawit-start DrawIt.txt /*drawit-start* -drawit-stop DrawIt.txt /*drawit-stop* -drawit-usage DrawIt.txt /*drawit-usage* -drawit-visblock DrawIt.txt /*drawit-visblock* -drawit.txt DrawIt.txt /*drawit.txt* -ds surround.txt /*ds* -g% matchit.txt /*g%* -g:bufExplorerDefaultHelp bufexplorer.txt /*g:bufExplorerDefaultHelp* -g:bufExplorerDetailedHelp bufexplorer.txt /*g:bufExplorerDetailedHelp* -g:bufExplorerFindActive bufexplorer.txt /*g:bufExplorerFindActive* -g:bufExplorerReverseSort bufexplorer.txt /*g:bufExplorerReverseSort* -g:bufExplorerShowDirectories bufexplorer.txt /*g:bufExplorerShowDirectories* -g:bufExplorerShowRelativePath bufexplorer.txt /*g:bufExplorerShowRelativePath* -g:bufExplorerShowUnlisted bufexplorer.txt /*g:bufExplorerShowUnlisted* -g:bufExplorerSortBy bufexplorer.txt /*g:bufExplorerSortBy* -g:bufExplorerSplitBelow bufexplorer.txt /*g:bufExplorerSplitBelow* -g:bufExplorerSplitOutPathName bufexplorer.txt /*g:bufExplorerSplitOutPathName* -g:bufExplorerSplitRight bufexplorer.txt /*g:bufExplorerSplitRight* -g:drawit_insertmode DrawIt.txt /*g:drawit_insertmode* -g:objc_man_key cocoa.txt /*g:objc_man_key* -g:snippets_dir snipMate.txt /*g:snippets_dir* -g:snips_author snipMate.txt /*g:snips_author* -i_CTRL-G_S surround.txt /*i_CTRL-G_S* -i_CTRL-G_s surround.txt /*i_CTRL-G_s* -i_CTRL-R_<Tab> snipMate.txt /*i_CTRL-R_<Tab>* -leopard-security-alert cocoa.txt /*leopard-security-alert* -list-snippets snipMate.txt /*list-snippets* -matchit matchit.txt /*matchit* -matchit-% matchit.txt /*matchit-%* -matchit-\1 matchit.txt /*matchit-\\1* -matchit-activate matchit.txt /*matchit-activate* -matchit-backref matchit.txt /*matchit-backref* -matchit-bugs matchit.txt /*matchit-bugs* -matchit-choose matchit.txt /*matchit-choose* -matchit-configure matchit.txt /*matchit-configure* -matchit-debug matchit.txt /*matchit-debug* -matchit-details matchit.txt /*matchit-details* -matchit-highlight matchit.txt /*matchit-highlight* -matchit-hl matchit.txt /*matchit-hl* -matchit-intro matchit.txt /*matchit-intro* -matchit-languages matchit.txt /*matchit-languages* -matchit-modes matchit.txt /*matchit-modes* -matchit-newlang matchit.txt /*matchit-newlang* -matchit-o_% matchit.txt /*matchit-o_%* -matchit-parse matchit.txt /*matchit-parse* -matchit-s:notend matchit.txt /*matchit-s:notend* -matchit-s:sol matchit.txt /*matchit-s:sol* -matchit-spaces matchit.txt /*matchit-spaces* -matchit-troubleshoot matchit.txt /*matchit-troubleshoot* -matchit-v_% matchit.txt /*matchit-v_%* -matchit.txt matchit.txt /*matchit.txt* -matchit.vim matchit.txt /*matchit.vim* -multi_snip snipMate.txt /*multi_snip* -o_[% matchit.txt /*o_[%* -o_]% matchit.txt /*o_]%* -o_g% matchit.txt /*o_g%* -project project.txt /*project* -project-adding-mappings project.txt /*project-adding-mappings* -project-example project.txt /*project-example* -project-flags project.txt /*project-flags* -project-inheritance project.txt /*project-inheritance* -project-invoking project.txt /*project-invoking* -project-mappings project.txt /*project-mappings* -project-plugin project.txt /*project-plugin* -project-settings project.txt /*project-settings* -project-syntax project.txt /*project-syntax* -project-tips project.txt /*project-tips* -project.txt project.txt /*project.txt* -ps_color.txt ps_color.txt /*ps_color.txt* -ps_colour ps_color.txt /*ps_colour* -psc ps_color.txt /*psc* -psc-about-background ps_color.txt /*psc-about-background* -psc-change-background ps_color.txt /*psc-change-background* -psc-contents ps_color.txt /*psc-contents* -psc-cterm ps_color.txt /*psc-cterm* -psc-cterm-color-table ps_color.txt /*psc-cterm-color-table* -psc-cterm-incompatible ps_color.txt /*psc-cterm-incompatible* -psc-cterm-nt ps_color.txt /*psc-cterm-nt* -psc-cterm-others ps_color.txt /*psc-cterm-others* -psc-cterm-xterm ps_color.txt /*psc-cterm-xterm* -psc-faq ps_color.txt /*psc-faq* -psc-faq-ffothers ps_color.txt /*psc-faq-ffothers* -psc-features ps_color.txt /*psc-features* -psc-options ps_color.txt /*psc-options* -psc-overview ps_color.txt /*psc-overview* -psc-release-notes ps_color.txt /*psc-release-notes* -psc-tips ps_color.txt /*psc-tips* -psc-todo ps_color.txt /*psc-todo* -psc-usage ps_color.txt /*psc-usage* -psc_cterm_style ps_color.txt /*psc_cterm_style* -psc_fontface ps_color.txt /*psc_fontface* -psc_inversed_todo ps_color.txt /*psc_inversed_todo* -psc_statement_different_from_type ps_color.txt /*psc_statement_different_from_type* -psc_style ps_color.txt /*psc_style* -psc_use_default_for_cterm ps_color.txt /*psc_use_default_for_cterm* -pscolor ps_color.txt /*pscolor* -snipMate snipMate.txt /*snipMate* -snipMate-$# snipMate.txt /*snipMate-$#* -snipMate-${#:} snipMate.txt /*snipMate-${#:}* -snipMate-${#} snipMate.txt /*snipMate-${#}* -snipMate-author snipMate.txt /*snipMate-author* -snipMate-commands snipMate.txt /*snipMate-commands* -snipMate-contact snipMate.txt /*snipMate-contact* -snipMate-description snipMate.txt /*snipMate-description* -snipMate-disadvantages snipMate.txt /*snipMate-disadvantages* -snipMate-expandtab snipMate.txt /*snipMate-expandtab* -snipMate-features snipMate.txt /*snipMate-features* -snipMate-filename snipMate.txt /*snipMate-filename* -snipMate-indenting snipMate.txt /*snipMate-indenting* -snipMate-placeholders snipMate.txt /*snipMate-placeholders* -snipMate-remap snipMate.txt /*snipMate-remap* -snipMate-settings snipMate.txt /*snipMate-settings* -snipMate-usage snipMate.txt /*snipMate-usage* -snipMate.txt snipMate.txt /*snipMate.txt* -snippet snipMate.txt /*snippet* -snippet-syntax snipMate.txt /*snippet-syntax* -snippets snipMate.txt /*snippets* -surround surround.txt /*surround* -surround-author surround.txt /*surround-author* -surround-customizing surround.txt /*surround-customizing* -surround-issues surround.txt /*surround-issues* -surround-mappings surround.txt /*surround-mappings* -surround-replacements surround.txt /*surround-replacements* -surround-targets surround.txt /*surround-targets* -surround.txt surround.txt /*surround.txt* -v_[% matchit.txt /*v_[%* -v_]% matchit.txt /*v_]%* -v_a% matchit.txt /*v_a%* -v_g% matchit.txt /*v_g%* -vcscommand vcscommand.txt /*vcscommand* -vcscommand-buffer-management vcscommand.txt /*vcscommand-buffer-management* -vcscommand-buffer-variables vcscommand.txt /*vcscommand-buffer-variables* -vcscommand-bugs vcscommand.txt /*vcscommand-bugs* -vcscommand-commands vcscommand.txt /*vcscommand-commands* -vcscommand-config vcscommand.txt /*vcscommand-config* -vcscommand-contents vcscommand.txt /*vcscommand-contents* -vcscommand-customize vcscommand.txt /*vcscommand-customize* -vcscommand-events vcscommand.txt /*vcscommand-events* -vcscommand-install vcscommand.txt /*vcscommand-install* -vcscommand-intro vcscommand.txt /*vcscommand-intro* -vcscommand-manual vcscommand.txt /*vcscommand-manual* -vcscommand-mappings vcscommand.txt /*vcscommand-mappings* -vcscommand-mappings-override vcscommand.txt /*vcscommand-mappings-override* -vcscommand-naming vcscommand.txt /*vcscommand-naming* -vcscommand-options vcscommand.txt /*vcscommand-options* -vcscommand-ssh vcscommand.txt /*vcscommand-ssh* -vcscommand-ssh-config vcscommand.txt /*vcscommand-ssh-config* -vcscommand-ssh-env vcscommand.txt /*vcscommand-ssh-env* -vcscommand-ssh-other vcscommand.txt /*vcscommand-ssh-other* -vcscommand-ssh-wrapper vcscommand.txt /*vcscommand-ssh-wrapper* -vcscommand-statusline vcscommand.txt /*vcscommand-statusline* -vcscommand.txt vcscommand.txt /*vcscommand.txt* -vs surround.txt /*vs* -yS surround.txt /*yS* -ySS surround.txt /*ySS* -ys surround.txt /*ys* -yss surround.txt /*yss* diff --git a/.vim/doc/vcscommand.txt b/.vim/doc/vcscommand.txt deleted file mode 100644 index 28d4e63..0000000 --- a/.vim/doc/vcscommand.txt +++ /dev/null @@ -1,819 +0,0 @@ -*vcscommand.txt* vcscommand -Copyright (c) 2007 Bob Hiestand - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. - -For instructions on installing this file, type - :help add-local-help -inside Vim. - -Author: Bob Hiestand <bob.hiestand@gmail.com> -Credits: Benji Fisher's excellent MatchIt documentation - -============================================================================== -1. Contents *vcscommand-contents* - - Installation : |vcscommand-install| - vcscommand Intro : |vcscommand| - vcscommand Manual : |vcscommand-manual| - Customization : |vcscommand-customize| - SSH "integration" : |vcscommand-ssh| - Changes from cvscommand : |cvscommand-changes| - Bugs : |vcscommand-bugs| - -============================================================================== - -2. vcscommand Installation *vcscommand-install* - -The vcscommand plugin comprises five files: vcscommand.vim, vcssvn.vim, -vcscvs.vim, vcssvk.vim and vcscommand.txt (this file). In order to install -the plugin, place the vcscommand.vim, vcssvn.vim, vcssvk.vim, and vcscvs.vim -files into a plugin directory in your runtime path (please see -|add-global-plugin| and |'runtimepath'|. - -This help file can be included in the VIM help system by copying it into a -'doc' directory in your runtime path and then executing the |:helptags| -command, specifying the full path of the 'doc' directory. Please see -|add-local-help| for more details. - -vcscommand may be customized by setting variables, creating maps, and -specifying event handlers. Please see |vcscommand-customize| for more -details. - -============================================================================== - -3. vcscommand Intro *vcscommand* - *vcscommand-intro* - -The vcscommand plugin provides global ex commands for manipulating -version-controlled source files, currently those controlled either by CVS or -Subversion. In general, each command operates on the current buffer and -accomplishes a separate source control function, such as update, commit, log, -and others (please see |vcscommand-commands| for a list of all available -commands). The results of each operation are displayed in a scratch buffer. -Several buffer variables are defined for those scratch buffers (please see -|vcscommand-buffer-variables|). - -The notion of "current file" means either the current buffer, or, in the case -of a directory buffer (such as Explorer or netrw buffers), the directory (and -all subdirectories) represented by the the buffer. - -For convenience, any vcscommand invoked on a vcscommand scratch buffer acts as -though it was invoked on the original file and splits the screen so that the -output appears in a new window. - -Many of the commands accept revisions as arguments. By default, most operate -on the most recent revision on the current branch if no revision is specified. - -Each vcscommand is mapped to a key sequence starting with the |<Leader>| -keystroke. The default mappings may be overridden by supplying different -mappings before the plugin is loaded, such as in the vimrc, in the standard -fashion for plugin mappings. For examples, please see -|vcscommand-mappings-override|. - -The vcscommand plugin may be configured in several ways. For more details, -please see |vcscommand-customize|. - -============================================================================== - -4. vcscommand Manual *vcscommand-manual* - -4.1 vcscommand commands *vcscommand-commands* - -vcscommand defines the following commands: - -|:VCSAdd| -|:VCSAnnotate| -|:VCSBlame| -|:VCSCommit| -|:VCSDelete| -|:VCSDiff| -|:VCSGotoOriginal| -|:VCSLog| -|:VCSRemove| -|:VCSRevert| -|:VCSReview| -|:VCSStatus| -|:VCSUpdate| -|:VCSVimDiff| - -The following commands are specific to CVS files: - -|:CVSEdit| -|:CVSEditors| -|:CVSUnedit| -|:CVSWatch| -|:CVSWatchAdd| -|:CVSWatchOn| -|:CVSWatchOff| -|:CVSWatchRemove| -|:CVSWatchers| - -:VCSAdd *:VCSAdd* - -This command adds the current file to source control. Please note, this does -not commit the newly-added file. All parameters to the command are passed to -the underlying VCS. - -:VCSAnnotate[!] *:VCSAnnotate* - -This command displays the current file with each line annotated with the -version in which it was most recently changed. If an argument is given, the -argument is used as a revision number to display. If not given an argument, -it uses the most recent version of the file (on the current branch, if under -CVS control). Additionally, if the current buffer is a VCSAnnotate buffer -already, the version number on the current line is used. - -If '!' is used, the view of the annotated buffer is split so that the -annotation is in a separate window from the content, and each is highlighted -separately. - -For CVS buffers, the 'VCSCommandCVSAnnotateParent' option, if set to non-zero, -will cause the above behavior to change. Instead of annotating the version on -the current line, the parent revision is used instead, crossing branches if -necessary. - -With no arguments the cursor will jump to the line in the annotated buffer -corresponding to the current line in the source buffer. - -:VCSBlame[!] *:VCSBlame* - -Alias for |:VCSAnnotate|. - -:VCSCommit[!] *:VCSCommit* - -This command commits changes to the current file to source control. - -If called with arguments, the arguments are the log message. - -If '!' is used, an empty log message is committed. - -If called with no arguments, this is a two-step command. The first step opens -a buffer to accept a log message. When that buffer is written, it is -automatically closed and the file is committed using the information from that -log message. The commit can be abandoned if the log message buffer is deleted -or wiped before being written. - -Alternatively, the mapping that is used to invoke :VCSCommit (by default -|<Leader>|cc, please see |vcscommand-mappings|) can be used in the log message -buffer in Normal mode to immediately commit. This is useful if the -|VCSCommandCommitOnWrite| variable is set to 0 to disable the normal -commit-on-write behavior. - -:VCSDelete *:VCSDelete* - -Deletes the current file and removes it from source control. All parameters -to the command are passed to the underlying VCS. - -:VCSDiff *:VCSDiff* - -With no arguments, this displays the differences between the current file and -its parent version under source control in a new scratch buffer. - -With one argument, the diff is performed on the current file against the -specified revision. - -With two arguments, the diff is performed between the specified revisions of -the current file. - -For CVS, this command uses the |VCSCommandCVSDiffOpt| variable to specify diff -options. If that variable does not exist, a plugin-specific default is used. -If you wish to have no options, then set it to the empty string. - -For SVN, this command uses the |VCSCommandSVNDiffOpt| variable to specify diff -options. If that variable does not exist, the SVN default is used. -Additionally, |VCSCommandSVNDiffExt| can be used to select an external diff -application. - -:VCSGotoOriginal *:VCSGotoOriginal* - -This command jumps to the source buffer if the current buffer is a VCS scratch -buffer. - -:VCSGotoOriginal! - -Like ":VCSGotoOriginal" but also executes :bufwipeout on all VCS scrach -buffers associated with the original file. - -:VCSInfo *:VCSInfo* - -This command displays extended information about the current file in a new -scratch buffer. - -:VCSLock *:VCSLock* - -This command locks the current file in order to prevent other users from -concurrently modifying it. The exact semantics of this command depend on the -underlying VCS. This does nothing in CVS. All parameters are passed to the -underlying VCS. - -:VCSLog *:VCSLog* - -Displays the version history of the current file in a new scratch buffer. If -there is one parameter supplied, it is taken as as a revision parameters to be -passed through to the underlying VCS. Otherwise, all parameters are passed to -the underlying VCS. - -:VCSRemove *:VCSRemove* - -Alias for |:VCSDelete|. - -:VCSRevert *:VCSRevert* - -This command replaces the current file with the most recent version from the -repository in order to wipe out any undesired changes. - -:VCSReview *:VCSReview* - -Displays a particular version of the current file in a new scratch buffer. If -no argument is given, the most recent version of the file on the current -branch is retrieved. - -:VCSStatus *:VCSStatus* - -Displays versioning information about the current file in a new scratch -buffer. All parameters are passed to the underlying VCS. - - -:VCSUnlock *:VCSUnlock* - -Unlocks the current file in order to allow other users from concurrently -modifying it. The exact semantics of this command depend on the underlying -VCS. All parameters are passed to the underlying VCS. - -:VCSUpdate *:VCSUpdate* - -Updates the current file with any relevant changes from the repository. This -intentionally does not automatically reload the current buffer, though vim -should prompt the user to do so if the underlying file is altered by this -command. - -:VCSVimDiff *:VCSVimDiff* - -Uses vimdiff to display differences between versions of the current file. - -If no revision is specified, the most recent version of the file on the -current branch is used. With one argument, that argument is used as the -revision as above. With two arguments, the differences between the two -revisions is displayed using vimdiff. - -With either zero or one argument, the original buffer is used to perform the -vimdiff. When the scratch buffer is closed, the original buffer will be -returned to normal mode. - -Once vimdiff mode is started using the above methods, additional vimdiff -buffers may be added by passing a single version argument to the command. -There may be up to 4 vimdiff buffers total. - -Using the 2-argument form of the command resets the vimdiff to only those 2 -versions. Additionally, invoking the command on a different file will close -the previous vimdiff buffers. - -:CVSEdit *:CVSEdit* - -This command performs "cvs edit" on the current file. Yes, the output buffer -in this case is almost completely useless. - -:CVSEditors *:CVSEditors* - -This command performs "cvs edit" on the current file. - -:CVSUnedit *:CVSUnedit* - -Performs "cvs unedit" on the current file. Again, yes, the output buffer here -is basically useless. - -:CVSWatch *:CVSWatch* - -This command takes an argument which must be one of [on|off|add|remove]. The -command performs "cvs watch" with the given argument on the current file. - -:CVSWatchAdd *:CVSWatchAdd* - -This command is an alias for ":CVSWatch add" - -:CVSWatchOn *:CVSWatchOn* - -This command is an alias for ":CVSWatch on" - -:CVSWatchOff *:CVSWatchOff* - -This command is an alias for ":CVSWatch off" - -:CVSWatchRemove *:CVSWatchRemove* - -This command is an alias for ":CVSWatch remove" - -:CVSWatchers *:CVSWatchers* - -This command performs "cvs watchers" on the current file. - -4.2 Mappings *vcscommand-mappings* - -By default, a mapping is defined for each command. These mappings execute the -default (no-argument) form of each command. - -|<Leader>|ca VCSAdd -|<Leader>|cn VCSAnnotate -|<Leader>|cN VCSAnnotate! -|<Leader>|cc VCSCommit -|<Leader>|cD VCSDelete -|<Leader>|cd VCSDiff -|<Leader>|cg VCSGotoOriginal -|<Leader>|cG VCSGotoOriginal! -|<Leader>|ci VCSInfo -|<Leader>|cl VCSLog -|<Leader>|cL VCSLock -|<Leader>|cr VCSReview -|<Leader>|cs VCSStatus -|<Leader>|cu VCSUpdate -|<Leader>|cU VCSUnlock -|<Leader>|cv VCSVimDiff - -Only for CVS buffers: - -|<Leader>|ce CVSEdit -|<Leader>|cE CVSEditors -|<Leader>|ct CVSUnedit -|<Leader>|cwv CVSWatchers -|<Leader>|cwa CVSWatchAdd -|<Leader>|cwn CVSWatchOn -|<Leader>|cwf CVSWatchOff -|<Leader>|cwf CVSWatchRemove - - *vcscommand-mappings-override* - -The default mappings can be overridden by user-provided instead by mapping to -<Plug>CommandName. This is especially useful when these mappings collide with -other existing mappings (vim will warn of this during plugin initialization, -but will not clobber the existing mappings). - -There are three methods for controlling mapping: - -First, maps can be overriden for individual commands. For instance, to -override the default mapping for :VCSAdd to set it to '\add', add the -following to the vimrc: - -nmap \add <Plug>VCSAdd - -Second, the default map prefix ('<Leader>c') can be overridden by defining the -|VCSCommandMapPrefix| variable. - -Third, the entire set of default maps can be overridden by defining the -|VCSCommandMappings| variable. - - -4.3 Automatic buffer variables *vcscommand-buffer-variables* - -Several buffer variables are defined in each vcscommand result buffer. These -may be useful for additional customization in callbacks defined in the event -handlers (please see |vcscommand-events|). - -The following variables are automatically defined: - -b:VCSCommandOriginalBuffer *b:VCSCommandOriginalBuffer* - -This variable is set to the buffer number of the source file. - -b:VCSCommandCommand *b:VCSCommandCommand* - -This variable is set to the name of the vcscommand that created the result -buffer. - -b:VCSCommandSourceFile *b:VCSCommandSourceFile* - -This variable is set to the name of the original file under source control. - -b:VCSCommandVCSType *b:VCSCommandVCSType* - -This variable is set to the type of the source control. This variable is also -set on the original file itself. -============================================================================== - -5. Configuration and customization *vcscommand-customize* - *vcscommand-config* - -The vcscommand plugin can be configured in several ways: by setting -configuration variables (see |vcscommand-options|) or by defining vcscommand -event handlers (see |vcscommand-events|). Additionally, the vcscommand plugin -supports a customized status line (see |vcscommand-statusline| and -|vcscommand-buffer-management|). - -5.1 vcscommand configuration variables *vcscommand-options* - -Several variables affect the plugin's behavior. These variables are checked -at time of execution, and may be defined at the window, buffer, or global -level and are checked in that order of precedence. - - -The following variables are available: - -|VCSCommandCommitOnWrite| -|VCSCommandCVSDiffOpt| -|VCSCommandCVSExec| -|VCSCommandDeleteOnHide| -|VCSCommandDiffSplit| -|VCSCommandDisableAll| -|VCSCommandDisableMappings| -|VCSCommandDisableExtensionMappings| -|VCSCommandEdit| -|VCSCommandEnableBufferSetup| -|VCSCommandMappings| -|VCSCommandMapPrefix| -|VCSCommandResultBufferNameExtension| -|VCSCommandResultBufferNameFunction| -|VCSCommandSplit| -|VCSCommandSVKExec| -|VCSCommandSVNDiffExt| -|VCSCommandSVNDiffOpt| -|VCSCommandSVNExec| -|VCSCommandVCSTypeOverride| - -VCSCommandCommitOnWrite *VCSCommandCommitOnWrite* - -This variable, if set to a non-zero value, causes the pending commit -to take place immediately as soon as the log message buffer is written. -If set to zero, only the VCSCommit mapping will cause the pending commit to -occur. If not set, it defaults to 1. - -VCSCommandCVSExec *VCSCommandCVSExec* - -This variable controls the executable used for all CVS commands If not set, -it defaults to "cvs". - -VCSCommandDeleteOnHide *VCSCommandDeleteOnHide* - -This variable, if set to a non-zero value, causes the temporary result buffers -to automatically delete themselves when hidden. - -VCSCommandCVSDiffOpt *VCSCommandCVSDiffOpt* - -This variable, if set, determines the options passed to the diff command of -CVS. If not set, it defaults to 'u'. - -VCSCommandDiffSplit *VCSCommandDiffSplit* - -This variable overrides the |VCSCommandSplit| variable, but only for buffers -created with |:VCSVimDiff|. - -VCSCommandDisableAll *VCSCommandDisableAll* - -This variable, if set, prevents the plugin or any extensions from loading at -all. This is useful when a single runtime distribution is used on multiple -systems with varying versions. - -VCSCommandDisableMappings *VCSCommandDisableMappings* - -This variable, if set to a non-zero value, prevents the default command -mappings from being set. This supercedes -|VCSCommandDisableExtensionMappings|. - -VCSCommandDisableExtensionMappings *VCSCommandDisableExtensionMappings* - -This variable, if set to a non-zero value, prevents the default command -mappings from being set for commands specific to an individual VCS. - -VCSCommandEdit *VCSCommandEdit* - -This variable controls whether the original buffer is replaced ('edit') or -split ('split'). If not set, it defaults to 'split'. - -VCSCommandEnableBufferSetup *VCSCommandEnableBufferSetup* - -This variable, if set to a non-zero value, activates VCS buffer management -mode see (|vcscommand-buffer-management|). This mode means that the -'VCSCommandBufferInfo' variable is filled with version information if the file -is VCS-controlled. This is useful for displaying version information in the -status bar. - -VCSCommandMappings *VCSCommandMappings* - -This variable, if set, overrides the default mappings used for shortcuts. It -should be a List of 2-element Lists, each containing a shortcut and function -name pair. The value of the '|VCSCommandMapPrefix|' variable will be added to -each shortcut. - -VCSCommandMapPrefix *VCSCommandMapPrefix* - -This variable, if set, overrides the default mapping prefix ('<Leader>c'). -This allows customization of the mapping space used by the vcscommand -shortcuts. - -VCSCommandResultBufferNameExtension *VCSCommandResultBufferNameExtension* - -This variable, if set to a non-blank value, is appended to the name of the VCS -command output buffers. For example, '.vcs'. Using this option may help -avoid problems caused by autocommands dependent on file extension. - -VCSCommandResultBufferNameFunction *VCSCommandResultBufferNameFunction* - -This variable, if set, specifies a custom function for naming VCS command -output buffers. This function is expected to return the new buffer name, and -will be passed the following arguments: - - command - name of the VCS command being executed (such as 'Log' or - 'Diff'). - - originalBuffer - buffer number of the source file. - - vcsType - type of VCS controlling this file (such as 'CVS' or 'SVN'). - - statusText - extra text associated with the VCS action (such as version - numbers). - -VCSCommandSplit *VCSCommandSplit* - -This variable controls the orientation of the various window splits that -may occur. - -If set to 'horizontal', the resulting windows will be on stacked on top of -one another. If set to 'vertical', the resulting windows will be -side-by-side. If not set, it defaults to 'horizontal' for all but -VCSVimDiff windows. VCSVimDiff windows default to the user's 'diffopt' -setting, if set, otherwise 'vertical'. - -VCSCommandSVKExec *VCSCommandSVKExec* - -This variable controls the executable used for all SVK commands If not set, -it defaults to "svk". - -VCSCommandSVNDiffExt *VCSCommandSVNDiffExt* - -This variable, if set, is passed to SVN via the --diff-cmd command to select -an external application for performing the diff. - -VCSCommandSVNDiffOpt *VCSCommandSVNDiffOpt* - -This variable, if set, determines the options passed with the '-x' parameter -to the SVN diff command. If not set, no options are passed. - -VCSCommandSVNExec *VCSCommandSVNExec* - -This variable controls the executable used for all SVN commands If not set, -it defaults to "svn". - -VCSCommandVCSTypeOverride *VCSCommandVCSTypeOverride* - -This variable allows the VCS type detection to be overridden on a path-by-path -basis. The value of this variable is expected to be a List of Lists. Each -item in the high-level List is a List containing two elements. The first -element is a regular expression that will be matched against the full file -name of a given buffer. If it matches, the second element will be used as the -VCS type. - -5.2 VCSCommand events *vcscommand-events* - -For additional customization, vcscommand can trigger user-defined events. -Event handlers are provided by defining User event autocommands (see -|autocommand|, |User|) in the vcscommand group with patterns matching the -event name. - -For instance, the following could be added to the vimrc to provide a 'q' -mapping to quit a vcscommand scratch buffer: - -augroup VCSCommand - au User VCSBufferCreated silent! nmap <unique> <buffer> q :bwipeout<cr> -augroup END - -The following hooks are available: - -VCSBufferCreated This event is fired just after a vcscommand - result buffer is created and populated. It is - executed within the context of the vcscommand - buffer. The vcscommand buffer variables may - be useful for handlers of this event (please - see |vcscommand-buffer-variables|). - -VCSBufferSetup This event is fired just after vcscommand buffer - setup occurs, if enabled. - -VCSPluginInit This event is fired when the vcscommand plugin - first loads. - -VCSPluginFinish This event is fired just after the vcscommand - plugin loads. - -VCSVimDiffFinish This event is fired just after the VCSVimDiff - command executes to allow customization of, - for instance, window placement and focus. - -Additionally, there is another hook which is used internally to handle loading -the multiple scripts in order. This hook should probably not be used by an -end user without a good idea of how it works. Among other things, any events -associated with this hook are cleared after they are executed (during -vcscommand.vim script initialization). - -VCSLoadExtensions This event is fired just before the - VCSPluginFinish. It is used internally to - execute any commands from the VCS - implementation plugins that needs to be - deferred until the primary plugin is - initialized. - -5.3 vcscommand buffer naming *vcscommand-naming* - -vcscommand result buffers use the following naming convention: -[{VCS type} {VCS command} {Source file name}] - -If additional buffers are created that would otherwise conflict, a -distinguishing number is added: - -[{VCS type} {VCS command} {Source file name}] (1,2, etc) - -5.4 vcscommand status line support *vcscommand-statusline* - -It is intended that the user will customize the |'statusline'| option to -include vcscommand result buffer attributes. A sample function that may be -used in the |'statusline'| option is provided by the plugin, -VCSCommandGetStatusLine(). In order to use that function in the status line, do -something like the following: - -set statusline=%<%f\ %{VCSCommandGetStatusLine()}\ %h%m%r%=%l,%c%V\ %P - -of which %{VCSCommandGetStatusLine()} is the relevant portion. - -The sample VCSCommandGetStatusLine() function handles both vcscommand result -buffers and VCS-managed files if vcscommand buffer management is enabled -(please see |vcscommand-buffer-management|). - -5.5 vcscommand buffer management *vcscommand-buffer-management* - -The vcscommand plugin can operate in buffer management mode, which means that -it attempts to set a buffer variable ('VCSCommandBufferInfo') upon entry into -a buffer. This is rather slow because it means that the VCS will be invoked -at each entry into a buffer (during the |BufEnter| autocommand). - -This mode is disabled by default. In order to enable it, set the -|VCSCommandEnableBufferSetup| variable to a true (non-zero) value. Enabling -this mode simply provides the buffer variable mentioned above. The user must -explicitly include information from the variable in the |'statusline'| option -if they are to appear in the status line (but see |vcscommand-statusline| for -a simple way to do that). - -The 'VCSCommandBufferInfo' variable is a list which contains, in order, the -revision of the current file, the latest revision of the file in the -repository, and (for CVS) the name of the branch. If those values cannot be -determined, the list is a single element: 'Unknown'. - -============================================================================== - -6. SSH "integration" *vcscommand-ssh* - -The following instructions are intended for use in integrating the -vcscommand.vim plugin with an SSH-based CVS environment. - -Familiarity with SSH and CVS are assumed. - -These instructions assume that the intent is to have a message box pop up in -order to allow the user to enter a passphrase. If, instead, the user is -comfortable using certificate-based authentication, then only instructions -6.1.1 and 6.1.2 (and optionally 6.1.4) need to be followed; ssh should then -work transparently. - -6.1 Environment settings *vcscommand-ssh-env* - -6.1.1 CVSROOT should be set to something like: - - :ext:user@host:/path_to_repository - -6.1.2 CVS_RSH should be set to: - - ssh - - Together, those settings tell CVS to use ssh as the transport when - performing CVS calls. - -6.1.3 SSH_ASKPASS should be set to the password-dialog program. In my case, - running gnome, it's set to: - - /usr/libexec/openssh/gnome-ssh-askpass - - This tells SSH how to get passwords if no input is available. - -6.1.4 OPTIONAL. You may need to set SSH_SERVER to the location of the cvs - executable on the remote (server) machine. - -6.2 CVS wrapper program *vcscommand-ssh-wrapper* - -Now you need to convince SSH to use the password-dialog program. This means -you need to execute SSH (and therefore CVS) without standard input. The -following script is a simple perl wrapper that dissasociates the CVS command -from the current terminal. Specific steps to do this may vary from system to -system; the following example works for me on linux. - -#!/usr/bin/perl -w -use strict; -use POSIX qw(setsid); -open STDIN, '/dev/null'; -fork and do {wait; exit;}; -setsid; -exec('cvs', @ARGV); - -6.3 Configuring vcscommand.vim *vcscommand-ssh-config* - -At this point, you should be able to use your wrapper script to invoke CVS with -various commands, and get the password dialog. All that's left is to make CVS -use your newly-created wrapper script. - -6.3.1 Tell vcscommand.vim what CVS executable to use. The easiest way to do this - is globally, by putting the following in your .vimrc: - - let VCSCommandCVSExec=/path/to/cvs/wrapper/script - -6.4 Where to go from here *vcscommand-ssh-other* - -The script given above works even when non-SSH CVS connections are used, -except possibly when interactively entering the message for CVS commit log -(depending on the editor you use... VIM works fine). Since the vcscommand.vim -plugin handles that message without a terminal, the wrapper script can be used -all the time. - -This allows mixed-mode operation, where some work is done with SSH-based CVS -repositories, and others with pserver or local access. - -It is possible, though beyond the scope of the plugin, to dynamically set the -CVS executable based on the CVSROOT for the file being edited. The user -events provided (such as VCSBufferCreated and VCSBufferSetup) can be used to -set a buffer-local value (b:VCSCommandCVSExec) to override the CVS executable -on a file-by-file basis. Alternatively, much the same can be done (less -automatically) by the various project-oriented plugins out there. - -It is highly recommended for ease-of-use that certificates with no passphrase -or ssh-agent are employed so that the user is not given the password prompt -too often. - -============================================================================== - -7. Changes from cvscommand *cvscommand-changes* - -1. Require Vim 7 in order to leverage several convenient features; also -because I wanted to play with Vim 7. - -2. Renamed commands to start with 'VCS' instead of 'CVS'. The exceptions are -the 'CVSEdit' and 'CVSWatch' family of commands, which are specific to CVS. - -3. Renamed options, events to start with 'VCSCommand'. - -4. Removed option to jump to the parent version of the current line in an -annotated buffer, as opposed to the version on the current line. This made -little sense in the branching scheme used by subversion, where jumping to a -parent branch required finding a different location in the repository. It -didn't work consistently in CVS anyway. - -5. Removed option to have nameless scratch buffers. - -6. Changed default behavior of scratch buffers to split the window instead of -displaying in the current window. This may still be overridden using the -'VCSCommandEdit' option. - -7. Split plugin into multiple plugins. - -8. Added 'VCSLock' and 'VCSUnlock' commands. These are implemented for -subversion but not for CVS. These were not kept specific to subversion as they -seemed more general in nature and more likely to be supported by any future VCS -supported by this plugin. - -9. Changed name of buffer variables set by commands. - -'b:cvsOrigBuffNR' became 'b:VCSCommandOriginalBuffer' -'b:cvscmd' became 'b:VCSCommandCommand' - -10. Added new automatic variables to command result buffers. - -'b:VCSCommandSourceFile' -'b:VCSCommandVCSType' - -============================================================================== - -8. Known bugs *vcscommand-bugs* - -Please let me know if you run across any. - -CVSUnedit may, if a file is changed from the repository, provide prompt text -to determine whether the changes should be thrown away. Currently, that text -shows up in the CVS result buffer as information; there is no way for the user -to actually respond to the prompt and the CVS unedit command does nothing. If -this really bothers anyone, please let me know. - -VCSVimDiff, when using the original (real) source buffer as one of the diff -buffers, uses some hacks to try to restore the state of the original buffer -when the scratch buffer containing the other version is destroyed. There may -still be bugs in here, depending on many configuration details. - -vim:tw=78:ts=8:ft=help diff --git a/.vim/filetype.vim b/.vim/filetype.vim deleted file mode 100644 index 48fb035..0000000 --- a/.vim/filetype.vim +++ /dev/null @@ -1,147 +0,0 @@ -" general per-language filetype file -if exists("g:did_load_personal_filetypes") - finish -endif - -let g:did_load_personal_filetypes = 1 - -" Filetype mappingss -augroup markdown - au! BufRead,BufNewFile *.mkd setfiletype markdown - au! BufRead,BufNewFile *.md setfiletype markdown -augroup END -augroup mako - au! BufRead,BufNewFile *.mak,*.mako setfiletype mako -augroup END -augroup csv - au! BufNewFile,BufRead *.csv setf csv -augroup END -augroup lilypond - au! BufNewFile,BufRead *.ly,*.ily setf lilypond -augroup END -augroup java - autocmd BufRead *.java set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%# - autocmd BufRead *.java set makeprg=ant\ -find\ build.xml - autocmd FileType java let b:auto_trim_whitespace=1 -augroup END -augroup less - autocmd BufNewFile,BufRead *.less set filetype=less -augroup END - -augroup pcal - au BufNewFile,BufRead *.pcal setf tla -augroup END - -augroup ragel - au BufNewFile,BufRead *.rl setf ragel -augroup END - - -au! BufNewFile,BufRead *.pde setf arduino - -"augroup org - "" leave these as is: - "au! BufRead,BufWrite,BufWritePost,BufNewFile *.org - ""au BufRead,BufNewFile *.org call org#SetOrgFileType() - ""au BufRead,BufNewFile *.org :GitGutterDisable - "au BufRead *.org :PreLoadTags - "au BufWrite *.org :PreWriteTags - "au BufWritePost *.org :PostWriteTags -"augroup END - -au BufNewFile,BufRead motd.public,/tmp/motd.public.r.* setf motd - -au Filetype html,xml,xsl source ~/.vim/closetag.vim - -au BufRead,BufNewFile *.go set filetype=go - -au FileType cpp let b:delimitMate_matchpairs = "(:),[:],{:}" - -autocmd FileType vue syntax sync fromstart -au Filetype vue let b:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`', '<':'>'} -au Filetype html let b:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`', '<':'>'} - -"Settings per filetype -augroup python - ""autocmd FileType python set omnifunc=pythoncomplete#Complete - ""autocmd FileType python call SuperTabSetCompletionType("<C-X><C-O>") - ""autocmd FileType python set completeopt-=preview - autocmd FileType python set ts=4 - autocmd FileType python set softtabstop=4 - autocmd FileType python set shiftwidth=4 - autocmd FileType python set expandtab - autocmd FileType python set nosmartindent - "autocmd FileType python let b:auto_trim_whitespace=1 -augroup END -"augroup javascript - "autocmd FileType javascript set ts=4 - "autocmd FileType javascript set softtabstop=4 - "autocmd FileType javascript set shiftwidth=4 - "autocmd FileType javascript set expandtab - "autocmd FileType javascript let b:auto_trim_whitespace=1 -"augroup END - -augroup hs - autocmd FileType hs nnoremap <Leader>ii :GhcModInfo!<CR> -augroup END - -augroup mkd - autocmd FileType mkd set ai formatoptions=tcroqn2 comments=n:> -augroup END - -augroup mediawiki - autocmd BufRead,BufNewFile *.wiki setfiletype mediawiki - autocmd BufRead,BufNewFile *.wikipedia.org* setfiletype mediawiki -augroup END - -augroup go - autocmd FileType go set ts=2 - autocmd FileType go set softtabstop=2 - autocmd FileType go set shiftwidth=2 - autocmd FileType go set noexpandtab - autocmd FileType go imap <buffer> <silent> <Leader>rr <C-o>:GoIfErr<cr> - autocmd FileType go nmap <buffer> <silent> <Leader>rr :GoIfErr<cr> - autocmd FileType go nnoremap <silent> <Leader>im <cmd>lua require('telescope').extensions.goimpl.goimpl{theme = "ivy", layout_config = {height = 10}}<cr> - "autocmd FileType go nmap <Leader>gd <Plug>(go-doc) - "autocmd FileType go nmap gd <Plug>(go-def) -augroup END - -augroup idris - autocmd FileType idris nmap <buffer> <LocalLeader>a a?hole<Esc><LocalLeader>t -augroup end - -augroup markdown - autocmd FileType markdown imap <buffer> <S-Tab> <C-o><< -augroup end - -autocmd FileType go let b:auto_trim_whitespace=1 -autocmd FileType cpp let b:auto_trim_whitespace=1 -autocmd FileType perl let b:auto_trim_whitespace=1 -autocmd FileType borg let b:auto_trim_whitespace=1 -autocmd FileType javascript let b:auto_trim_whitespace=1 -autocmd FileType python let b:auto_trim_whitespace=1 -autocmd FileType proto let b:auto_trim_whitespace=1 -autocmd FileType hy let b:auto_trim_whitespace=1 -autocmd FileType idris let b:auto_trim_whitespace=1 -autocmd FileType java let b:auto_trim_whitespace=1 -autocmd FileType lua let b:auto_trim_whitespace=1 - -augroup templates - autocmd BufNewFile *.vue 0r ~/.vim/skeletons/vue.skel - autocmd BufNewFile *.svelte 0r ~/.vim/skeletons/svelte.skel -augroup end - -augroup rust - autocmd FileType rust nnoremap <Leader>lg <cmd>lua rust_where_at_line()<CR> -augroup end - -function DetectGoHtmlTmpl() - if expand('%:e') == "html" && search("{{") != 0 - setfiletype gohtmltmpl - endif -endfunction - -augroup filetypedetect - " gohtmltmpl - au BufRead,BufNewFile *.html call DetectGoHtmlTmpl() -augroup END diff --git a/.vim/ftdetect/proto.vim b/.vim/ftdetect/proto.vim deleted file mode 100644 index 3974660..0000000 --- a/.vim/ftdetect/proto.vim +++ /dev/null @@ -1 +0,0 @@ -autocmd BufNewFile,BufRead *.proto setfiletype proto diff --git a/.vim/ftdetect/scala.vim b/.vim/ftdetect/scala.vim deleted file mode 100644 index 6b35521..0000000 --- a/.vim/ftdetect/scala.vim +++ /dev/null @@ -1,3 +0,0 @@ -" $URL$ - -au BufRead,BufNewFile *.scala set filetype=scala diff --git a/.vim/ftplugin/html_snip_helper.vim b/.vim/ftplugin/html_snip_helper.vim deleted file mode 100644 index 2e54570..0000000 --- a/.vim/ftplugin/html_snip_helper.vim +++ /dev/null @@ -1,10 +0,0 @@ -" Helper function for (x)html snippets -if exists('s:did_snip_helper') || &cp || !exists('loaded_snips') - finish -endif -let s:did_snip_helper = 1 - -" Automatically closes tag if in xhtml -fun! Close() - return stridx(&ft, 'xhtml') == -1 ? '' : ' /' -endf diff --git a/.vim/ftplugin/objc_cocoa_mappings.vim b/.vim/ftplugin/objc_cocoa_mappings.vim deleted file mode 100644 index db2c61b..0000000 --- a/.vim/ftplugin/objc_cocoa_mappings.vim +++ /dev/null @@ -1,70 +0,0 @@ -" File: objc_cocoa_mappings.vim -" Author: Michael Sanders (msanders42 [at] gmail [dot] com) -" Description: Sets up mappings for cocoa.vim. -" Last Updated: September 08, 2009 - -if exists('b:cocoa_proj') || &cp || version < 700 - finish -endif -let b:cocoa_proj = fnameescape(globpath(expand('<afile>:p:h'), '*.xcodeproj')) - -com! -buffer ListMethods call objc#method_list#Activate(1) -com! -buffer -nargs=? -complete=customlist,objc#method_builder#Completion BuildMethods call objc#method_builder#Build('<args>') -com! -buffer -nargs=? -complete=custom,objc#man#Completion CocoaDoc call objc#man#ShowDoc('<args>') -com! -buffer -nargs=? Alternate call <SID>AlternateFile() - -let objc_man_key = exists('objc_man_key') ? objc_man_key : 'K' -exe 'nn <buffer> <silent> '.objc_man_key.' :<c-u>call objc#man#ShowDoc()<cr>' - -nn <buffer> <silent> <leader>A :cal<SID>AlternateFile()<cr> - -" Mimic some of Xcode's mappings. -nn <buffer> <silent> <d-r> :w<bar>cal<SID>BuildAnd('launch')<cr> -nn <buffer> <silent> <d-b> :w<bar>cal<SID>XcodeRun('build')<cr> -nn <buffer> <silent> <d-K> :w<bar>cal<SID>XcodeRun('clean')<cr> -" TODO: Add this -" nn <buffer> <silent> <d-y> :w<bar>cal<SID>BuildAnd('debug')<cr> -nn <buffer> <silent> <d-m-up> :cal<SID>AlternateFile()<cr> -nn <buffer> <silent> <d-0> :call system('open -a Xcode '.b:cocoa_proj)<cr> -nn <buffer> <silent> <d-2> :<c-u>ListMethods<cr> -nm <buffer> <silent> <d-cr> <d-r> -ino <buffer> <silent> <f5> <c-x><c-o> - -if exists('*s:AlternateFile') | finish | endif - -" Switch from header file to implementation file (and vice versa). -fun s:AlternateFile() - let path = expand('%:p:r').'.' - if expand('%:e') == 'h' - if filereadable(path.'m') - exe 'e'.fnameescape(path.'m') - return - elseif filereadable(path.'c') - exe 'e'.fnameescape(path.'c') - return - endif - else - if filereadable(path.'h') - exe 'e'.fnameescape(path.'h') - return - endif - endif - echoh ErrorMsg | echo 'Alternate file not readable.' | echoh None -endf - -" Opens Xcode and runs Applescript commands, splitting them onto newlines -" if needed. -fun s:XcodeRun(command) - call system("open -a Xcode ".b:cocoa_proj." && osascript -e 'tell app " - \ .'"Xcode" to '.a:command."' &") -endf - -fun s:BuildAnd(command) - call system("open -a Xcode ".b:cocoa_proj." && osascript -e 'tell app " - \ ."\"Xcode\"' -e '" - \ .'set target_ to project of active project document ' - \ ."' -e '" - \ .'if (build target_) starts with "Build succeeded" then ' - \ .a:command.' target_' - \ ."' -e 'end tell'") -endf diff --git a/.vim/indent/cpp.vim b/.vim/indent/cpp.vim deleted file mode 100644 index 1ccb21f..0000000 --- a/.vim/indent/cpp.vim +++ /dev/null @@ -1,92 +0,0 @@ -" Vim indent file -" Language: C++ -" Maintainer: Konstantin Lepa <konstantin.lepa@gmail.com> -" Last Change: 2010 May 20 -" License: MIT -" Version: 1.1.0 -" -" Changes {{{ -" 1.1.0 2011-01-17 -" Refactored source code. -" Some fixes. -" -" 1.0.1 2010-05-20 -" Added some changes. Thanks to Eric Rannaud <eric.rannaud@gmail.com> -" -"}}} - -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - - -function! GoogleCppIndent() - let l:cline_num = line('.') - - let l:orig_indent = cindent(l:cline_num) - - if l:orig_indent == 0 | return 0 | endif - - let l:pline_num = prevnonblank(l:cline_num - 1) - let l:pline = getline(l:pline_num) - if l:pline =~# '^\s*template' | return l:pline_indent | endif - - " TODO: I don't know to correct it: - " namespace test { - " void - " ....<-- invalid cindent pos - " - " void test() { - " } - " - " void - " <-- cindent pos - if l:orig_indent != &shiftwidth | return l:orig_indent | endif - - let l:in_comment = 0 - let l:pline_num = prevnonblank(l:cline_num - 1) - while l:pline_num > -1 - let l:pline = getline(l:pline_num) - let l:pline_indent = indent(l:pline_num) - - if l:in_comment == 0 && l:pline =~ '^.\{-}\(/\*.\{-}\)\@<!\*/' - let l:in_comment = 1 - elseif l:in_comment == 1 - if l:pline =~ '/\*\(.\{-}\*/\)\@!' - let l:in_comment = 0 - endif - elseif l:pline_indent == 0 - if l:pline !~# '\(#define\)\|\(^\s*//\)\|\(^\s*{\)' - if l:pline =~# '^\s*namespace.*' - return 0 - else - return l:orig_indent - endif - elseif l:pline =~# '\\$' - return l:orig_indent - endif - else - return l:orig_indent - endif - - let l:pline_num = prevnonblank(l:pline_num - 1) - endwhile - - return l:orig_indent -endfunction - -setlocal shiftwidth=2 -setlocal tabstop=2 -setlocal softtabstop=2 -setlocal expandtab -setlocal textwidth=80 -setlocal wrap - -setlocal cindent -setlocal cinoptions=h1,l1,g1,t0,i4,+4,(0,w1,W4 - -setlocal indentexpr=GoogleCppIndent() - -let b:undo_indent = "setl sw< ts< sts< et< tw< wrap< cin< cino< inde<" - diff --git a/.vim/indent/gohtmltmpl.vim b/.vim/indent/gohtmltmpl.vim deleted file mode 100644 index 8cc544a..0000000 --- a/.vim/indent/gohtmltmpl.vim +++ /dev/null @@ -1,54 +0,0 @@ -if exists("b:did_indent") - finish -endif - -runtime! indent/html.vim - -" Indent Golang HTML templates -setlocal indentexpr=GetGoHTMLTmplIndent(v:lnum) -setlocal indentkeys+==else,=end - -" Only define the function once. -if exists("*GetGoHTMLTmplIndent") - finish -endif - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! GetGoHTMLTmplIndent(lnum) - " Get HTML indent - if exists('*HtmlIndent') - let ind = HtmlIndent() - else - let ind = HtmlIndentGet(a:lnum) - endif - - " The value of a single shift-width - if exists('*shiftwidth') - let sw = shiftwidth() - else - let sw = &sw - endif - - " If need to indent based on last line - let last_line = getline(a:lnum-1) - if last_line =~ '^\s*{{-\=\s*\%(if\|else\|range\|with\|define\|block\).*}}' - let ind += sw - endif - - " End of FuncMap block - let current_line = getline(a:lnum) - if current_line =~ '^\s*{{-\=\s*\%(else\|end\).*}}' - let ind -= sw - endif - - return ind -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/.vim/indent/haskell.vim b/.vim/indent/haskell.vim deleted file mode 100644 index 83e7f34..0000000 --- a/.vim/indent/haskell.vim +++ /dev/null @@ -1,96 +0,0 @@ -" Vim indent file -" Language: Haskell -" Author: motemen <motemen@gmail.com> -" Version: 0.1 -" Last Change: 2007-07-25 -" -" Modify g:haskell_indent_if and g:haskell_indent_case to -" change indentation for `if'(default 3) and `case'(default 5). -" Example (in .vimrc): -" > let g:haskell_indent_if = 2 - -if exists('b:did_indent') - finish -endif - -let b:did_indent = 1 - -if !exists('g:haskell_indent_if') - " if bool - " >>>then ... - " >>>else ... - let g:haskell_indent_if = 3 -endif - -if !exists('g:haskell_indent_do') - " do [optional] - " >>>more.. - " >>>stuff... - let g:haskell_indent_do = 4 -endif - -if !exists('g:haskell_indent_case') - " case xs of - " >>>>>[] -> ... - " >>>>>(y:ys) -> ... - let g:haskell_indent_case = 5 -endif - -setlocal indentexpr=GetHaskellIndent() -setlocal indentkeys=!^F,o,O - -function! GetHaskellIndent() - let line = substitute(getline(getpos('.')[1] - 1), '\t', repeat(' ', &tabstop), 'g') - - if line =~ '[!#$%&*+./<=>?@\\^|~-]$' - return match(line, '\s*where \zs\|\S') + &shiftwidth - endif - - if line =~ '\<do\s*$' - return match(line, '\s*where \zs\|\S') + g:haskell_indent_do - endif - - if line =~ '{$' - return match(line, '\s*where \zs\|\S') + &shiftwidth - endif - - if line =~ '^\(instance\|class\).*\&.*where$' - return &shiftwidth - endif - - if line =~ ')$' - let pos = getpos('.') - normal k$ - let paren_end = getpos('.') - normal % - let paren_begin = getpos('.') - call setpos('.', pos) - if paren_begin[1] != paren_end[1] - return paren_begin[2] - 1 - endif - endif - - if line !~ '\<else\>' - let s = match(line, '\<if\>.*\&.*\zs\<then\>') - if s > 0 - return s - endif - - let s = match(line, '\<if\>') - if s > 0 - return s + g:haskell_indent_if - endif - endif - - let s = match(line, '\<do\s\+\zs[^{]\|\<where\s\+\zs\w\|\<let\s\+\zs\S\|^\s*\zs|\s') - if s > 0 - return s - endif - - let s = match(line, '\<case\>') - if s > 0 - return s + g:haskell_indent_case - endif - - return match(line, '\S') -endfunction diff --git a/.vim/indent/javascript.vim b/.vim/indent/javascript.vim deleted file mode 100644 index 99e03ee..0000000 --- a/.vim/indent/javascript.vim +++ /dev/null @@ -1,330 +0,0 @@ -" Vim indent file -" Language: Javascript -" Maintainer: Darrick Wiebe <darrick at innatesoftware.com> -" URL: http://github.com/pangloss/vim-javascript -" Version: 1.0.0 -" Last Change: August 31, 2009 -" Acknowledgement: Based off of vim-ruby maintained by Nikolai Weibull http://vim-ruby.rubyforge.org - -" 0. Initialization {{{1 -" ================= - -" Only load this indent file when no other was loaded. -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -setlocal nosmartindent - -" Now, set up our indentation expression and keys that trigger it. -setlocal indentexpr=GetJavascriptIndent() -setlocal indentkeys=0{,0},0),0],!^F,o,O,e - -" Only define the function once. -if exists("*GetJavascriptIndent") - finish -endif - -let s:cpo_save = &cpo -set cpo&vim - -" 1. Variables {{{1 -" ============ - -" Regex of syntax group names that are or delimit string or are comments. -let s:syng_strcom = '\<javaScript\%(RegexpString\|CommentTodo\|LineComment\|Comment\|DocComment\)\>' - -" Regex of syntax group names that are strings. -let s:syng_string = - \ '\<javaScript\%(RegexpString\)\>' - -" Regex of syntax group names that are strings or documentation. -let s:syng_stringdoc = - \'\<javaScriptDocComment\>' - -" Expression used to check whether we should skip a match with searchpair(). -let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'" - -let s:line_term = '\s*\%(\%(\/\/\).*\)\=$' - -" Regex that defines continuation lines, not including (, {, or [. -let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)' . s:line_term - -" Regex that defines continuation lines. -" TODO: this needs to deal with if ...: and so on -let s:msl_regex = '\%([\\*+/.:([]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)' . s:line_term - -let s:one_line_scope_regex = '\<\%(if\|else\|for\|while\)\>[^{;]*' . s:line_term - -" Regex that defines blocks. -let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term - -" 2. Auxiliary Functions {{{1 -" ====================== - -" Check if the character at lnum:col is inside a string, comment, or is ascii. -function s:IsInStringOrComment(lnum, col) - return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_strcom -endfunction - -" Check if the character at lnum:col is inside a string. -function s:IsInString(lnum, col) - return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_string -endfunction - -" Check if the character at lnum:col is inside a string or documentation. -function s:IsInStringOrDocumentation(lnum, col) - return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_stringdoc -endfunction - -" Find line above 'lnum' that isn't empty, in a comment, or in a string. -function s:PrevNonBlankNonString(lnum) - let in_block = 0 - let lnum = prevnonblank(a:lnum) - while lnum > 0 - " Go in and out of blocks comments as necessary. - " If the line isn't empty (with opt. comment) or in a string, end search. - let line = getline(lnum) - if line =~ '/\*' - if in_block - let in_block = 0 - else - break - endif - elseif !in_block && line =~ '\*/' - let in_block = 1 - elseif !in_block && line !~ '^\s*\%(//\).*$' && !(s:IsInStringOrComment(lnum, 1) && s:IsInStringOrComment(lnum, strlen(line))) - break - endif - let lnum = prevnonblank(lnum - 1) - endwhile - return lnum -endfunction - -" Find line above 'lnum' that started the continuation 'lnum' may be part of. -function s:GetMSL(lnum, in_one_line_scope) - " Start on the line we're at and use its indent. - let msl = a:lnum - let lnum = s:PrevNonBlankNonString(a:lnum - 1) - while lnum > 0 - " If we have a continuation line, or we're in a string, use line as MSL. - " Otherwise, terminate search as we have found our MSL already. - let line = getline(lnum) - let col = match(line, s:msl_regex) + 1 - if (col > 0 && !s:IsInStringOrComment(lnum, col)) || s:IsInString(lnum, strlen(line)) - let msl = lnum - else - " Don't use lines that are part of a one line scope as msl unless the - " flag in_one_line_scope is set to 1 - " - if a:in_one_line_scope - break - end - let msl_one_line = s:Match(lnum, s:one_line_scope_regex) - if msl_one_line == 0 - break - endif - endif - let lnum = s:PrevNonBlankNonString(lnum - 1) - endwhile - return msl -endfunction - -" Check if line 'lnum' has more opening brackets than closing ones. -function s:LineHasOpeningBrackets(lnum) - let open_0 = 0 - let open_2 = 0 - let open_4 = 0 - let line = getline(a:lnum) - let pos = match(line, '[][(){}]', 0) - while pos != -1 - if !s:IsInStringOrComment(a:lnum, pos + 1) - let idx = stridx('(){}[]', line[pos]) - if idx % 2 == 0 - let open_{idx} = open_{idx} + 1 - else - let open_{idx - 1} = open_{idx - 1} - 1 - endif - endif - let pos = match(line, '[][(){}]', pos + 1) - endwhile - return (open_0 > 0) . (open_2 > 0) . (open_4 > 0) -endfunction - -function s:Match(lnum, regex) - let col = match(getline(a:lnum), a:regex) + 1 - return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0 -endfunction - -function s:IndentWithContinuation(lnum, ind, width) - " Set up variables to use and search for MSL to the previous line. - let p_lnum = a:lnum - let lnum = s:GetMSL(a:lnum, 1) - let line = getline(line) - - " If the previous line wasn't a MSL and is continuation return its indent. - " TODO: the || s:IsInString() thing worries me a bit. - if p_lnum != lnum - if s:Match(p_lnum,s:continuation_regex)||s:IsInString(p_lnum,strlen(line)) - return a:ind + a:width - endif - endif - - " Set up more variables now that we know we aren't continuation bound. - let msl_ind = indent(lnum) - - " If the previous line ended with [*+/.-=], start a continuation that - " indents an extra level. - if s:Match(lnum, s:continuation_regex) - if lnum == p_lnum - return msl_ind + a:width - else - return msl_ind - endif - endif - - return a:ind -endfunction - -function s:InOneLineScope(lnum) - let msl = s:GetMSL(a:lnum, 1) - if msl > 0 && s:Match(msl, s:one_line_scope_regex) - return msl - endif - return 0 -endfunction - -function s:ExitingOneLineScope(lnum) - let msl = s:GetMSL(a:lnum, 1) - if msl > 0 - " if the current line is in a one line scope .. - if s:Match(msl, s:one_line_scope_regex) - return 0 - else - let prev_msl = s:GetMSL(msl - 1, 1) - if s:Match(prev_msl, s:one_line_scope_regex) - return prev_msl - endif - endif - endif - return 0 -endfunction - -" 3. GetJavascriptIndent Function {{{1 -" ========================= - -function GetJavascriptIndent() - " 3.1. Setup {{{2 - " ---------- - - " Set up variables for restoring position in file. Could use v:lnum here. - let vcol = col('.') - - " 3.2. Work on the current line {{{2 - " ----------------------------- - - " Get the current line. - let line = getline(v:lnum) - let ind = -1 - - - " If we got a closing bracket on an empty line, find its match and indent - " according to it. For parentheses we indent to its column - 1, for the - " others we indent to the containing line's MSL's level. Return -1 if fail. - let col = matchend(line, '^\s*[]})]') - if col > 0 && !s:IsInStringOrComment(v:lnum, col) - call cursor(v:lnum, col) - let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2) - if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0 - if line[col-1]==')' && col('.') != col('$') - 1 - let ind = virtcol('.')-1 - else - let ind = indent(s:GetMSL(line('.'), 0)) - endif - endif - return ind - endif - - " If we have a /* or */ set indent to first column. - if match(line, '^\s*\%(/\*\|\*/\)$') != -1 - return 0 - endif - - " If we are in a multi-line string or line-comment, don't do anything to it. - if s:IsInStringOrDocumentation(v:lnum, matchend(line, '^\s*') + 1) - return indent('.') - endif - - " 3.3. Work on the previous line. {{{2 - " ------------------------------- - - " Find a non-blank, non-multi-line string line above the current line. - let lnum = s:PrevNonBlankNonString(v:lnum - 1) - - " If the line is empty and inside a string, use the previous line. - if line =~ '^\s*$' && lnum != prevnonblank(v:lnum - 1) - return indent(prevnonblank(v:lnum)) - endif - - " At the start of the file use zero indent. - if lnum == 0 - return 0 - endif - - " Set up variables for current line. - let line = getline(lnum) - let ind = indent(lnum) - - " If the previous line ended with a block opening, add a level of indent. - if s:Match(lnum, s:block_regex) - return indent(s:GetMSL(lnum, 0)) + &sw - endif - - " If the previous line contained an opening bracket, and we are still in it, - " add indent depending on the bracket type. - if line =~ '[[({]' - let counts = s:LineHasOpeningBrackets(lnum) - if counts[0] == '1' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0 - if col('.') + 1 == col('$') - return ind + &sw - else - return virtcol('.') - endif - elseif counts[1] == '1' || counts[2] == '1' - return ind + &sw - else - call cursor(v:lnum, vcol) - end - endif - - " 3.4. Work on the MSL line. {{{2 - " -------------------------- - - let ind_con = ind - let ind = s:IndentWithContinuation(lnum, ind_con, &sw) - - " }}}2 - " - " - let ols = s:InOneLineScope(lnum) - if ols > 0 - let ind = ind + &sw - else - let ols = s:ExitingOneLineScope(lnum) - while ols > 0 && ind > 0 - let ind = ind - &sw - let ols = s:InOneLineScope(ols - 1) - endwhile - endif - - return ind -endfunction - -" }}}1 - -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim:set sw=2 sts=2 ts=8 noet: - diff --git a/.vim/indent/mako.vim b/.vim/indent/mako.vim deleted file mode 100644 index bd85ac5..0000000 --- a/.vim/indent/mako.vim +++ /dev/null @@ -1,353 +0,0 @@ -" Vim indent file -" Language: Mako -" Author: Scott Torborg <storborg@mit.edu> -" Version: 0.4 -" License: Do What The Fuck You Want To Public License (WTFPL) -" -" --------------------------------------------------------------------------- -" -" DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE -" Version 2, December 2004 -" -" Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> -" -" Everyone is permitted to copy and distribute verbatim or modified -" copies of this license document, and changing it is allowed as long -" as the name is changed. -" -" DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE -" TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -" -" 0. You just DO WHAT THE FUCK YOU WANT TO. -" -" --------------------------------------------------------------------------- -" -" This script does more useful indenting for Mako HTML templates. It indents -" inside of control blocks, defs, etc. Note that this indenting style will -" sacrifice readability of the output text for the sake of readability of the -" template. -" -" We'll use HTML indenting globally, python inside <% %> blocks. Inspired by -" the excellent PHP + HTML indentation files such as php.vim by Pim Snel. -" -" Changelog: -" 0.4 - 5 March 2010 -" - Added license information -" 0.3 - 15 September 2009 -" - Added explicit indenting for ## comments, fixed unindenting count, -" thanks to Mike Lewis (@MikeRLewis) for this -" 0.2 - 15 June 2009 -" - Fixed issue where opening and closing mako tags on the same line -" would cause incorrect indenting -" 0.1 - 06 June 2009 -" - Initial public release of mako indent file - -let sw=2 " default shiftwidth of 2 spaces - -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -setlocal nosmartindent -setlocal noautoindent -setlocal nocindent -setlocal nolisp - -setlocal indentexpr=GetMakoIndent() -setlocal indentkeys+=*<Return>,<>>,<bs>,end,: - -" Only define the function once. -if exists("*GetMakoIndent") - finish -endif - -if exists('g:html_indent_tags') - unlet g:html_indent_tags -endif - -function IsInsidePythonBlock(startline) - " Loop until we get a line that's either <% or %> - let lnum = a:startline - while getline(lnum) !~ '\(%>\|<%\)$' && lnum > 0 - let lnum = lnum - 1 - endwhile - - " lnum points to the last control. If it's a <% then we're inside an - " embedded python block, otherwise we're not. - return getline(lnum) =~ '<%$' -endfunction - -function GetMakoIndent() - " Find a non-empty line above the current line - let lnum = prevnonblank(v:lnum - 1) - - " Hit the start of the file, use zero indent. - if lnum == 0 - return 0 - endif - - let line = getline(lnum) " last line - let cline = getline(v:lnum) " current line - let pline = getline(lnum - 1) " previous to last line - let ind = indent(lnum) - if line =~ '^\s*##' - return indent(lnum) - end - - let restore_ic=&ic - let &ic=1 " ignore case - - let ind = <SID>HtmlIndentSum(lnum, -1) - let ind = <SID>HtmlIndentSum(lnum, -1) - let ind = ind + <SID>HtmlIndentSum(v:lnum, 0) - - let &ic=restore_ic - - let ind = indent(lnum) + (&sw * ind) - - " Indent after %anything: or <%anything NOT ending in /> - if line =~ '^\s*%.*:\s*$' - let ind = ind + &sw - endif - - " Unindent before %end* or </%anything - if cline =~ '^\s*%\s*end' - let ind = ind - &sw - endif - " - " Unindent before %else, %except, and %elif - if cline =~ '^\s*%\s*else' || cline =~ '^\s*%\s*except' || cline =~ '^\s*%\s*elif' - let ind = ind - &sw - endif - - " Indent at the beginning of a python control block - if line =~ '<%$' - let ind = ind + &sw - endif - " - " Unindent at the end of the python block. - if cline =~ '^\s*%>$' - let scanlnum = lnum - " Scan backwards until we find the beginning of this python block. - while getline(scanlnum) !~ '<%$' && scanlnum > 0 - let scanlnum = scanlnum - 1 - endwhile - let ind = indent(scanlnum) - endif - - " If we're inside a python block and the previous line ends in a colon, - " indent. - if IsInsidePythonBlock(lnum - 1) - " Indent after : - if line =~ '\:$' - let ind = ind + &sw - endif - endif - - return ind -endfunction - - -" [-- helper function to assemble tag list --] -fun! <SID>HtmlIndentPush(tag) - if exists('g:html_indent_tags') - let g:html_indent_tags = g:html_indent_tags.'\|'.a:tag - else - let g:html_indent_tags = a:tag - endif -endfun - -fun! <SID>MakoIndentPush(tag) - if exists('g:mako_indent_tags') - let g:mako_indent_tags = g:mako_indent_tags.'\|'.a:tag - else - let g:mako_indent_tags = a:tag - endif -endfun - -" [-- <ELEMENT ? - - ...> --] -call <SID>HtmlIndentPush('a') -call <SID>HtmlIndentPush('abbr') -call <SID>HtmlIndentPush('acronym') -call <SID>HtmlIndentPush('address') -call <SID>HtmlIndentPush('b') -call <SID>HtmlIndentPush('bdo') -call <SID>HtmlIndentPush('big') -call <SID>HtmlIndentPush('blockquote') -call <SID>HtmlIndentPush('button') -call <SID>HtmlIndentPush('caption') -call <SID>HtmlIndentPush('center') -call <SID>HtmlIndentPush('cite') -call <SID>HtmlIndentPush('code') -call <SID>HtmlIndentPush('colgroup') -call <SID>HtmlIndentPush('del') -call <SID>HtmlIndentPush('dfn') -call <SID>HtmlIndentPush('dir') -call <SID>HtmlIndentPush('div') -call <SID>HtmlIndentPush('dl') -call <SID>HtmlIndentPush('em') -call <SID>HtmlIndentPush('fieldset') -call <SID>HtmlIndentPush('font') -call <SID>HtmlIndentPush('form') -call <SID>HtmlIndentPush('frameset') -call <SID>HtmlIndentPush('h1') -call <SID>HtmlIndentPush('h2') -call <SID>HtmlIndentPush('h3') -call <SID>HtmlIndentPush('h4') -call <SID>HtmlIndentPush('h5') -call <SID>HtmlIndentPush('h6') -call <SID>HtmlIndentPush('i') -call <SID>HtmlIndentPush('iframe') -call <SID>HtmlIndentPush('ins') -call <SID>HtmlIndentPush('kbd') -call <SID>HtmlIndentPush('label') -call <SID>HtmlIndentPush('legend') -call <SID>HtmlIndentPush('map') -call <SID>HtmlIndentPush('menu') -call <SID>HtmlIndentPush('noframes') -call <SID>HtmlIndentPush('noscript') -call <SID>HtmlIndentPush('object') -call <SID>HtmlIndentPush('ol') -call <SID>HtmlIndentPush('optgroup') -call <SID>HtmlIndentPush('pre') -call <SID>HtmlIndentPush('q') -call <SID>HtmlIndentPush('s') -call <SID>HtmlIndentPush('samp') -call <SID>HtmlIndentPush('script') -call <SID>HtmlIndentPush('select') -call <SID>HtmlIndentPush('small') -call <SID>HtmlIndentPush('span') -call <SID>HtmlIndentPush('strong') -call <SID>HtmlIndentPush('style') -call <SID>HtmlIndentPush('sub') -call <SID>HtmlIndentPush('sup') -call <SID>HtmlIndentPush('table') -call <SID>HtmlIndentPush('textarea') -call <SID>HtmlIndentPush('title') -call <SID>HtmlIndentPush('tt') -call <SID>HtmlIndentPush('u') -call <SID>HtmlIndentPush('ul') -call <SID>HtmlIndentPush('var') - -" For some reason the default HTML indentation script doesn't consider these -" elements to be worthy of indentation. -call <SID>HtmlIndentPush('p') -call <SID>HtmlIndentPush('dt') -call <SID>HtmlIndentPush('dd') - - -" [-- <ELEMENT ? O O ...> --] -if !exists('g:html_indent_strict') - call <SID>HtmlIndentPush('body') - call <SID>HtmlIndentPush('head') - call <SID>HtmlIndentPush('html') - call <SID>HtmlIndentPush('tbody') -endif - - -" [-- <ELEMENT ? O - ...> --] -if !exists('g:html_indent_strict_table') - call <SID>HtmlIndentPush('th') - call <SID>HtmlIndentPush('td') - call <SID>HtmlIndentPush('tr') - call <SID>HtmlIndentPush('tfoot') - call <SID>HtmlIndentPush('thead') -endif - -" [-- <Mako Elements> --] -call <SID>MakoIndentPush('%def') -call <SID>MakoIndentPush('%call') -call <SID>MakoIndentPush('%doc') -call <SID>MakoIndentPush('%text') -call <SID>MakoIndentPush('%.\+:.\+') - -delfun <SID>HtmlIndentPush -delfun <SID>MakoIndentPush - -set cpo-=C - -" [-- get number of regex matches in a string --] -fun! <SID>MatchCount(expr, pat) - let mpos = 0 - let mcount = 0 - let expr = a:expr - while (mpos > -1) - let mend = matchend(expr, a:pat) - if mend > -1 - let mcount = mcount + 1 - endif - if mend == mpos - let mpos = mpos + 1 - else - let mpos = mend - endif - let expr = strpart(expr, mpos) - endwhile - return mcount -endfun - -" [-- count indent-increasing tags of line a:lnum --] -fun! <SID>HtmlIndentOpen(lnum) - let s = substitute('x'.getline(a:lnum), - \ '.\{-}\(\(<\)\('.g:html_indent_tags.'\)\>\)', "\1", 'g') - let s = substitute(s, "[^\1].*$", '', '') - return strlen(s) -endfun - -" [-- count indent-decreasing tags of line a:lnum --] -fun! <SID>HtmlIndentClose(lnum) - let s = substitute('x'.getline(a:lnum), - \ '.\{-}\(\(<\)/\('.g:html_indent_tags.'\)\>>\)', "\1", 'g') - let s = substitute(s, "[^\1].*$", '', '') - return strlen(s) -endfun - -" [-- count indent-increasing mako tags of line a:lnum --] -fun! <SID>MakoIndentOpen(lnum) - let s = substitute('x'.getline(a:lnum), - \ '.\{-}\(\(<\)\('.g:mako_indent_tags.'\)\>\)', "\1", 'g') - let s = substitute(s, "[^\1].*$", '', '') - return strlen(s) -endfun - -" [-- count indent-decreasing mako tags of line a:lnum --] -fun! <SID>MakoIndentClose(lnum) - let mcount = <SID>MatchCount(getline(a:lnum), '</\('.g:mako_indent_tags.'\)>') - let mcount = mcount + <SID>MatchCount(getline(a:lnum), '<\('.g:mako_indent_tags.'\)[^>]*/>') - return mcount -endfun - -" [-- count indent-increasing '{' of (java|css) line a:lnum --] -fun! <SID>HtmlIndentOpenAlt(lnum) - return strlen(substitute(getline(a:lnum), '[^{]\+', '', 'g')) -endfun - -" [-- count indent-decreasing '}' of (java|css) line a:lnum --] -fun! <SID>HtmlIndentCloseAlt(lnum) - return strlen(substitute(getline(a:lnum), '[^}]\+', '', 'g')) -endfun - -" [-- return the sum of indents respecting the syntax of a:lnum --] -fun! <SID>HtmlIndentSum(lnum, style) - let open = <SID>HtmlIndentOpen(a:lnum) + <SID>MakoIndentOpen(a:lnum) - let close = <SID>HtmlIndentClose(a:lnum) + <SID>MakoIndentClose(a:lnum) - if a:style == match(getline(a:lnum), '^\s*</') - if a:style == match(getline(a:lnum), '^\s*</\('.g:html_indent_tags.'\|'.g:mako_indent_tags.'\)') - if 0 != open || 0 != close - return open - close - endif - endif - endif - if '' != &syntax && - \ synIDattr(synID(a:lnum, 1, 1), 'name') =~ '\(css\|java\).*' && - \ synIDattr(synID(a:lnum, strlen(getline(a:lnum)) - 1, 1), 'name') - \ =~ '\(css\|java\).*' - if a:style == match(getline(a:lnum), '^\s*}') - return <SID>HtmlIndentOpenAlt(a:lnum) - <SID>HtmlIndentCloseAlt(a:lnum) - endif - endif - return 0 -endfun - -" vim: set ts=4 sw=4: diff --git a/.vim/indent/python.vim b/.vim/indent/python.vim deleted file mode 100644 index 32c773c..0000000 --- a/.vim/indent/python.vim +++ /dev/null @@ -1,196 +0,0 @@ -" Python indent file -" Language: Python -" Maintainer: Eric Mc Sween <em@tomcom.de> -" Original Author: David Bustos <bustos@caltech.edu> -" Last Change: 2004 Jun 07 - -" Only load this indent file when no other was loaded. -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -setlocal expandtab -setlocal nolisp -setlocal autoindent -setlocal indentexpr=GetPythonIndent(v:lnum) -setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif,=except - -let s:maxoff = 50 - -" Find backwards the closest open parenthesis/bracket/brace. -function! s:SearchParensPair() - let line = line('.') - let col = col('.') - - " Skip strings and comments and don't look too far - let skip = "line('.') < " . (line - s:maxoff) . " ? dummy :" . - \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? ' . - \ '"string\\|comment"' - - " Search for parentheses - call cursor(line, col) - let parlnum = searchpair('(', '', ')', 'bW', skip) - let parcol = col('.') - - " Search for brackets - call cursor(line, col) - let par2lnum = searchpair('\[', '', '\]', 'bW', skip) - let par2col = col('.') - - " Search for braces - call cursor(line, col) - let par3lnum = searchpair('{', '', '}', 'bW', skip) - let par3col = col('.') - - " Get the closest match - if par2lnum > parlnum || (par2lnum == parlnum && par2col > parcol) - let parlnum = par2lnum - let parcol = par2col - endif - if par3lnum > parlnum || (par3lnum == parlnum && par3col > parcol) - let parlnum = par3lnum - let parcol = par3col - endif - - " Put the cursor on the match - if parlnum > 0 - call cursor(parlnum, parcol) - endif - return parlnum -endfunction - -" Find the start of a multi-line statement -function! s:StatementStart(lnum) - let lnum = a:lnum - while 1 - if getline(lnum - 1) =~ '\\$' - let lnum = lnum - 1 - else - call cursor(lnum, 1) - let maybe_lnum = s:SearchParensPair() - if maybe_lnum < 1 - return lnum - else - let lnum = maybe_lnum - endif - endif - endwhile -endfunction - -" Find the block starter that matches the current line -function! s:BlockStarter(lnum, block_start_re) - let lnum = a:lnum - let maxindent = 10000 " whatever - while lnum > 1 - let lnum = prevnonblank(lnum - 1) - if indent(lnum) < maxindent - if getline(lnum) =~ a:block_start_re - return lnum - else - let maxindent = indent(lnum) - " It's not worth going further if we reached the top level - if maxindent == 0 - return -1 - endif - endif - endif - endwhile - return -1 -endfunction - -function! GetPythonIndent(lnum) - - " First line has indent 0 - if a:lnum == 1 - return 0 - endif - - " If we can find an open parenthesis/bracket/brace, line up with it. - call cursor(a:lnum, 1) - let parlnum = s:SearchParensPair() - if parlnum > 0 - let parcol = col('.') - let closing_paren = match(getline(a:lnum), '^\s*[])}]') != -1 - if match(getline(parlnum), '[([{]\s*$', parcol - 1) != -1 - if closing_paren - return indent(parlnum) - else - return indent(parlnum) + &shiftwidth - endif - else - if closing_paren - return parcol - 1 - else - return parcol - endif - endif - endif - - " Examine this line - let thisline = getline(a:lnum) - let thisindent = indent(a:lnum) - - " If the line starts with 'elif' or 'else', line up with 'if' or 'elif' - if thisline =~ '^\s*\(elif\|else\)\>' - let bslnum = s:BlockStarter(a:lnum, '^\s*\(if\|elif\)\>') - if bslnum > 0 - return indent(bslnum) - else - return -1 - endif - endif - - " If the line starts with 'except' or 'finally', line up with 'try' - " or 'except' - if thisline =~ '^\s*\(except\|finally\)\>' - let bslnum = s:BlockStarter(a:lnum, '^\s*\(try\|except\)\>') - if bslnum > 0 - return indent(bslnum) - else - return -1 - endif - endif - - " Examine previous line - let plnum = a:lnum - 1 - let pline = getline(plnum) - let sslnum = s:StatementStart(plnum) - - " If the previous line is blank, keep the same indentation - if pline =~ '^\s*$' - return -1 - endif - - " If this line is explicitly joined, try to find an indentation that looks - " good. - if pline =~ '\\$' - let compound_statement = '^\s*\(if\|while\|for\s.*\sin\|except\)\s*' - let maybe_indent = matchend(getline(sslnum), compound_statement) - if maybe_indent != -1 - return maybe_indent - else - return indent(sslnum) + &sw * 2 - endif - endif - - " If the previous line ended with a colon, indent relative to - " statement start. - if pline =~ ':\s*$' - return indent(sslnum) + &sw - endif - - " If the previous line was a stop-execution statement or a pass - if getline(sslnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>' - " See if the user has already dedented - if indent(a:lnum) > indent(sslnum) - &sw - " If not, recommend one dedent - return indent(sslnum) - &sw - endif - " Otherwise, trust the user - return -1 - endif - - " In all other cases, line up with the start of the previous statement. - return indent(sslnum) -endfunction diff --git a/.vim/indent/scala.vim b/.vim/indent/scala.vim deleted file mode 100644 index 2363b6b..0000000 --- a/.vim/indent/scala.vim +++ /dev/null @@ -1,85 +0,0 @@ -" Vim indent file -" Language : Scala (http://scala-lang.org/) -" Maintainer : Stefan Matthias Aust -" Last Change: 2006 Apr 13 -" Revision : $Id$ -" $URL$ - -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -setlocal indentexpr=GetScalaIndent() - -setlocal indentkeys=0{,0},0),!^F,<>>,<CR> - -setlocal autoindent sw=2 et - -if exists("*GetScalaIndent") - finish -endif - -function! CountParens(line) - let line = substitute(a:line, '"\(.\|\\"\)*"', '', 'g') - let open = substitute(line, '[^(]', '', 'g') - let close = substitute(line, '[^)]', '', 'g') - return strlen(open) - strlen(close) -endfunction - -function! GetScalaIndent() - " Find a non-blank line above the current line. - let lnum = prevnonblank(v:lnum - 1) - - " Hit the start of the file, use zero indent. - if lnum == 0 - return 0 - endif - - let ind = indent(lnum) - let prevline = getline(lnum) - - "Indent html literals - if prevline !~ '/>\s*$' && prevline =~ '^\s*<[a-zA-Z][^>]*>\s*$' - return ind + &shiftwidth - endif - - " Add a 'shiftwidth' after lines that start a block - " If if, for or while end with ), this is a one-line block - " If val, var, def end with =, this is a one-line block - if prevline =~ '^\s*\<\(\(else\s\+\)\?if\|for\|while\|va[lr]\|def\)\>.*[)=]\s*$' - \ || prevline =~ '^\s*\<else\>\s*$' - \ || prevline =~ '{\s*$' - let ind = ind + &shiftwidth - endif - - " If parenthesis are unbalanced, indent or dedent - let c = CountParens(prevline) - echo c - if c > 0 - let ind = ind + &shiftwidth - elseif c < 0 - let ind = ind - &shiftwidth - endif - - " Dedent after if, for, while and val, var, def without block - let pprevline = getline(prevnonblank(lnum - 1)) - if pprevline =~ '^\s*\<\(\(else\s\+\)\?if\|for\|while\|va[lr]\|def\)\>.*[)=]\s*$' - \ || pprevline =~ '^\s*\<else\>\s*$' - let ind = ind - &shiftwidth - endif - - " Align 'for' clauses nicely - if prevline =~ '^\s*\<for\> (.*;\s*$' - let ind = ind - &shiftwidth + 5 - endif - - " Subtract a 'shiftwidth' on '}' or html - let thisline = getline(v:lnum) - if thisline =~ '^\s*[})]' - \ || thisline =~ '^\s*</[a-zA-Z][^>]*>' - let ind = ind - &shiftwidth - endif - - return ind -endfunction diff --git a/.vim/init.vim b/.vim/init.vim deleted file mode 100644 index f182e5b..0000000 --- a/.vim/init.vim +++ /dev/null @@ -1,3 +0,0 @@ -set runtimepath^=~/.vim runtimepath+=~/.vim/after -let &packpath = &runtimepath -source ~/.vimrc diff --git a/.vim/lua/lir_setup.lua b/.vim/lua/lir_setup.lua deleted file mode 100644 index e559e37..0000000 --- a/.vim/lua/lir_setup.lua +++ /dev/null @@ -1,88 +0,0 @@ -local actions = require 'lir.actions' -local mark_actions = require 'lir.mark.actions' -local clipboard_actions = require 'lir.clipboard.actions' - -require 'lir'.setup { - show_hidden_files = false, - ignore = { ".DS_Store" }, -- { ".DS_Store", "node_modules" } etc. - devicons = { - enable = true, - highlight_dirname = true - }, - mappings = { - ['l'] = actions.edit, - ['<CR>'] = actions.edit, - ['<C-s>'] = actions.split, - ['<C-v>'] = actions.vsplit, - ['<C-t>'] = actions.tabedit, - - ['h'] = actions.up, - ['q'] = actions.quit, - - ['K'] = actions.mkdir, - ['N'] = actions.newfile, - ['R'] = actions.rename, - ['@'] = actions.cd, - ['Y'] = actions.yank_path, - ['.'] = actions.toggle_show_hidden, - ['D'] = actions.delete, - - ['J'] = function() - mark_actions.toggle_mark() - vim.cmd('normal! j') - end, - ['C'] = clipboard_actions.copy, - ['X'] = clipboard_actions.cut, - ['P'] = clipboard_actions.paste, - }, - float = { - winblend = 0, - curdir_window = { - enable = false, - highlight_dirname = false - }, - - -- -- You can define a function that returns a table to be passed as the third - -- -- argument of nvim_open_win(). - -- win_opts = function() - -- local width = math.floor(vim.o.columns * 0.8) - -- local height = math.floor(vim.o.lines * 0.8) - -- return { - -- border = { - -- "+", "─", "+", "│", "+", "─", "+", "│", - -- }, - -- width = width, - -- height = height, - -- row = 1, - -- col = math.floor((vim.o.columns - width) / 2), - -- } - -- end, - }, - hide_cursor = true -} - -vim.api.nvim_create_autocmd({ 'FileType' }, { - pattern = { "lir" }, - callback = function() - -- use visual mode - vim.api.nvim_buf_set_keymap( - 0, - "x", - "J", - ':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>', - { noremap = true, silent = true } - ) - - -- echo cwd - -- vim.api.nvim_echo({ { vim.fn.expand("%:p"), "Normal" } }, false, {}) - end -}) - --- custom folder icon -require 'nvim-web-devicons'.set_icon({ - lir_folder_icon = { - icon = "", - color = "#7ebae4", - name = "LirFolderNode" - } -}) diff --git a/.vim/lua/lualine_setup.lua b/.vim/lua/lualine_setup.lua deleted file mode 100644 index b99cd3e..0000000 --- a/.vim/lua/lualine_setup.lua +++ /dev/null @@ -1,28 +0,0 @@ -require('lsp-progress').setup({ - -}) - -local config = { - sections = { - lualine_c = { - 'filename', - function() - return require('lsp-progress').progress() - end, - }, - lualine_x = { - 'filetype', - } - } -} - ---local function ins_left(component) ---table.insert(config.sections.lualine_c, component) ---end - ---ins_left({ ---'lsp_progress', ---display_components = { 'lsp_client_name', { 'percentage' } } ---}) - -require('lualine').setup(config) diff --git a/.vim/markdown_cheatsheet.md b/.vim/markdown_cheatsheet.md deleted file mode 100644 index d767f50..0000000 --- a/.vim/markdown_cheatsheet.md +++ /dev/null @@ -1,376 +0,0 @@ -vim: set syntax=markdown: - -This is intended as a quick reference and showcase. For more complete info, see [John Gruber's original spec](http://daringfireball.net/projects/markdown/) and the [Github-flavored Markdown info page](http://github.github.com/github-flavored-markdown/). - -Note that there is also a [Cheatsheet specific to Markdown Here](./Markdown-Here-Cheatsheet) if that's what you're looking for. - -You can play around with Markdown on our [live demo page](http://www.markdown-here.com/livedemo.html). - -##### Table of Contents -[Headers](#headers) -[Emphasis](#emphasis) -[Lists](#lists) -[Links](#links) -[Images](#images) -[Code and Syntax Highlighting](#code) -[Tables](#tables) -[Blockquotes](#blockquotes) -[Inline HTML](#html) -[Horizontal Rule](#hr) -[Line Breaks](#lines) -[Youtube videos](#videos) - -<a name="headers"/> -## Headers - -```no-highlight -# H1 -## H2 -### H3 -#### H4 -##### H5 -###### H6 - -Alternatively, for H1 and H2, an underline-ish style: - -Alt-H1 -====== - -Alt-H2 ------- -``` - -# H1 -## H2 -### H3 -#### H4 -##### H5 -###### H6 - -Alternatively, for H1 and H2, an underline-ish style: - -Alt-H1 -====== - -Alt-H2 ------- - -<a name="emphasis"/> -## Emphasis - -```no-highlight -Emphasis, aka italics, with *asterisks* or _underscores_. - -Strong emphasis, aka bold, with **asterisks** or __underscores__. - -Combined emphasis with **asterisks and _underscores_**. - -Strikethrough uses two tildes. ~~Scratch this.~~ -``` - -Emphasis, aka italics, with *asterisks* or _underscores_. - -Strong emphasis, aka bold, with **asterisks** or __underscores__. - -Combined emphasis with **asterisks and _underscores_**. - -Strikethrough uses two tildes. ~~Scratch this.~~ - - -<a name="lists"/> -## Lists - -```no-highlight -1. First ordered list item -2. Another item - * Unordered sub-list. -1. Actual numbers don't matter, just that it's a number - 1. Ordered sub-list -4. And another item. - - Some text that should be aligned with the above item. - -* Unordered list can use asterisks -- Or minuses -+ Or pluses -``` - -1. First ordered list item -2. Another item - * Unordered sub-list. -1. Actual numbers don't matter, just that it's a number - 1. Ordered sub-list -4. And another item. - - Some text that should be aligned with the above item. - -* Unordered list can use asterisks -- Or minuses -+ Or pluses - -<a name="links"/> -## Links - -There are two ways to create links. - -```no-highlight -[I'm an inline-style link](https://www.google.com) - -[I'm a reference-style link][Arbitrary case-insensitive reference text] - -[I'm a relative reference to a repository file](../blob/master/LICENSE) - -[You can use numbers for reference-style link definitions][1] - -Or leave it empty and use the [link text itself][] - -Some text to show that the reference links can follow later. - -[arbitrary case-insensitive reference text]: https://www.mozilla.org -[1]: http://slashdot.org -[link text itself]: http://www.reddit.com -``` - -[I'm an inline-style link](https://www.google.com) - -[I'm a reference-style link][Arbitrary case-insensitive reference text] - -[I'm a relative reference to a repository file](../blob/master/LICENSE) - -[You can use numbers for reference-style link definitions][1] - -Or leave it empty and use the [link text itself][] - -Some text to show that the reference links can follow later. - -[arbitrary case-insensitive reference text]: https://www.mozilla.org -[1]: http://slashdot.org -[link text itself]: http://www.reddit.com - -<a name="images"/> -## Images - -```no-highlight -Here's our logo (hover to see the title text): - -Inline-style: -![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1") - -Reference-style: -![alt text][logo] - -[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 2" -``` - -Here's our logo (hover to see the title text): - -Inline-style: -![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1") - -Reference-style: -![alt text][logo] - -[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 2" - -<a name="code"/> -## Code and Syntax Highlighting - -Code blocks are part of the Markdown spec, but syntax highlighting isn't. However, many renderers -- like Github's and *Markdown Here* -- support syntax highlighting. *Markdown Here* supports highlighting for dozens of languages (and not-really-languages, like diffs and HTTP headers); to see the complete list, and how to write the language names, see the [highlight.js demo page](http://softwaremaniacs.org/media/soft/highlight/test.html). - -```no-highlight -Inline `code` has `back-ticks around` it. -``` - -Inline `code` has `back-ticks around` it. - -Blocks of code are either fenced by lines with three back-ticks <code>```</code>, or are indented with four spaces. I recommend only using the fenced code blocks -- they're easier and only they support syntax highlighting. - -```no-highlight - ```javascript - var s = "JavaScript syntax highlighting"; - alert(s); - ``` - - ```python - s = "Python syntax highlighting" - print s - ``` - - ``` - No language indicated, so no syntax highlighting. - But let's throw in a <b>tag</b>. - ``` -``` - -```javascript -var s = "JavaScript syntax highlighting"; -alert(s); -``` - -```python -s = "Python syntax highlighting" -print s -``` - -``` -No language indicated, so no syntax highlighting in Markdown Here (varies on Github). -But let's throw in a <b>tag</b>. -``` - -(Github Wiki pages don't seem to support syntax highlighting, so the above won't be colourful (the strings are not red, for example). Try it out in a *Markdown Here* email or a Github Markdown README or Github Issue -- you can preview a new Issue without submitting it.) - -Again, to see what languages are available for highlighting, and how to write those language names, see the [highlight.js demo page](http://softwaremaniacs.org/media/soft/highlight/test.html). - -<a name="tables"/> -## Tables - -Tables aren't part of the core Markdown spec, but they are part of GFM and *Markdown Here* supports them. They are an easy way of adding tables to your email -- a task that would otherwise require copy-pasting from another application. - -```no-highlight -Colons can be used to align columns. - -| Tables | Are | Cool | -| ------------- |:-------------:| -----:| -| col 3 is | right-aligned | $1600 | -| col 2 is | centered | $12 | -| zebra stripes | are neat | $1 | - -The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown. - -Markdown | Less | Pretty ---- | --- | --- -*Still* | `renders` | **nicely** -1 | 2 | 3 -``` - -Colons can be used to align columns. - -| Tables | Are | Cool | -| ------------- |:-------------:| -----:| -| col 3 is | right-aligned | $1600 | -| col 2 is | centered | $12 | -| zebra stripes | are neat | $1 | - -The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown. - -Markdown | Less | Pretty ---- | --- | --- -*Still* | `renders` | **nicely** -1 | 2 | 3 - -<a name="blockquotes"/> -## Blockquotes - -```no-highlight -> Blockquotes are very handy in email to emulate reply text. -> This line is part of the same quote. - -Quote break. - -> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote. -``` - -> Blockquotes are very handy in email to emulate reply text. -> This line is part of the same quote. - -Quote break. - -> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote. - -<a name="html"/> -## Inline HTML - -You can also use raw HTML in your Markdown, and it'll mostly work pretty well. - -```no-highlight -<dl> - <dt>Definition list</dt> - <dd>Is something people use sometimes.</dd> - - <dt>Markdown in HTML</dt> - <dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd> -</dl> -``` - -<dl> - <dt>Definition list</dt> - <dd>Is something people use sometimes.</dd> - - <dt>Markdown in HTML</dt> - <dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd> -</dl> - -<a name="hr"/> -## Horizontal Rule - -``` -Three or more... - ---- - -Hyphens - -*** - -Asterisks - -___ - -Underscores -``` - -Three or more... - ---- - -Hyphens - -*** - -Asterisks - -___ - -Underscores - -<a name="lines"/> -## Line Breaks - -My basic recommendation for learning how line breaks work is to experiment and discover -- hit <Enter> once (i.e., insert one newline), then hit it twice (i.e., insert two newlines), see what happens. You'll soon learn to get what you want. "Markdown Toggle" is your friend. - -Here are some things to try out: - -``` -Here's a line for us to start with. - -This line is separated from the one above by two newlines, so it will be a *separate paragraph*. - -This line is also a separate paragraph, but... -This line is only separated by a single newline, so it's a separate line in the *same paragraph*. -``` - -Here's a line for us to start with. - -This line is separated from the one above by two newlines, so it will be a *separate paragraph*. - -This line is also begins a separate paragraph, but... -This line is only separated by a single newline, so it's a separate line in the *same paragraph*. - -(Technical note: *Markdown Here* uses GFM line breaks, so there's no need to use MD's two-space line breaks.) - -<a name="videos"/> -## Youtube videos - -They can't be added directly but you can add an image with a link to the video like this: - -```no-highlight -<a href="http://www.youtube.com/watch?feature=player_embedded&v=YOUTUBE_VIDEO_ID_HERE -" target="_blank"><img src="http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg" -alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a> -``` - -Or, in pure Markdown, but losing the image sizing and border: - -```no-highlight -[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg)](http://www.youtube.com/watch?v=YOUTUBE_VIDEO_ID_HERE) -``` diff --git a/.vim/nvim.lua b/.vim/nvim.lua deleted file mode 100644 index 272c22d..0000000 --- a/.vim/nvim.lua +++ /dev/null @@ -1,678 +0,0 @@ -require('nvim-autopairs').setup {} - --- nvim_lsp object -local nvim_lsp = require 'lspconfig' - --- function to attach completion when setting up lsp -local on_attach = function(client) -end - --- Set my preferred diagnostic options -local diagnostic_options = { - virtual_text = false, - signs = true, - update_in_insert = false, -} - -local rust_capabilities = vim.lsp.protocol.make_client_capabilities() -rust_capabilities.textDocument.completion.completionItem.snippetSupport = true -rust_capabilities.textDocument.completion.completionItem.resolveSupport = { - properties = { - 'documentation', - 'detail', - 'additionalTextEdits', - } -} - -local default_capabilities = vim.lsp.protocol.make_client_capabilities() -default_capabilities.textDocument.completion.completionItem.snippetSupport = true -default_capabilities.textDocument.completion.completionItem.resolveSupport = { - properties = { - 'documentation', - 'detail', - 'additionalTextEdits', - } -} - --- Enable rust_analyzer -nvim_lsp.rust_analyzer.setup({ - on_attach = function(client, bufnr) - client.server_capabilities.semanticTokensProvider = nil - end, - capabilities = rust_capabilities, - settings = { - ['rust-analyzer'] = { - checkOnSave = { - allFeatures = true, - overrideCommand = { - 'cargo', 'clippy', '--workspace', '--message-format=json', - '--all-targets', '--all-features' - } - }, - runnables = { - extraEnv = { - TORCH_CUDA_VERSION = "cu121", - } - } - } - } -}) -nvim_lsp.gopls.setup({ - on_attach = function(client, bufnr) - client.server_capabilities.semanticTokensProvider = { - full = true, - legend = { - --tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', }, - tokenTypes = { 'namespace' }, - tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', - 'modification', 'documentation', 'defaultLibrary', - }, - } - } - end, - settings = { - gopls = { - semanticTokens = true, - }, - }, -}) - -local function filter(arr, func) - -- Filter in place - -- https://stackoverflow.com/questions/49709998/how-to-filter-a-lua-array-inplace - local new_index = 1 - local size_orig = #arr - for old_index, v in ipairs(arr) do - if func(v, old_index) then - arr[new_index] = v - new_index = new_index + 1 - end - end - for i = new_index, size_orig do arr[i] = nil end -end - -local function pyright_accessed_filter(diagnostic) - -- Allow kwargs to be unused, sometimes you want many functions to take the - -- same arguments but you don't use all the arguments in all the functions, - -- so kwargs is used to suck up all the extras - if diagnostic.message == '"kwargs" is not accessed' then - return false - end - -- Allow variables starting with an underscore - if string.match(diagnostic.message, '"_.+" is not accessed') then - return false - end - - return true -end - -local function pyright_custom_diagnostic(a, params, client_id, c, config) - filter(params.diagnostics, pyright_accessed_filter) - vim.lsp.diagnostic.on_publish_diagnostics(a, params, client_id, c, config) -end - -nvim_lsp.pyright.setup({ - on_attach = function(client, bufnr) - vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(pyright_custom_diagnostic, diagnostic_options) - end -}) ---nvim_lsp.pyright.setup({ on_attach = on_attach }) ---nvim_lsp.pylsp.setup({ ---on_attach = on_attach, ---settings = { ---pylsp = { ---plugins = { ----- formatter options -----black = { enabled = true }, ---autopep8 = { enabled = false }, ---yapf = { enabled = false }, ----- linter options ---pylint = { enabled = false, executable = "pylint" }, ---pyflakes = { enabled = false }, ---pycodestyle = { enabled = false }, ----- type checker ---pylsp_mypy = { enabled = true }, ----- auto-completion options ---jedi_completion = { enabled = false }, ----- import sorting -----pyls_isort = { enabled = true }, -----flake8 = { -----maxLineLength = 100, -----}, ---pycodestyle = { ---maxLineLength = 100, ---}, -----rope_autoimport = { -----enabled = true -----}, -----rope_completion = { -----enabled = true -----}, ---} ---} ---} ---}) - -nvim_lsp.clangd.setup({ on_attach = on_attach }) -nvim_lsp.tsserver.setup { - cmd = { "/home/barak/.yarn/bin/typescript-language-server", "--stdio" } -} -nvim_lsp.vuels.setup { - cmd = { "/home/barak/.yarn/bin/vls" } -} -nvim_lsp.hls.setup { - cmd = { "haskell-language-server-wrapper", "--lsp" } -} - -nvim_lsp.svelte.setup { - cmd = { "/home/barak/.bun/bin/bunx", "svelteserver", "--stdio" } -} - -local runtime_path = vim.split(package.path, ';') -table.insert(runtime_path, "lua/?.lua") -table.insert(runtime_path, "lua/?/init.lua") - -require 'lspconfig'.lua_ls.setup { - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - -- Setup your lua path - path = runtime_path, - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { 'vim' }, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, - }, -} - - -require('go').setup({ - iferr_vertical_shift = 2 -}) - -require('telescope').load_extension('goimpl') - -function org_imports(wait_ms) - local params = vim.lsp.util.make_range_params() - - params.context = { only = { "source.organizeImports" } } - - local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, wait_ms) - - for _, res in pairs(result or {}) do - for _, r in pairs(res.result or {}) do - if r.edit then - vim.lsp.util.apply_workspace_edit(r.edit, "utf-8") - else - vim.lsp.buf.execute_command(r.command) - end - end - end -end - --- register linters -local luaformat = require("efmls-configs.formatters.lua_format") -local rustfmt = require('efmls-configs.formatters.rustfmt') -local black = require('efmls-configs.formatters.black') -local mypy = require('efmls-configs.linters.mypy') -local eslint = require('efmls-configs.linters.eslint') -local isort = require('efmls-configs.formatters.isort') -local languages = { - typescript = { eslint }, - lua = { luaformat }, - python = { black, mypy, isort }, - rust = { rustfmt }, -} - -local efmls_config = { - filetypes = vim.tbl_keys(languages), - settings = { - rootMarkers = { '.git/' }, - languages = languages, - }, - init_options = { - documentFormatting = true, - documentRangeFormatting = true, - }, -} - -require('lspconfig').efm.setup(vim.tbl_extend('force', efmls_config, { - -- Pass your custom lsp config below like on_attach and capabilities - on_attach = on_attach, - capabilities = default_capabilities, -})) - --- Enable diagnostics -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, - diagnostic_options -) - --- Compe setup -require 'compe'.setup { - enabled = true, - autocomplete = true, - debug = false, - min_length = 1, - preselect = 'disable', - throttle_time = 80, - source_timeout = 200, - incomplete_delay = 400, - max_abbr_width = 100, - max_kind_width = 100, - max_menu_width = 100, - documentation = true, - - source = { - path = true, - nvim_lsp = true, - }, -} - ---signature_cfg = { ---hint_enable = true, ---hint_prefix = "% ", ---handler_opts = { ---border = "none" ---}, ---} - ---require'lsp_signature'.on_attach(signature_cfg) - -local saga_cfg = { - code_action_prompt = { - enable = false, - sign = false, - virtual_text = false, - }, -} --- require'lspsaga'.init_lsp_saga(saga_cfg) - -local t = function(str) - return vim.api.nvim_replace_termcodes(str, true, true, true) -end - -local check_back_space = function() - local col = vim.fn.col('.') - 1 - if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then - return true - else - return false - end -end - --- Use (s-)tab to: ---- move to prev/next item in completion menuone ---- jump to prev/next snippet's placeholder -_G.tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "<C-n>" - elseif check_back_space() then - return t "<Tab>" - else - return vim.fn['compe#complete']() - end -end - -_G.s_tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "<C-p>" - else - return t "<S-Tab>" - end -end - -vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", { expr = true }) -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 }) - -require('lspkind').init({ - -- disables text annotations - --with_text = false, - --with_text = true, - - -- defines how annotations are shown - -- default: symbol - -- options: 'text', 'text_symbol', 'symbol_text', 'symbol' - mode = 'symbol', - - -- default symbol map - -- can be either 'default' or 'codicons' - preset = 'default', - - -- override preset symbols - -- default: {} - --symbol_map = { - --Method = 'm', - --Function = 'f', - --Text = 'txt', - --Constructor = 'new', - --Variable = 'var', - --Class = 'cls', - --Interface = 'iface', - --Module = 'mod', - --Property = 'prop', - --Unit = 'unit', - --Value = 'val', - --Enum = 'enum', - --Keyword = 'kw', - --Snippet = 'sn', - --Color = 'color', - --File = 'file', - --Folder = 'fold', - --EnumMember = 'enum', - --Constant = 'const', - --Struct = 'struct', - --}, -}) - ---require('rust-tools').setup({ ---}) - -require('trouble').setup { - mode = "document_diagnostics", - auto_close = true, - action_keys = { -- key mappings for actions in the trouble list - -- map to {} to remove a mapping, for example: - -- close = {}, - --close = "q", -- close the list - --cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor - --refresh = "r", -- manually refresh - jump = { "o", "<tab>" }, -- jump to the diagnostic or open / close folds - --open_split = { "<c-x>" }, -- open buffer in new split - --open_vsplit = { "<c-v>" }, -- open buffer in new vsplit - open_tab = {}, -- open buffer in new tab - jump_close = { "<cr>" }, -- jump to the diagnostic and close the list - toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode - toggle_preview = "P", -- toggle auto_preview - hover = "K", -- opens a small popup with the full multiline message - preview = "p", -- preview the diagnostic location - close_folds = { "zM", "zm" }, -- close all folds - open_folds = { "zR", "zr" }, -- open all folds - toggle_fold = { "zA", "za" }, -- toggle fold of current file - previous = "k", -- previous item - next = "j" -- next item - }, -} - -local trouble_telescope = require("trouble.providers.telescope") -local builtin = require 'telescope.builtin' - -local sendtoqf = function(loc) - local actions = require('telescope.actions') - actions.send_to_qflist(loc) - builtin.quickfix({ initial_mode = "normal" }) -end - -require('telescope').setup { - defaults = { - mappings = { - n = { - ["q"] = require('telescope.actions').close, - ["ff"] = sendtoqf, - ["<c-t>"] = trouble_telescope.open_with_trouble, - }, - i = { - ["<c-t>"] = trouble_telescope.open_with_trouble, - ["ff"] = require('telescope.actions').send_to_qflist, - }, - }, - path_display = { "smart", "shorten" }, - dynamic_preview_title = true, - }, - pickers = { - goimpl = { - theme = "ivy", - layout_config = { - height = 10, - }, - }, - lsp_code_actions = { - theme = "ivy", - layout_config = { - height = 10, - }, - }, - lsp_range_code_actions = { - theme = "ivy", - layout_config = { - height = 10, - }, - }, - lsp_references = { - theme = "ivy", - layout_config = { - height = 15, - }, - }, - quickfix = { - theme = "ivy", - layout_config = { - height = 15, - }, - initial_mode = "normal", - }, - git_files = { - theme = "ivy", - }, - grep_string = { - theme = "ivy", - layout_config = { - height = 15, - }, - initial_mode = "normal", - }, - live_grep = { - theme = "ivy", - layout_config = { - height = 15, - }, - }, - buffers = { - theme = "ivy", - layout_config = { - height = 15, - }, - ignore_current_buffer = true, - initial_mode = "normal", - }, - }, -} - - --- --- Treesitter --- - -require 'nvim-treesitter.configs'.setup { - -- One of "all", "maintained" (parsers with maintainers), or a list of languages - ensure_installed = { - "c", - "cpp", - "css", - "dockerfile", - "fish", - "go", - "haskell", - "html", - "javascript", - "json", - "lua", - "make", - "markdown", - "proto", - "python", - "query", - "rust", - "terraform", - "toml", - "tsx", - "typescript", - "vim", - "yaml", - }, - - -- Install languages synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- List of parsers to ignore installing - -- ignore_install = { "javascript" }, - - highlight = { - -- `false` will disable the whole extension - enable = true, - - -- list of language that will be disabled - -- disable = { "c", "rust" }, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - --custom_captures = { - --["generic_type_param"] = "TSCGenericTypeParam", - --["type_identifier"] = "TSCGenericTypeParam", - --}, - }, - - indent = { - enable = true - }, - - playground = { - enable = true, - disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code - persist_queries = false, -- Whether the query persists across vim sessions - keybindings = { - toggle_query_editor = 'o', - toggle_hl_groups = 'i', - toggle_injected_languages = 't', - toggle_anonymous_nodes = 'a', - toggle_language_display = 'I', - focus_language = 'f', - unfocus_language = 'F', - update = 'R', - goto_node = '<cr>', - show_help = '?', - }, - } -} - -require "neogen".setup {} - -require('leap').set_default_keymaps() -require("flit").setup {} - -require('snippy').setup({ - mappings = { - is = { - [',,'] = 'expand_or_advance', - [',.'] = 'previous', - }, - nx = { - ['<leader>x'] = 'cut_text', - }, - }, -}) - - ---- ---- My own "where" clause generator for Rust ---- -function string.insert(str1, str2, pos) - return str1:sub(1, pos) .. str2 .. str1:sub(pos + 1) -end - -function string.split(s, delimiter) - local result = {}; - for match in (s .. delimiter):gmatch("(.-)" .. delimiter) do - table.insert(result, match); - end - return result; -end - -local function rust_whereify_line(line, var_name) - if string.find(line, "fn") == nil then - return nil - end - - local paren = string.find(line, "%(") - if paren == nil then return nil end - - local open_generic = string.find(line, "<") - if open_generic ~= nil then - if open_generic < paren then - -- TODO(barakmich): it's already generic, we need to do something for that - -- probably a different function - return nil - end - -- just continue otherwise - end - - local whitespace = string.match(line, "^(%s*)") - - local generic = "<" .. var_name .. ">" - local out = string.insert(line, generic, paren - 1) - - local brace = string.find(out, "%{") - if brace == nil then brace = string.len(out) end - - out = string.insert(out, "\n" .. whitespace .. "where\n" .. whitespace .. " " .. var_name .. ": ,\n" .. whitespace, - brace - 1) - - return string.split(out, "\n") -end - -function rust_where_at_line() - local var_name = vim.fn.input("Variable: ") - local lineNum, col = unpack(vim.api.nvim_win_get_cursor(0)) - local replacements = rust_whereify_line(vim.api.nvim_get_current_line(), var_name) - vim.api.nvim_buf_set_lines(0, lineNum - 1, lineNum, false, replacements) - vim.api.nvim_win_set_cursor(0, { lineNum + 2, 4 }) -end - -function neogen_dwim() - local table = { - ["function_declaration"] = "func", - ["function_definition"] = "func", - ["function_item"] = "func", - ["function_signature_item"] = "func", - ["struct_item"] = "class", - ["trait_item"] = "class", - ["package_clause"] = "type", - ["const_declaration"] = "type", - ["var_declaration"] = "type", - ["class_definition"] = "class", - } - - local ts_utils = require 'nvim-treesitter.ts_utils' - local current_node = ts_utils.get_node_at_cursor() - while (current_node) do - local v = table[current_node:type()] - if v then - require('neogen').generate({ type = v }) - break - else - current_node = current_node:parent() - end - end -end - -require("murdock") -require("lir_setup") -require("lualine_setup") diff --git a/.vim/plugin/AppleT.vim b/.vim/plugin/AppleT.vim deleted file mode 100644 index c3d90fa..0000000 --- a/.vim/plugin/AppleT.vim +++ /dev/null @@ -1,73 +0,0 @@ -function! AppleT(name) -python << EOF -import sys -import os -import re -import vim - -def walkIt(search): - fullpath = os.path.expanduser(set_path) - fullsearch = ".*%s.*" % ".*".join(search) - fullsearch = re.sub(" ","[/.]", fullsearch) - bsearch = re.sub(" ",".*[/.].*", search) - exactsearch = "%s" % bsearch - exclude = re.compile("\.quer$|\.resp$|\.pyc$") - ignoredirs = [".svn", "_site-packages"] - fullmatch = re.compile(fullsearch, re.I) - exactmatch = re.compile(exactsearch, re.I) - length = len(fullpath) - - results = [] - exactresults = [] - - for root, dirs, files in os.walk(set_path): - for x in ignoredirs: - if x in dirs: - dirs.remove(x) - for f in files: - filename = os.path.join(root,f) - if exclude.search(filename): - pass - elif exactmatch.search(filename): - exactresults.append("%s" % filename) - elif fullmatch.search(filename): - results.append("%s" % filename) - - if len(results) == 0: - return - - def cmplen(x,y): - return cmp(len(x), len(y)) - - results.sort(cmplen) - exactresults.sort(cmplen) - results = exactresults + results - - for i, a in enumerate(results): - print "%d: %s" % (i + 1, a[length:]) - - which = vim.eval('input("Which? ")') - if re.match("^[0-9]+$", which) == None: - return - which = int(which) - 1 - vim.command("tabnew " + results[which]) - -thingtosearch = vim.eval("expand(a:name)") -walkIt(thingtosearch) - -EOF -endfunction - -function! AppleTSetPath(path) -python << EOF -import vim -set_path = vim.eval("expand(a:path)") -EOF -endfunction - -if !exists(":AppleTSetPath") - command! -nargs=+ AppleTSetPath :call AppleTSetPath(<q-args>) -endif -if !exists(":CmdT") - command! -nargs=+ CmdT :call AppleT(<q-args>) -endif diff --git a/.vim/plugin/a.vim b/.vim/plugin/a.vim deleted file mode 100644 index 637feb5..0000000 --- a/.vim/plugin/a.vim +++ /dev/null @@ -1,840 +0,0 @@ -" Copyright (c) 1998-2006 -" Michael Sharpe <feline@irendi.com> -" -" We grant permission to use, copy modify, distribute, and sell this -" software for any purpose without fee, provided that the above copyright -" notice and this text are not removed. We make no guarantee about the -" suitability of this software for any purpose and we are not liable -" for any damages resulting from its use. Further, we are under no -" obligation to maintain or extend this software. It is provided on an -" "as is" basis without any expressed or implied warranty. - -" Directory & regex enhancements added by Bindu Wavell who is well known on -" vim.sf.net -" -" Patch for spaces in files/directories from Nathan Stien (also reported by -" Soeren Sonnenburg) - -" Do not load a.vim if is has already been loaded. -if exists("loaded_alternateFile") - finish -endif -if (v:progname == "ex") - finish -endif -let loaded_alternateFile = 1 - -let alternateExtensionsDict = {} - -" setup the default set of alternate extensions. The user can override in thier -" .vimrc if the defaults are not suitable. To override in a .vimrc simply set a -" g:alternateExtensions_<EXT> variable to a comma separated list of alternates, -" where <EXT> is the extension to map. -" E.g. let g:alternateExtensions_CPP = "inc,h,H,HPP,hpp" -" let g:alternateExtensions_{'aspx.cs'} = "aspx" - - -" This variable will be increased when an extension with greater number of dots -" is added by the AddAlternateExtensionMapping call. -let s:maxDotsInExtension = 1 - -" Function : AddAlternateExtensionMapping (PRIVATE) -" Purpose : simple helper function to add the default alternate extension -" mappings. -" Args : extension -- the extension to map -" alternates -- comma separated list of alternates extensions -" Returns : nothing -" Author : Michael Sharpe <feline@irendi.com> -function! <SID>AddAlternateExtensionMapping(extension, alternates) - " This code does not actually work for variables like foo{'a.b.c.d.e'} - "let varName = "g:alternateExtensions_" . a:extension - "if (!exists(varName)) - " let g:alternateExtensions_{a:extension} = a:alternates - "endif - - " This code handles extensions which contains a dot. exists() fails with - " such names. - "let v:errmsg = "" - " FIXME this line causes ex to return 1 instead of 0 for some reason?? - "silent! echo g:alternateExtensions_{a:extension} - "if (v:errmsg != "") - "let g:alternateExtensions_{a:extension} = a:alternates - "endif - - let g:alternateExtensionsDict[a:extension] = a:alternates - let dotsNumber = strlen(substitute(a:extension, "[^.]", "", "g")) - if s:maxDotsInExtension < dotsNumber - let s:maxDotsInExtension = dotsNumber - endif -endfunction - - -" Add all the default extensions -" Mappings for C and C++ -call <SID>AddAlternateExtensionMapping('h',"c,cpp,cxx,cc,CC") -call <SID>AddAlternateExtensionMapping('H',"C,CPP,CXX,CC") -call <SID>AddAlternateExtensionMapping('hpp',"cpp,c") -call <SID>AddAlternateExtensionMapping('HPP',"CPP,C") -call <SID>AddAlternateExtensionMapping('c',"h") -call <SID>AddAlternateExtensionMapping('C',"H") -call <SID>AddAlternateExtensionMapping('cpp',"h,hpp") -call <SID>AddAlternateExtensionMapping('CPP',"H,HPP") -call <SID>AddAlternateExtensionMapping('cc',"h") -call <SID>AddAlternateExtensionMapping('CC',"H,h") -call <SID>AddAlternateExtensionMapping('cxx',"h") -call <SID>AddAlternateExtensionMapping('CXX',"H") -" Mappings for PSL7 -call <SID>AddAlternateExtensionMapping('psl',"ph") -call <SID>AddAlternateExtensionMapping('ph',"psl") -" Mappings for ADA -call <SID>AddAlternateExtensionMapping('adb',"ads") -call <SID>AddAlternateExtensionMapping('ads',"adb") -" Mappings for lex and yacc files -call <SID>AddAlternateExtensionMapping('l',"y,yacc,ypp") -call <SID>AddAlternateExtensionMapping('lex',"yacc,y,ypp") -call <SID>AddAlternateExtensionMapping('lpp',"ypp,y,yacc") -call <SID>AddAlternateExtensionMapping('y',"l,lex,lpp") -call <SID>AddAlternateExtensionMapping('yacc',"lex,l,lpp") -call <SID>AddAlternateExtensionMapping('ypp',"lpp,l,lex") -" Mappings for OCaml -call <SID>AddAlternateExtensionMapping('ml',"mli") -call <SID>AddAlternateExtensionMapping('mli',"ml") -" ASP stuff -call <SID>AddAlternateExtensionMapping('aspx.cs', 'aspx') -call <SID>AddAlternateExtensionMapping('aspx.vb', 'aspx') -call <SID>AddAlternateExtensionMapping('aspx', 'aspx.cs,aspx.vb') - -" Setup default search path, unless the user has specified -" a path in their [._]vimrc. -if (!exists('g:alternateSearchPath')) - let g:alternateSearchPath = 'sfr:../source,sfr:../src,sfr:../include,sfr:../inc' -endif - -" If this variable is true then a.vim will not alternate to a file/buffer which -" does not exist. E.g while editing a.c and the :A will not swtich to a.h -" unless it exists. -if (!exists('g:alternateNoDefaultAlternate')) - " by default a.vim will alternate to a file which does not exist - let g:alternateNoDefaultAlternate = 0 -endif - -" If this variable is true then a.vim will convert the alternate filename to a -" filename relative to the current working directory. -" Feature by Nathan Huizinga -if (!exists('g:alternateRelativeFiles')) - " by default a.vim will not convert the filename to one relative to the - " current working directory - let g:alternateRelativeFiles = 0 -endif - - -" Function : GetNthItemFromList (PRIVATE) -" Purpose : Support reading items from a comma seperated list -" Used to iterate all the extensions in an extension spec -" Used to iterate all path prefixes -" Args : list -- the list (extension spec, file paths) to iterate -" n -- the extension to get -" Returns : the nth item (extension, path) from the list (extension -" spec), or "" for failure -" Author : Michael Sharpe <feline@irendi.com> -" History : Renamed from GetNthExtensionFromSpec to GetNthItemFromList -" to reflect a more generic use of this function. -- Bindu -function! <SID>GetNthItemFromList(list, n) - let itemStart = 0 - let itemEnd = -1 - let pos = 0 - let item = "" - let i = 0 - while (i != a:n) - let itemStart = itemEnd + 1 - let itemEnd = match(a:list, ",", itemStart) - let i = i + 1 - if (itemEnd == -1) - if (i == a:n) - let itemEnd = strlen(a:list) - endif - break - endif - endwhile - if (itemEnd != -1) - let item = strpart(a:list, itemStart, itemEnd - itemStart) - endif - return item -endfunction - -" Function : ExpandAlternatePath (PRIVATE) -" Purpose : Expand path info. A path with a prefix of "wdr:" will be -" treated as relative to the working directory (i.e. the -" directory where vim was started.) A path prefix of "abs:" will -" be treated as absolute. No prefix or "sfr:" will result in the -" path being treated as relative to the source file (see sfPath -" argument). -" -" A prefix of "reg:" will treat the pathSpec as a regular -" expression substitution that is applied to the source file -" path. The format is: -" -" reg:<sep><pattern><sep><subst><sep><flag><sep> -" -" <sep> seperator character, we often use one of [/|%#] -" <pattern> is what you are looking for -" <subst> is the output pattern -" <flag> can be g for global replace or empty -" -" EXAMPLE: 'reg:/inc/src/g/' will replace every instance -" of 'inc' with 'src' in the source file path. It is possible -" to use match variables so you could do something like: -" 'reg:|src/\([^/]*\)|inc/\1||' (see 'help :substitute', -" 'help pattern' and 'help sub-replace-special' for more details -" -" NOTE: a.vim uses ',' (comma) internally so DON'T use it -" in your regular expressions or other pathSpecs unless you update -" the rest of the a.vim code to use some other seperator. -" -" Args : pathSpec -- path component (or substitution patterns) -" sfPath -- source file path -" Returns : a path that can be used by AlternateFile() -" Author : Bindu Wavell <bindu@wavell.net> -function! <SID>ExpandAlternatePath(pathSpec, sfPath) - let prfx = strpart(a:pathSpec, 0, 4) - if (prfx == "wdr:" || prfx == "abs:") - let path = strpart(a:pathSpec, 4) - elseif (prfx == "reg:") - let re = strpart(a:pathSpec, 4) - let sep = strpart(re, 0, 1) - let patend = match(re, sep, 1) - let pat = strpart(re, 1, patend - 1) - let subend = match(re, sep, patend + 1) - let sub = strpart(re, patend+1, subend - patend - 1) - let flag = strpart(re, strlen(re) - 2) - if (flag == sep) - let flag = '' - endif - let path = substitute(a:sfPath, pat, sub, flag) - "call confirm('PAT: [' . pat . '] SUB: [' . sub . ']') - "call confirm(a:sfPath . ' => ' . path) - else - let path = a:pathSpec - if (prfx == "sfr:") - let path = strpart(path, 4) - endif - let path = a:sfPath . "/" . path - endif - return path -endfunction - -" Function : FindFileInSearchPath (PRIVATE) -" Purpose : Searches for a file in the search path list -" Args : filename -- name of the file to search for -" pathList -- the path list to search -" relPathBase -- the path which relative paths are expanded from -" Returns : An expanded filename if found, the empty string otherwise -" Author : Michael Sharpe (feline@irendi.com) -" History : inline code written by Bindu Wavell originally -function! <SID>FindFileInSearchPath(fileName, pathList, relPathBase) - let filepath = "" - let m = 1 - let pathListLen = strlen(a:pathList) - if (pathListLen > 0) - while (1) - let pathSpec = <SID>GetNthItemFromList(a:pathList, m) - if (pathSpec != "") - let path = <SID>ExpandAlternatePath(pathSpec, a:relPathBase) - let fullname = path . "/" . a:fileName - let foundMatch = <SID>BufferOrFileExists(fullname) - if (foundMatch) - let filepath = fullname - break - endif - else - break - endif - let m = m + 1 - endwhile - endif - return filepath -endfunction - -" Function : FindFileInSearchPathEx (PRIVATE) -" Purpose : Searches for a file in the search path list -" Args : filename -- name of the file to search for -" pathList -- the path list to search -" relPathBase -- the path which relative paths are expanded from -" count -- find the count'th occurence of the file on the path -" Returns : An expanded filename if found, the empty string otherwise -" Author : Michael Sharpe (feline@irendi.com) -" History : Based on <SID>FindFileInSearchPath() but with extensions -function! <SID>FindFileInSearchPathEx(fileName, pathList, relPathBase, count) - let filepath = "" - let m = 1 - let spath = "" - let pathListLen = strlen(a:pathList) - if (pathListLen > 0) - while (1) - let pathSpec = <SID>GetNthItemFromList(a:pathList, m) - if (pathSpec != "") - let path = <SID>ExpandAlternatePath(pathSpec, a:relPathBase) - if (spath != "") - let spath = spath . ',' - endif - let spath = spath . path - else - break - endif - let m = m + 1 - endwhile - endif - - if (&path != "") - if (spath != "") - let spath = spath . ',' - endif - let spath = spath . &path - endif - - let filepath = findfile(a:fileName, spath, a:count) - return filepath -endfunction - -" Function : EnumerateFilesByExtension (PRIVATE) -" Purpose : enumerates all files by a particular list of alternate extensions. -" Args : path -- path of a file (not including the file) -" baseName -- base name of the file to be expanded -" extension -- extension whose alternates are to be enumerated -" Returns : comma separated list of files with extensions -" Author : Michael Sharpe <feline@irendi.com> -function! EnumerateFilesByExtension(path, baseName, extension) - let enumeration = "" - let extSpec = "" - let v:errmsg = "" - silent! echo g:alternateExtensions_{a:extension} - if (v:errmsg == "") - let extSpec = g:alternateExtensions_{a:extension} - endif - if (extSpec == "") - if (has_key(g:alternateExtensionsDict, a:extension)) - let extSpec = g:alternateExtensionsDict[a:extension] - endif - endif - if (extSpec != "") - let n = 1 - let done = 0 - while (!done) - let ext = <SID>GetNthItemFromList(extSpec, n) - if (ext != "") - if (a:path != "") - let newFilename = a:path . "/" . a:baseName . "." . ext - else - let newFilename = a:baseName . "." . ext - endif - if (enumeration == "") - let enumeration = newFilename - else - let enumeration = enumeration . "," . newFilename - endif - else - let done = 1 - endif - let n = n + 1 - endwhile - endif - return enumeration -endfunction - -" Function : EnumerateFilesByExtensionInPath (PRIVATE) -" Purpose : enumerates all files by expanding the path list and the extension -" list. -" Args : baseName -- base name of the file -" extension -- extension whose alternates are to be enumerated -" pathList -- the list of paths to enumerate -" relPath -- the path of the current file for expansion of relative -" paths in the path list. -" Returns : A comma separated list of paths with extensions -" Author : Michael Sharpe <feline@irendi.com> -function! EnumerateFilesByExtensionInPath(baseName, extension, pathList, relPathBase) - let enumeration = "" - let filepath = "" - let m = 1 - let pathListLen = strlen(a:pathList) - if (pathListLen > 0) - while (1) - let pathSpec = <SID>GetNthItemFromList(a:pathList, m) - if (pathSpec != "") - let path = <SID>ExpandAlternatePath(pathSpec, a:relPathBase) - let pe = EnumerateFilesByExtension(path, a:baseName, a:extension) - if (enumeration == "") - let enumeration = pe - else - let enumeration = enumeration . "," . pe - endif - else - break - endif - let m = m + 1 - endwhile - endif - return enumeration -endfunction - -" Function : DetermineExtension (PRIVATE) -" Purpose : Determines the extension of a filename based on the register -" alternate extension. This allow extension which contain dots to -" be considered. E.g. foo.aspx.cs to foo.aspx where an alternate -" exists for the aspx.cs extension. Note that this will only accept -" extensions which contain less than 5 dots. This is only -" implemented in this manner for simplicity...it is doubtful that -" this will be a restriction in non-contrived situations. -" Args : The path to the file to find the extension in -" Returns : The matched extension if any -" Author : Michael Sharpe (feline@irendi.com) -" History : idea from Tom-Erik Duestad -" Notes : there is some magic occuring here. The exists() function does not -" work well when the curly brace variable has dots in it. And why -" should it, dots are not valid in variable names. But the exists -" function is wierd too. Lets say foo_c does exist. Then -" exists("foo_c.e.f") will be true...even though the variable does -" not exist. However the curly brace variables do work when the -" variable has dots in it. E.g foo_{'c'} is different from -" foo_{'c.d.e'}...and foo_{'c'} is identical to foo_c and -" foo_{'c.d.e'} is identical to foo_c.d.e right? Yes in the current -" implementation of vim. To trick vim to test for existence of such -" variables echo the curly brace variable and look for an error -" message. -function! DetermineExtension(path) - let mods = ":t" - let i = 0 - while i <= s:maxDotsInExtension - let mods = mods . ":e" - let extension = fnamemodify(a:path, mods) - if (has_key(g:alternateExtensionsDict, extension)) - return extension - endif - let v:errmsg = "" - silent! echo g:alternateExtensions_{extension} - if (v:errmsg == "") - return extension - endif - let i = i + 1 - endwhile - return "" -endfunction - -" Function : AlternateFile (PUBLIC) -" Purpose : Opens a new buffer by looking at the extension of the current -" buffer and finding the corresponding file. E.g. foo.c <--> foo.h -" Args : accepts one argument. If present it used the argument as the new -" extension. -" Returns : nothing -" Author : Michael Sharpe <feline@irendi.com> -" History : + When an alternate can't be found in the same directory as the -" source file, a search path will be traversed looking for the -" alternates. -" + Moved some code into a separate function, minor optimization -" + rework to favor files in memory based on complete enumeration of -" all files extensions and paths -function! AlternateFile(splitWindow, ...) - let extension = DetermineExtension(expand("%:p")) - let baseName = substitute(expand("%:t"), "\." . extension . '$', "", "") - let currentPath = expand("%:p:h") - - if (a:0 != 0) - let newFullname = currentPath . "/" . baseName . "." . a:1 - call <SID>FindOrCreateBuffer(newFullname, a:splitWindow, 0) - else - let allfiles = "" - if (extension != "") - let allfiles1 = EnumerateFilesByExtension(currentPath, baseName, extension) - let allfiles2 = EnumerateFilesByExtensionInPath(baseName, extension, g:alternateSearchPath, currentPath) - - if (allfiles1 != "") - if (allfiles2 != "") - let allfiles = allfiles1 . ',' . allfiles2 - else - let allfiles = allfiles1 - endif - else - let allfiles = allfiles2 - endif - endif - - if (allfiles != "") - let bestFile = "" - let bestScore = 0 - let score = 0 - let n = 1 - - let onefile = <SID>GetNthItemFromList(allfiles, n) - let bestFile = onefile - while (onefile != "" && score < 2) - let score = <SID>BufferOrFileExists(onefile) - if (score > bestScore) - let bestScore = score - let bestFile = onefile - endif - let n = n + 1 - let onefile = <SID>GetNthItemFromList(allfiles, n) - endwhile - - if (bestScore == 0 && g:alternateNoDefaultAlternate == 1) - echo "No existing alternate available" - else - call <SID>FindOrCreateBuffer(bestFile, a:splitWindow, 1) - let b:AlternateAllFiles = allfiles - endif - else - echo "No alternate file/buffer available" - endif - endif -endfunction - -" Function : AlternateOpenFileUnderCursor (PUBLIC) -" Purpose : Opens file under the cursor -" Args : splitWindow -- indicates how to open the file -" Returns : Nothing -" Author : Michael Sharpe (feline@irendi.com) www.irendi.com -function! AlternateOpenFileUnderCursor(splitWindow,...) - let cursorFile = (a:0 > 0) ? a:1 : expand("<cfile>") - let currentPath = expand("%:p:h") - let openCount = 1 - - let fileName = <SID>FindFileInSearchPathEx(cursorFile, g:alternateSearchPath, currentPath, openCount) - if (fileName != "") - call <SID>FindOrCreateBuffer(fileName, a:splitWindow, 1) - let b:openCount = openCount - let b:cursorFile = cursorFile - let b:currentPath = currentPath - else - echo "Can't find file" - endif -endfunction - -" Function : AlternateOpenNextFile (PUBLIC) -" Purpose : Opens the next file corresponding to the search which found the -" current file -" Args : bang -- indicates what to do if the current file has not been -" saved -" Returns : nothing -" Author : Michael Sharpe (feline@irendi.com) www.irendi.com -function! AlternateOpenNextFile(bang) - let cursorFile = "" - if (exists("b:cursorFile")) - let cursorFile = b:cursorFile - endif - - let currentPath = "" - if (exists("b:currentPath")) - let currentPath = b:currentPath - endif - - let openCount = 0 - if (exists("b:openCount")) - let openCount = b:openCount + 1 - endif - - if (cursorFile != "" && currentPath != "" && openCount != 0) - let fileName = <SID>FindFileInSearchPathEx(cursorFile, g:alternateSearchPath, currentPath, openCount) - if (fileName != "") - call <SID>FindOrCreateBuffer(fileName, "n".a:bang, 0) - let b:openCount = openCount - let b:cursorFile = cursorFile - let b:currentPath = currentPath - else - let fileName = <SID>FindFileInSearchPathEx(cursorFile, g:alternateSearchPath, currentPath, 1) - if (fileName != "") - call <SID>FindOrCreateBuffer(fileName, "n".a:bang, 0) - let b:openCount = 1 - let b:cursorFile = cursorFile - let b:currentPath = currentPath - else - echo "Can't find next file" - endif - endif - endif -endfunction - -comm! -nargs=? -bang IH call AlternateOpenFileUnderCursor("n<bang>", <f-args>) -comm! -nargs=? -bang IHS call AlternateOpenFileUnderCursor("h<bang>", <f-args>) -comm! -nargs=? -bang IHV call AlternateOpenFileUnderCursor("v<bang>", <f-args>) -comm! -nargs=? -bang IHT call AlternateOpenFileUnderCursor("t<bang>", <f-args>) -comm! -nargs=? -bang IHN call AlternateOpenNextFile("<bang>") -imap <Leader>ih <ESC>:IHS<CR> -nmap <Leader>ih :IHS<CR> -imap <Leader>is <ESC>:IHS<CR>:A<CR> -nmap <Leader>is :IHS<CR>:A<CR> -imap <Leader>ihn <ESC>:IHN<CR> -nmap <Leader>ihn :IHN<CR> - -"function! <SID>PrintList(theList) -" let n = 1 -" let oneFile = <SID>GetNthItemFromList(a:theList, n) -" while (oneFile != "") -" let n = n + 1 -" let oneFile = <SID>GetNthItemFromList(a:theList, n) -" endwhile -"endfunction - -" Function : NextAlternate (PUBLIC) -" Purpose : Used to cycle through any other alternate file which existed on -" the search path. -" Args : bang (IN) - used to implement the AN vs AN! functionality -" Returns : nothing -" Author : Michael Sharpe <feline@irendi.com> -function! NextAlternate(bang) - if (exists('b:AlternateAllFiles')) - let currentFile = expand("%") - let n = 1 - let onefile = <SID>GetNthItemFromList(b:AlternateAllFiles, n) - while (onefile != "" && !<SID>EqualFilePaths(fnamemodify(onefile,":p"), fnamemodify(currentFile,":p"))) - let n = n + 1 - let onefile = <SID>GetNthItemFromList(b:AlternateAllFiles, n) - endwhile - - if (onefile != "") - let stop = n - let n = n + 1 - let foundAlternate = 0 - let nextAlternate = "" - while (n != stop) - let nextAlternate = <SID>GetNthItemFromList(b:AlternateAllFiles, n) - if (nextAlternate == "") - let n = 1 - continue - endif - let n = n + 1 - if (<SID>EqualFilePaths(fnamemodify(nextAlternate, ":p"), fnamemodify(currentFile, ":p"))) - continue - endif - if (filereadable(nextAlternate)) - " on cygwin filereadable("foo.H") returns true if "foo.h" exists - if (has("unix") && $WINDIR != "" && fnamemodify(nextAlternate, ":p") ==? fnamemodify(currentFile, ":p")) - continue - endif - let foundAlternate = 1 - break - endif - endwhile - if (foundAlternate == 1) - let s:AlternateAllFiles = b:AlternateAllFiles - "silent! execute ":e".a:bang." " . nextAlternate - call <SID>FindOrCreateBuffer(nextAlternate, "n".a:bang, 0) - let b:AlternateAllFiles = s:AlternateAllFiles - else - echo "Only this alternate file exists" - endif - else - echo "Could not find current file in alternates list" - endif - else - echo "No other alternate files exist" - endif -endfunction - -comm! -nargs=? -bang A call AlternateFile("n<bang>", <f-args>) -comm! -nargs=? -bang AS call AlternateFile("h<bang>", <f-args>) -comm! -nargs=? -bang AV call AlternateFile("v<bang>", <f-args>) -comm! -nargs=? -bang AT call AlternateFile("t<bang>", <f-args>) -comm! -nargs=? -bang AN call NextAlternate("<bang>") - -" Function : BufferOrFileExists (PRIVATE) -" Purpose : determines if a buffer or a readable file exists -" Args : fileName (IN) - name of the file to check -" Returns : 2 if it exists in memory, 1 if it exists, 0 otherwise -" Author : Michael Sharpe <feline@irendi.com> -" History : Updated code to handle buffernames using just the -" filename and not the path. -function! <SID>BufferOrFileExists(fileName) - let result = 0 - - let lastBuffer = bufnr("$") - let i = 1 - while i <= lastBuffer - if <SID>EqualFilePaths(expand("#".i.":p"), a:fileName) - let result = 2 - break - endif - let i = i + 1 - endwhile - - if (!result) - let bufName = fnamemodify(a:fileName,":t") - let memBufName = bufname(bufName) - if (memBufName != "") - let memBufBasename = fnamemodify(memBufName, ":t") - if (bufName == memBufBasename) - let result = 2 - endif - endif - - if (!result) - let result = bufexists(bufName) || bufexists(a:fileName) || filereadable(a:fileName) - endif - endif - - if (!result) - let result = filereadable(a:fileName) - endif - return result -endfunction - -" Function : FindOrCreateBuffer (PRIVATE) -" Purpose : searches the buffer list (:ls) for the specified filename. If -" found, checks the window list for the buffer. If the buffer is in -" an already open window, it switches to the window. If the buffer -" was not in a window, it switches to that buffer. If the buffer did -" not exist, it creates it. -" Args : filename (IN) -- the name of the file -" doSplit (IN) -- indicates whether the window should be split -" ("v", "h", "n", "v!", "h!", "n!", "t", "t!") -" findSimilar (IN) -- indicate weather existing buffers should be -" prefered -" Returns : nothing -" Author : Michael Sharpe <feline@irendi.com> -" History : + bufname() was not working very well with the possibly strange -" paths that can abound with the search path so updated this -" slightly. -- Bindu -" + updated window switching code to make it more efficient -- Bindu -" Allow ! to be applied to buffer/split/editing commands for more -" vim/vi like consistency -" + implemented fix from Matt Perry -function! <SID>FindOrCreateBuffer(fileName, doSplit, findSimilar) - " Check to see if the buffer is already open before re-opening it. - let FILENAME = escape(a:fileName, ' ') - let bufNr = -1 - let lastBuffer = bufnr("$") - let i = 1 - if (a:findSimilar) - while i <= lastBuffer - if <SID>EqualFilePaths(expand("#".i.":p"), a:fileName) - let bufNr = i - break - endif - let i = i + 1 - endwhile - - if (bufNr == -1) - let bufName = bufname(a:fileName) - let bufFilename = fnamemodify(a:fileName,":t") - - if (bufName == "") - let bufName = bufname(bufFilename) - endif - - if (bufName != "") - let tail = fnamemodify(bufName, ":t") - if (tail != bufFilename) - let bufName = "" - endif - endif - if (bufName != "") - let bufNr = bufnr(bufName) - let FILENAME = bufName - endif - endif - endif - - if (g:alternateRelativeFiles == 1) - let FILENAME = fnamemodify(FILENAME, ":p:.") - endif - - let splitType = a:doSplit[0] - let bang = a:doSplit[1] - if (bufNr == -1) - " Buffer did not exist....create it - let v:errmsg="" - if (splitType == "h") - silent! execute ":split".bang." " . FILENAME - elseif (splitType == "v") - silent! execute ":vsplit".bang." " . FILENAME - elseif (splitType == "t") - silent! execute ":tab split".bang." " . FILENAME - else - silent! execute ":e".bang." " . FILENAME - endif - if (v:errmsg != "") - echo v:errmsg - endif - else - - " Find the correct tab corresponding to the existing buffer - let tabNr = -1 - " iterate tab pages - for i in range(tabpagenr('$')) - " get the list of buffers in the tab - let tabList = tabpagebuflist(i + 1) - let idx = 0 - " iterate each buffer in the list - while idx < len(tabList) - " if it matches the buffer we are looking for... - if (tabList[idx] == bufNr) - " ... save the number - let tabNr = i + 1 - break - endif - let idx = idx + 1 - endwhile - if (tabNr != -1) - break - endif - endfor - " switch the the tab containing the buffer - if (tabNr != -1) - execute "tabn ".tabNr - endif - - " Buffer was already open......check to see if it is in a window - let bufWindow = bufwinnr(bufNr) - if (bufWindow == -1) - " Buffer was not in a window so open one - let v:errmsg="" - if (splitType == "h") - silent! execute ":sbuffer".bang." " . FILENAME - elseif (splitType == "v") - silent! execute ":vert sbuffer " . FILENAME - elseif (splitType == "t") - silent! execute ":tab sbuffer " . FILENAME - else - silent! execute ":buffer".bang." " . FILENAME - endif - if (v:errmsg != "") - echo v:errmsg - endif - else - " Buffer is already in a window so switch to the window - execute bufWindow."wincmd w" - if (bufWindow != winnr()) - " something wierd happened...open the buffer - let v:errmsg="" - if (splitType == "h") - silent! execute ":split".bang." " . FILENAME - elseif (splitType == "v") - silent! execute ":vsplit".bang." " . FILENAME - elseif (splitType == "t") - silent! execute ":tab split".bang." " . FILENAME - else - silent! execute ":e".bang." " . FILENAME - endif - if (v:errmsg != "") - echo v:errmsg - endif - endif - endif - endif -endfunction - -" Function : EqualFilePaths (PRIVATE) -" Purpose : Compares two paths. Do simple string comparison anywhere but on -" Windows. On Windows take into account that file paths could differ -" in usage of separators and the fact that case does not matter. -" "c:\WINDOWS" is the same path as "c:/windows". has("win32unix") Vim -" version does not count as one having Windows path rules. -" Args : path1 (IN) -- first path -" path2 (IN) -- second path -" Returns : 1 if path1 is equal to path2, 0 otherwise. -" Author : Ilya Bobir <ilya@po4ta.com> -function! <SID>EqualFilePaths(path1, path2) - if has("win16") || has("win32") || has("win64") || has("win95") - return substitute(a:path1, "\/", "\\", "g") ==? substitute(a:path2, "\/", "\\", "g") - else - return a:path1 == a:path2 - endif -endfunction diff --git a/.vim/plugin/bclose.vim b/.vim/plugin/bclose.vim deleted file mode 100644 index 3c1bb19..0000000 --- a/.vim/plugin/bclose.vim +++ /dev/null @@ -1,70 +0,0 @@ -if exists("loaded_bclosePlugin") - finish -endif -if (v:progname == "ex") - finish -endif -let loaded_bclosePlugin = 1 - - -"here is a more exotic version of my original Kwbd script -"delete the buffer; keep windows; create a scratch buffer if no buffers left -function s:Kwbd(kwbdStage) - if(a:kwbdStage == 1) - if(!buflisted(winbufnr(0))) - bd! - return - endif - let s:kwbdBufNum = bufnr("%") - let s:kwbdWinNum = winnr() - windo call s:Kwbd(2) - execute s:kwbdWinNum . 'wincmd w' - let s:buflistedLeft = 0 - let s:bufFinalJump = 0 - let l:nBufs = bufnr("$") - let l:i = 1 - while(l:i <= l:nBufs) - if(l:i != s:kwbdBufNum) - if(buflisted(l:i)) - let s:buflistedLeft = s:buflistedLeft + 1 - else - if(bufexists(l:i) && !strlen(bufname(l:i)) && !s:bufFinalJump) - let s:bufFinalJump = l:i - endif - endif - endif - let l:i = l:i + 1 - endwhile - if(!s:buflistedLeft) - if(s:bufFinalJump) - windo if(buflisted(winbufnr(0))) | execute "b! " . s:bufFinalJump | endif - else - enew - let l:newBuf = bufnr("%") - windo if(buflisted(winbufnr(0))) | execute "b! " . l:newBuf | endif - endif - execute s:kwbdWinNum . 'wincmd w' - endif - if(buflisted(s:kwbdBufNum) || s:kwbdBufNum == bufnr("%")) - execute "bd! " . s:kwbdBufNum - endif - if(!s:buflistedLeft) - set buflisted - set bufhidden=delete - set buftype=nofile - setlocal noswapfile - endif - else - if(bufnr("%") == s:kwbdBufNum) - let prevbufvar = bufnr("#") - if(prevbufvar > 0 && buflisted(prevbufvar) && prevbufvar != s:kwbdBufNum) - b # - else - bn - endif - endif - endif -endfunction - -command! Kwbd call <SID>Kwbd(1) -nnoremap <silent> <Plug>Kwbd :<C-u>Kwbd<CR> diff --git a/.vim/plugin/camelcasemotion.vim b/.vim/plugin/camelcasemotion.vim deleted file mode 100644 index ae9cbd6..0000000 --- a/.vim/plugin/camelcasemotion.vim +++ /dev/null @@ -1,449 +0,0 @@ -" camelcasemotion.vim: Mappings for motion through CamelCaseWords and -" underscore_notation. -" -" DESCRIPTION: {{{1 -" VIM provides many built-in motions, e.g. to move to the next word, or -" end of the current word. Most programming languages use either CamelCase -" ("anIdentifier") or underscore_notation ("an_identifier") naming -" conventions for identifiers. The best way to navigate inside those -" identifiers using VIM built-in motions is the '[count]f{char}' motion, i.e. -" 'f<uppercase char>' or 'f_', respectively. But we can make this easier: -" -" This script defines motions ',w', ',b' and ',e' (similar to 'w', 'b', 'e'), -" which do not move word-wise (forward/backward), but Camel-wise; i.e. to word -" boundaries and uppercase letters. The motions also work on underscore -" notation, where words are delimited by underscore ('_') characters. -" From here on, both CamelCase and underscore_notation entities are referred -" to as "words" (in double quotes). Just like with the regular motions, a -" [count] can be prepended to move over multiple "words" at once. -" Outside of "words" (e.g. in non-keyword characters like // or ;), the new -" motions move just like the regular motions. -" -" VIM provides a built-in text object called 'inner word' ('iw'), which works -" in operator-pending and visual mode. Analog to that, this script defines -" inner "word" motions 'i,w', 'i,b' and 'i,e', which select the "word" (or -" multiple "words" if a [count] is given) where the cursor is located. -" -" USAGE: -" Use the new motions ',w', ',b' and ',e' in normal mode, operator-pending -" mode (cp. :help operator), and visual mode. For example, type 'bc,w' to -" change 'Camel' in 'CamelCase' to something else. -" -" EXAMPLE: motions -" Given the following CamelCase identifiers in a source code fragment: -" set Script31337PathAndNameWithoutExtension11=%~dpn0 -" set Script31337PathANDNameWITHOUTExtension11=%~dpn0 -" and the corresponding identifiers in underscore_notation: -" set script_31337_path_and_name_without_extension_11=%~dpn0 -" set SCRIPT_31337_PATH_AND_NAME_WITHOUT_EXTENSION_11=%~dpn0 -" -" ,w moves to ([x] is cursor position): [s]et, [s]cript, [3]1337, [p]ath, -" [a]nd, [n]ame, [w]ithout, [e]xtension, [1]1, [d]pn0, dpn[0], [s]et -" ,b moves to: [d]pn0, [1]1, [e]xtension, [w]ithout, ... -" ,e moves to: se[t], scrip[t], 3133[7], pat[h], an[d], nam[e], withou[t], -" extensio[n], 1[1], dpn[0] -" -" EXAMPLE: inner motions -" Given the following identifier, with the cursor positioned at [x]: -" script_31337_path_and_na[m]e_without_extension_11 -" -" v3i,w selects script_31337_path_and_[name_without_extension_]11 -" v3i,b selects script_31337_[path_and_name]_without_extension_11 -" v3i,e selects script_31337_path_and_[name_without_extension]_11 -" Instead of visual mode, you can also use c3i,w to change, d3i,w to delete, -" gU3i,w to upper-case, and so on. -" -" INSTALLATION: {{{1 -" Put the script into your user or system VIM plugin directory (e.g. -" ~/.vim/plugin). -" -" DEPENDENCIES: -" - Requires VIM 7.0 or higher. -" -" CONFIGURATION: -" If you want to use different mappings, map your keys to the -" <Plug>CamelCaseMotion_? mapping targets _before_ sourcing this script -" (e.g. in your .vimrc). -" -" Example: Replace the default 'w', 'b' and 'e' mappings instead of defining -" additional mappings ',w', ',b' and ',e': -" map <silent> w <Plug>CamelCaseMotion_w -" map <silent> b <Plug>CamelCaseMotion_b -" map <silent> e <Plug>CamelCaseMotion_e -" -" Example: Replace default 'iw' text-object and define 'ib' and 'ie' motions: -" omap <silent> iw <Plug>CamelCaseMotion_iw -" vmap <silent> iw <Plug>CamelCaseMotion_iw -" omap <silent> ib <Plug>CamelCaseMotion_ib -" vmap <silent> ib <Plug>CamelCaseMotion_ib -" omap <silent> ie <Plug>CamelCaseMotion_ie -" vmap <silent> ie <Plug>CamelCaseMotion_ie -" -" LIMITATIONS: -" -" ASSUMPTIONS: -" -" KNOWN PROBLEMS: -" - A degenerate CamelCaseWord containing '\U\u\d' (e.g. "MaP1Roblem") -" confuses the operator-pending and visual mode ,e mapping if 'selection' is -" not set to "exclusive". It'll skip "P" and select "P1" in one step. As a -" workaround, use ',w' instead of ',e'; those two mappings have the same -" effect inside CamelCaseWords, anyway. -" - The operator-pending and visual mode ,e mapping doesn't work properly when -" it reaches the end of the buffer; the final character of the moved-over -" "word" remains. As a workaround, use the default 'e' motion instead of -" ',e'. -" - When the VIM setting 'selection' is not set to "exclusive", a -" forward-backward combination in visual mode (e.g. 'v,w,b') selects one -" additional character to the left, instead of only the character where the -" motion started. Likewise, extension of the visual selection from the front -" end is off by one additional character. -" -" TODO: -" -" Copyright: (C) 2007-2008 by Ingo Karkat -" The VIM LICENSE applies to this script; see ':help copyright'. -" -" Source: Based on vimtip #1016 by Anthony Van Ham. -" Maintainer: Ingo Karkat <ingo@karkat.de> -" REVISION DATE REMARKS {{{1 -" 1.40.017 19-May-2008 BF: Now using :normal! to be independent from -" any user mappings. Thanks to Neil Walker for the -" patch. -" 1.40.016 28-Apr-2008 BF: Wrong forward motion stop at the second -" digit if a word starts with multiple numbers -" (e.g. 1234.56789). Thanks to Wasim Ahmed for -" reporting this. -" 1.40.015 24-Apr-2008 ENH: Added inner "word" text objects 'i,w' etc. -" that work analoguous to the built-in 'iw' text -" object. Thanks to David Kotchan for this -" suggestion. -" 1.30.014 20-Apr-2008 The motions now also stop at non-keyword -" boundaries, just like the regular motions. This -" has no effect inside a CamelCaseWord or inside -" underscore_notation, but it makes the motions -" behave like the regular motions (which is -" important if you replace the default motions). -" Thanks to Mun Johl for reporting this. -" Now using non-capturing parentheses \%() in the -" patterns. -" 1.30.013 09-Apr-2008 Refactored away s:VisualCamelCaseMotion(). -" Allowing users to use mappings different than -" ,w ,b ,e by defining <Plug>CamelCaseMotion_? -" target mappings. This can even be used to -" replace the default 'w', 'b' and 'e' mappings, -" as suggested by Mun Johl. -" Mappings are now created in a generic function. -" Now requires VIM 7.0 or higher. -" 1.20.012 02-Jun-2007 BF: Corrected motions through mixed -" CamelCase_and_UnderScore words by re-ordering -" and narrowing the search patterns. -" 1.20.011 02-Jun-2007 Thanks again to Joseph Barker for discussing the -" complicated visual mode mapping on the vim-dev -" mailing list and coming up with a great -" simplification: -" Removed s:CheckForChangesToTheSelectionSetting(). -" Introduced s:VisualCamelCaseMotion(), which -" handles the differences depending on the -" 'selection' setting. -" Visual mode mappings now directly map to the -" s:VisualCamelCaseMotion() function; no mark is -" clobbered, the complex mapping with the inline -" expression has been retired. -" 1.20.010 29-May-2007 BF: The operator-pending and visual mode ,e -" mapping doesn't work properly when it reaches -" the end of line; the final character of the -" moved-over "word" remains. Fixed this problem -" unless the "word" is at the very end of the -" buffer. -" ENH: The visual mode motions now also (mostly) -" work with the (default) setting -" 'set selection=inclusive', instead of selecting -" one character too much. -" ENH: All mappings will check for changes to the -" 'selection' setting and remap the visual mode -" mappings via function -" s:SetupVisualModeMappings(). We cannot rely on -" the setting while sourcing camelcasemotion.vim -" because the mswin.vim script may be sourced -" afterwards, and its 'behave mswin' changes -" 'selection'. -" Refactored the arguments of function -" s:CamelCaseMotion(...). -" 1.10.009 28-May-2007 BF: Degenerate CamelCaseWords that consist of -" only a single uppercase letter (e.g. "P" in -" "MapPRoblem") are skipped by all motions. Thanks -" to Joseph Barker for reporting this. -" BF: In CamelCaseWords that consist of uppercase -" letters followed by decimals (e.g. -" "MyUPPER123Problem", the uppercase "word" is -" skipped by all motions. -" 1.10.008 28-May-2007 Incorporated major improvements and -" simplifications done by Joseph Barker: -" Operator-pending and visual mode motions now -" accept [count] of more than 9. -" Visual selections can now be extended from -" either end. -" Instead of misusing the :[range], the special -" variable v:count1 is used. Custom commands are -" not needed anymore. -" Operator-pending and visual mode mappings are -" now generic: There's only a single mapping for -" ,w that can be repeated, rather than having a -" separate mapping for 1,w 2,w 3,w ... -" 1.00.007 22-May-2007 Added documentation for publication. -" 006 20-May-2007 BF: visual mode [1,2,3],e on pure CamelCase -" mistakenly marks [2,4,6] words. If the cursor is -" on a uppercase letter, the search pattern -" '\u\l\+' doesn't match at the cursor position, -" so another match won. Changed search pattern -" from '\l\+', -" 005 16-May-2007 Added support for underscore notation. -" Added support for "forward to end of word" -" (',e') motion. -" 004 16-May-2007 Improved search pattern so that -" UppercaseWORDSInBetween and digits are handled, -" too. -" 003 15-May-2007 Changed mappings from <Leader>w to ,w; -" other \w mappings interfere here, because it's -" irritating when the cursor jump doesn't happen -" immediately, because VIM waits whether the -" mapping is complete. ,w is faster to type that -" \w (and, because of the left-right touch, -" preferred over gw). -" Added visual mode mappings. -" 0.02 15-Feb-2006 BF: missing <SID> for omaps. -" 0.01 11-Oct-2005 file creation - -" Avoid installing twice or when in compatible mode -if exists("loaded_camelcasemotion") || (v:version < 700) - finish -endif -let loaded_camelcasemotion = 1 -" }}}1 - -"- functions ------------------------------------------------------------------" -function! s:CamelCaseMove( direction, count, mode ) " {{{1 - " Note: There is no inversion of the regular expression character class - " 'keyword character' (\k). We need an inversion "non-keyword" defined as - " "any non-whitespace character that is not a keyword character (e.g. - " [!@#$%^&*()]. This can be specified via a non-whitespace character in - " whose place no keyword character matches (\k\@!\S). - - "echo "count is " . a:count - let l:i = 0 - while l:i < a:count - if a:direction == 'e' - " "Forward to end" motion. - "call search( '\>\|\(\a\|\d\)\+\ze_', 'We' ) - " end of ... - " number | ACRONYM followed by CamelCase or number | CamelCase | underscore_notation | non-keyword | word - call search( '\d\+\|\u\+\ze\%(\u\l\|\d\)\|\u\l\+\|\%(\a\|\d\)\+\ze_\|\%(\k\@!\S\)\+\|\%(_\@!\k\)\+\>', 'We' ) - " Note: word must be defined as '\k\>'; '\>' on its own somehow - " dominates over the previous branch. Plus, \k must exclude the - " underscore, or a trailing one will be incorrectly moved over: - " '\%(_\@!\k\)'. - if a:mode == 'o' - " Note: Special additional treatment for operator-pending mode - " "forward to end" motion. - " The difference between normal mode, operator-pending and visual - " mode is that in the latter two, the motion must go _past_ the - " final "word" character, so that all characters of the "word" are - " selected. This is done by appending a 'l' motion after the - " search for the next "word". - " - " In operator-pending mode, the 'l' motion only works properly - " at the end of the line (i.e. when the moved-over "word" is at - " the end of the line) when the 'l' motion is allowed to move - " over to the next line. Thus, the 'l' motion is added - " temporarily to the global 'whichwrap' setting. - " Without this, the motion would leave out the last character in - " the line. I've also experimented with temporarily setting - " "set virtualedit=onemore" , but that didn't work. - let l:save_ww = &whichwrap - set whichwrap+=l - normal! l - let &whichwrap = l:save_ww - endif - else - " Forward (a:direction == '') and backward (a:direction == 'b') - " motion. - - let l:direction = (a:direction == 'w' ? '' : a:direction) - - " CamelCase: Jump to beginning of either (start of word, Word, WORD, - " 123). - " Underscore_notation: Jump to the beginning of an underscore-separated - " word or number. - "call search( '\<\|\u', 'W' . l:direction ) - "call search( '\<\|\u\(\l\+\|\u\+\ze\u\)\|\d\+', 'W' . l:direction ) - "call search( '\<\|\u\(\l\+\|\u\+\ze\u\)\|\d\+\|_\zs\(\a\|\d\)\+', 'W' . l:direction ) - " beginning of ... - " word | empty line | non-keyword after whitespaces | non-whitespace after word | number | ACRONYM followed by CamelCase or number | CamelCase | underscore followed by ACRONYM, Camel, lowercase or number - call search( '\<\D\|^$\|\%(^\|\s\)\+\zs\k\@!\S\|\>\S\|\d\+\|\u\+\ze\%(\u\l\|\d\)\|\u\l\+\|_\zs\%(\u\+\|\u\l\+\|\l\+\|\d\+\)', 'W' . l:direction ) - " Note: word must be defined as '\<\D' to avoid that a word like - " 1234Test is moved over as [1][2]34[T]est instead of [1]234[T]est - " because \< matches with zero width, and \d\+ will then start - " matching '234'. To fix that, we make \d\+ be solely responsible - " for numbers by taken this away from \< via \<\D. (An alternative - " would be to replace \d\+ with \D\%#\zs\d\+, but that one is more - " complex.) All other branches are not affected, because they match - " multiple characters and not the same character multiple times. - endif - let l:i = l:i + 1 - endwhile -endfunction -" }}}1 - -function! s:CamelCaseMotion( direction, count, mode ) " {{{1 -"******************************************************************************* -"* PURPOSE: -" Perform the motion over CamelCaseWords or underscore_notation. -"* ASSUMPTIONS / PRECONDITIONS: -" none -"* EFFECTS / POSTCONDITIONS: -" Move cursor / change selection. -"* INPUTS: -" a:direction one of 'w', 'b', 'e' -" a:count number of "words" to move over -" a:mode one of 'n', 'o', 'v', 'iv' (latter one is a special visual mode -" when inside the inner "word" text objects. -"* RETURN VALUES: -" none -"******************************************************************************* - " Visual mode needs special preparations and postprocessing; - " normal and operator-pending mode breeze through to s:CamelCaseMove(). - - if a:mode == 'v' - " Visual mode was left when calling this function. Reselecting the current - " selection returns to visual mode and allows to call search() and issue - " normal mode motions while staying in visual mode. - normal! gv - endif - if a:mode == 'v' || a:mode == 'iv' - - " Note_1a: - if &selection != 'exclusive' && a:direction == 'w' - normal! l - endif - endif - - call s:CamelCaseMove( a:direction, a:count, a:mode ) - - if a:mode == 'v' || a:mode == 'iv' - " Note: 'selection' setting. - if &selection == 'exclusive' && a:direction == 'e' - " When set to 'exclusive', the "forward to end" motion (',e') does not - " include the last character of the moved-over "word". To include that, an - " additional 'l' motion is appended to the motion; similar to the - " special treatment in operator-pending mode. - normal! l - elseif &selection != 'exclusive' && a:direction != 'e' - " Note_1b: - " The forward and backward motions move to the beginning of the next "word". - " When 'selection' is set to 'inclusive' or 'old', this is one character too far. - " The appended 'h' motion undoes this. Because of this backward step, - " though, the forward motion finds the current "word" again, and would - " be stuck on the current "word". An 'l' motion before the CamelCase - " motion (see Note_1a) fixes that. - normal! h - end - endif -endfunction -" }}}1 - -function! s:CamelCaseInnerMotion( direction, count ) " {{{1 - " If the cursor is positioned on the first character of a CamelWord, the - " backward motion would move to the previous word, which would result in a - " wrong selection. To fix this, first move the cursor to the right, so that - " the backward motion definitely will cover the current "word" under the - " cursor. - normal! l - - " Move "word" backwards, enter visual mode, then move "word" forward. This - " selects the inner "word" in visual mode; the operator-pending mode takes - " this selection as the area covered by the motion. - if a:direction == 'b' - " Do not do the selection backwards, because the backwards "word" motion - " in visual mode + selection=inclusive has an off-by-one error. - call s:CamelCaseMotion( 'b', a:count, 'n' ) - normal! v - " We decree that 'b' is the opposite of 'e', not 'w'. This makes more - " sense at the end of a line and for underscore_notation. - call s:CamelCaseMotion( 'e', a:count, 'iv' ) - else - call s:CamelCaseMotion( 'b', 1, 'n' ) - normal! v - call s:CamelCaseMotion( a:direction, a:count, 'iv' ) - endif -endfunction -" }}}1 - -"- mappings ------------------------------------------------------------------- -" The count is passed into the function through the special variable 'v:count1', -" which is easier than misusing the :[range] that :call supports. -" <C-U> is used to delete the unused range. -" Another option would be to use a custom 'command! -count=1', but that doesn't -" work with the normal mode mapping: When a count is typed before the mapping, -" the ':' will convert a count of 3 into ':.,+2MyCommand', but ':3MyCommand' -" would be required to use -count and <count>. -" -" We do not provide the fourth "backward to end" motion (,E), because it is -" seldomly used. - -function! s:CreateMotionMappings() "{{{1 - " Create mappings according to this template: - " (* stands for the mode [nov], ? for the underlying motion [wbe].) - " - " *noremap <script> <Plug>CamelCaseMotion_? :<C-U>call <SID>CamelCaseMotion('?',v:count1,'*')<CR> - " if ! hasmapto('<Plug>CamelCaseMotion_?', '*') - " *map <silent> ,? <Plug>CamelCaseMotion_? - " endif - - for l:mode in ['n', 'o', 'v'] - for l:motion in ['w', 'b', 'e'] - let l:targetMapping = '<Plug>CamelCaseMotion_' . l:motion - execute l:mode . 'noremap <script> ' . l:targetMapping . ' :<C-U>call <SID>CamelCaseMotion(''' . l:motion . ''',v:count1,''' . l:mode . ''')<CR>' - if ! hasmapto(l:targetMapping, l:mode) - execute l:mode . 'map <silent> ,' . l:motion . ' ' . l:targetMapping - endif - endfor - endfor -endfunction -" }}}1 - -" To create a text motion, a mapping for operator-pending mode needs to be -" defined. This mapping should move the cursor according to the implemented -" motion, or mark the covered text via a visual selection. As inner text motions -" need to mark both to the left and right of the cursor position, the visual -" selection needs to be used. -" -" VIM's built-in inner text objects also work in visual mode; they have -" different behavior depending on whether visual mode has just been entered or -" whether text has already been selected. -" We deviate from that and always override the existing selection. -function! s:CreateInnerMotionMappings() "{{{1 - " Create mappings according to this template: - " (* stands for the mode [ov], ? for the underlying motion [wbe].) - " - " *noremap <script> <Plug>CamelCaseMotion_i? :<C-U>call <SID>CamelCaseInnerMotion('?',v:count1)<CR> - " if ! hasmapto('<Plug>CamelCaseInnerMotion_i?', '*') - " *map <silent> i,? <Plug>CamelCaseInnerMotion_i? - " endif - - for l:mode in ['o', 'v'] - for l:motion in ['w', 'b', 'e'] - let l:targetMapping = '<Plug>CamelCaseMotion_i' . l:motion - execute l:mode . 'noremap <script> ' . l:targetMapping . ' :<C-U>call <SID>CamelCaseInnerMotion(''' . l:motion . ''',v:count1)<CR>' - if ! hasmapto(l:targetMapping, l:mode) - execute l:mode . 'map <silent> i,' . l:motion . ' ' . l:targetMapping - endif - endfor - endfor -endfunction -" }}}1 - -call s:CreateMotionMappings() -call s:CreateInnerMotionMappings() - -" vim: set sts=4 sw=4 noexpandtab ff=unix fdm=marker : diff --git a/.vim/plugin/cocoa.vim b/.vim/plugin/cocoa.vim deleted file mode 100644 index b6d23a4..0000000 --- a/.vim/plugin/cocoa.vim +++ /dev/null @@ -1,16 +0,0 @@ -" File: cocoa.vim -" Author: Michael Sanders msanders [at] gmail [dot] com -if exists('s:did_cocoa') || &cp || version < 700 - finish -endif -let s:did_cocoa = 1 - -" These have to load after the normal ftplugins to override the defaults; I'd -" like to put this in ftplugin/objc_cocoa_mappings.vim, but that doesn't seem -" to work.. -au FileType objc ru after/syntax/objc_enhanced.vim - \| let b:match_words = '@\(implementation\|interface\):@end' - \| setl inc=^\s*#\s*import omnifunc=objc#cocoacomplete#Complete - \| if globpath(expand('<afile>:p:h'), '*.xcodeproj') != '' | - \ setl makeprg=open\ -a\ xcode\ &&\ osascript\ -e\ 'tell\ app\ \"Xcode\"\ to\ build' - \| endif diff --git a/.vim/plugin/cscope_maps.vim b/.vim/plugin/cscope_maps.vim deleted file mode 100644 index 59bfd83..0000000 --- a/.vim/plugin/cscope_maps.vim +++ /dev/null @@ -1,166 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" CSCOPE settings for vim -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" -" This file contains some boilerplate settings for vim's cscope interface, -" plus some keyboard mappings that I've found useful. -" -" USAGE: -" -- vim 6: Stick this file in your ~/.vim/plugin directory (or in a -" 'plugin' directory in some other directory that is in your -" 'runtimepath'. -" -" -- vim 5: Stick this file somewhere and 'source cscope.vim' it from -" your ~/.vimrc file (or cut and paste it into your .vimrc). -" -" NOTE: -" These key maps use multiple keystrokes (2 or 3 keys). If you find that vim -" keeps timing you out before you can complete them, try changing your timeout -" settings, as explained below. -" -" Happy cscoping, -" -" Jason Duell jduell@alumni.princeton.edu 2002/3/7 -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - - -" This tests to see if vim was configured with the '--enable-cscope' option -" when it was compiled. If it wasn't, time to recompile vim... -if has("cscope") - - """"""""""""" Standard cscope/vim boilerplate - set nocsverb - - " use both cscope and ctag for 'ctrl-]', ':ta', and 'vim -t' - set cscopetag - - " check cscope for definition of a symbol before checking ctags: set to 1 - " if you want the reverse search order. - set csto=0 - - " add any cscope database in current directory - if filereadable("cscope.out") - cs add cscope.out - " else add the database pointed to by environment variable - elseif $CSCOPE_DB != "" - cs add $CSCOPE_DB - endif - - " show msg when any other cscope db added - set cscopeverbose - - - """"""""""""" My cscope/vim key mappings - " - " The following maps all invoke one of the following cscope search types: - " - " 's' symbol: find all references to the token under cursor - " 'g' global: find global definition(s) of the token under cursor - " 'c' calls: find all calls to the function name under cursor - " 't' text: find all instances of the text under cursor - " 'e' egrep: egrep search for the word under cursor - " 'f' file: open the filename under cursor - " 'i' includes: find files that include the filename under cursor - " 'd' called: find functions that function under cursor calls - " - " Below are three sets of the maps: one set that just jumps to your - " search result, one that splits the existing vim window horizontally and - " diplays your search result in the new window, and one that does the same - " thing, but does a vertical split instead (vim 6 only). - " - " I've used CTRL-\ and CTRL-@ as the starting keys for these maps, as it's - " unlikely that you need their default mappings (CTRL-\'s default use is - " as part of CTRL-\ CTRL-N typemap, which basically just does the same - " thing as hitting 'escape': CTRL-@ doesn't seem to have any default use). - " If you don't like using 'CTRL-@' or CTRL-\, , you can change some or all - " of these maps to use other keys. One likely candidate is 'CTRL-_' - " (which also maps to CTRL-/, which is easier to type). By default it is - " used to switch between Hebrew and English keyboard mode. - " - " All of the maps involving the <cfile> macro use '^<cfile>$': this is so - " that searches over '#include <time.h>" return only references to - " 'time.h', and not 'sys/time.h', etc. (by default cscope will return all - " files that contain 'time.h' as part of their name). - - - " To do the first type of search, hit 'CTRL-\', followed by one of the - " cscope search types above (s,g,c,t,e,f,i,d). The result of your cscope - " search will be displayed in the current window. You can use CTRL-T to - " go back to where you were before the search. - " - - nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR> - nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR> - nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR> - nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR> - nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR> - nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR> - nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR> - nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR> - - - " Using 'CTRL-spacebar' (intepreted as CTRL-@ by vim) then a search type - " makes the vim window split horizontally, with search result displayed in - " the new window. - " - " (Note: earlier versions of vim may not have the :scs command, but it - " can be simulated roughly via: - " nmap <C-@>s <C-W><C-S> :cs find s <C-R>=expand("<cword>")<CR><CR> - - nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR><CR> - nmap <C-@>g :scs find g <C-R>=expand("<cword>")<CR><CR> - nmap <C-@>c :scs find c <C-R>=expand("<cword>")<CR><CR> - nmap <C-@>t :scs find t <C-R>=expand("<cword>")<CR><CR> - nmap <C-@>e :scs find e <C-R>=expand("<cword>")<CR><CR> - nmap <C-@>f :scs find f <C-R>=expand("<cfile>")<CR><CR> - nmap <C-@>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR> - nmap <C-@>d :scs find d <C-R>=expand("<cword>")<CR><CR> - - - " Hitting CTRL-space *twice* before the search type does a vertical - " split instead of a horizontal one (vim 6 and up only) - " - " (Note: you may wish to put a 'set splitright' in your .vimrc - " if you prefer the new window on the right instead of the left - - nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR> - nmap <C-@><C-@>g :vert scs find g <C-R>=expand("<cword>")<CR><CR> - nmap <C-@><C-@>c :vert scs find c <C-R>=expand("<cword>")<CR><CR> - nmap <C-@><C-@>t :vert scs find t <C-R>=expand("<cword>")<CR><CR> - nmap <C-@><C-@>e :vert scs find e <C-R>=expand("<cword>")<CR><CR> - nmap <C-@><C-@>f :vert scs find f <C-R>=expand("<cfile>")<CR><CR> - nmap <C-@><C-@>i :vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR> - nmap <C-@><C-@>d :vert scs find d <C-R>=expand("<cword>")<CR><CR> - - - """"""""""""" key map timeouts - " - " By default Vim will only wait 1 second for each keystroke in a mapping. - " You may find that too short with the above typemaps. If so, you should - " either turn off mapping timeouts via 'notimeout'. - " - "set notimeout - " - " Or, you can keep timeouts, by uncommenting the timeoutlen line below, - " with your own personal favorite value (in milliseconds): - " - "set timeoutlen=4000 - " - " Either way, since mapping timeout settings by default also set the - " timeouts for multicharacter 'keys codes' (like <F1>), you should also - " set ttimeout and ttimeoutlen: otherwise, you will experience strange - " delays as vim waits for a keystroke after you hit ESC (it will be - " waiting to see if the ESC is actually part of a key code like <F1>). - " - "set ttimeout - " - " personally, I find a tenth of a second to work well for key code - " timeouts. If you experience problems and have a slow terminal or network - " connection, set it higher. If you don't set ttimeoutlen, the value for - " timeoutlent (default: 1000 = 1 second, which is sluggish) is used. - " - "set ttimeoutlen=100 - -endif - - diff --git a/.vim/plugin/cscopemenu.vim b/.vim/plugin/cscopemenu.vim deleted file mode 100644 index ebb3e26..0000000 --- a/.vim/plugin/cscopemenu.vim +++ /dev/null @@ -1,24 +0,0 @@ -" Add_Cscope_Menu -" Adds a cscope menu -" All the commands work on the word that is under the cursor -function! s:Add_CScope_Menu(menu_clear) - if has("gui_running") - if (a:menu_clear) - - silent! unmenu &Cscope - silent! unmenu! &Cscope - amenu <silent> &Cscope.Find\ functions\ calling\ this\ function :cs find c <C-R>=expand("<cword>") <CR><CR> - amenu <silent> &Cscope.Find\ functions\ called\ by\ this\ function :cs find d <C-R>=expand("<cword>") <CR><CR> - amenu <silent> &Cscope.Find\ this\ egrep\ pattern :cs find e <C-R>=expand("<cword>") <CR><CR> - amenu <silent> &Cscope.Find\ this\ file :cs find f <C-R>=expand("<cword>") <CR><CR> - amenu <silent> &Cscope.Find\ this\ definition :cs find g <C-R>=expand("<cword>") <CR><CR> - amenu <silent> &Cscope.Find\ files\ #including\ this\ file :cs find i <C-R>=expand("<cfile>") <CR><CR> - amenu <silent> &Cscope.Find\ this\ Symbol :cs find s <C-R>=expand("<cword>") <CR><CR> - amenu <silent> &Cscope.Find\ assignments\ to :cs find t <C-R>=expand("<cword>") <CR><CR> - endif - endif - -endfunction - - -autocmd BufEnter * call s:Add_CScope_Menu(1) diff --git a/.vim/plugin/genutils.vim b/.vim/plugin/genutils.vim deleted file mode 100755 index 35edd74..0000000 --- a/.vim/plugin/genutils.vim +++ /dev/null @@ -1,996 +0,0 @@ -" genutils: Useful buffer, file and window related functions. -" Author: Hari Krishna Dara (hari_vim at yahoo dot com) -" Last Change: 08-Jun-2007 @ 17:36 -" Requires: Vim-7.0 -" Version: 2.4.0 -" Licence: This program is free software; you can redistribute it and/or -" modify it under the terms of the GNU General Public License. -" See http://www.gnu.org/copyleft/gpl.txt -" Acknowledgements: -" - The genutils#GetNextWinnrInStack() function is based on the WinStackMv() -" function posted by Charles E. Campbell, Jr. on vim mailing list on Jul -" 14, 2004. -" - The genutils#CommonPath() function is based on the thread, -" "computing relative path" on Jul 29, 2002. -" - The genutils#ShowLinesWithSyntax() function is based on a posting by -" Gary Holloway (gary at castandcrew dot com) on Jan, 16 2002. -" - Robert Webb for the original "quick sort" algorithm from eval.txt. -" - Peit Delport's (pjd at 303 dot za dot net) for his original BISort() -" algorithm on which the genutils#BinInsertSort() and -" genutils#BinInsertSort2() functions are based on. -" Download From: -" http://www.vim.org/script.php?script_id=197 -" See Also: autoload/genutils.vim -" -" Description: -" - Read the "Documentation With Function Prototypes" section below. -" - Misc. window/buffer related functions, genutils#NumberOfWindows(), -" genutils#FindBufferForName(), genutils#MoveCursorToWindow(), -" genutils#MoveCurLineToWinLine(), genutils#SetupScratchBuffer(), -" genutils#MapAppendCascaded() -" - Save/Restore all the window height/width settings to be restored later. -" - Save/Restore position in the buffer to be restored later. Works like the -" built-in marks feature, but has more to it. -" - genutils#AddNotifyWindowClose() to get notifications *after* a window -" with the specified buffer has been closed or the buffer is unloaded. The -" built-in autocommands can only notify you *before* the window is closed. -" You can use this with the Save/Restore window settings feature to -" restore the dimensions of existing windows, after your window is closed -" (just like how Vim does while closing help windows). See selectbuf.vim -" or perforce.vim for examples. -" There is also a test function called RunNotifyWindowCloseTest() that -" demos the usage (you need to uncomment RunNotifyWindowCloseTest and -" NotifyWindowCloseF functions). -" - genutils#ShowLinesWithSyntax() function to echo lines with syntax coloring. -" - genutils#ShiftWordInSpace(), genutils#CenterWordInSpace() and -" genutils#AlignWordWithWordInPreviousLine() utility functions to move -" words in the space without changing the width of the field. A -" genutils#GetSpacer() function to return a spacer of specified width. -" - Binary search function genutils#BinSearchList() for sorted lists, to -" find the index after which a given item can be inserted to keep the list -" in sorted order. You can also use these functions to just search for -" boundaries. -" There are also a couple of functions genutils#BinSearchForInsert() and -" genutils#BinSearchForInsert2() to find the location for a newline to be -" inserted in an already sorted buffer or arbitrary data. -" There are also a few comparison functions that can be used with sort() or -" the above functions. -" - ExecMap function has now been separated as a plugin called execmap.vim. -" - New genutils#CommonPath() function to extract the common part of two -" paths, and genutils#RelPathFromFile() and genutils#RelPathFromDir() to -" find relative paths (useful HTML href's). A side effect is the -" genutils#CommonString() function to find the common string of two -" strings. -" - genutils#UnEscape() and genutils#DeEscape() functions to reverse and -" genutils#Escape() to compliment what built-in escape() does. There is -" also an genutils#EscapeCommand() function to escape external command -" strings. -" - Utility functions genutils#CurLineHasSign() and genutils#ClearAllSigns() -" to fill in the gaps left by Vim. -" - genutils#GetVimCmdOutput() function to capture the output of Vim built-in -" commands, in a safe manner. -" - genutils#OptClearBuffer() function to clear the contents and undo -" history of the current buffer in an optimal manner. Ideal to be used -" when plugins need to refresh their windows and don't care about -" preserving the current contents (which is the most usual case). -" - genutils#GetPreviewWinnr() function. -" - Functions to have persistent data, genutils#PutPersistentVar() and -" genutils#GetPersistentVar(). You don't need to worry about saving in -" files and reading them back. To disable, set g:genutilsNoPersist in your -" vimrc. -" - A function to emulate the default Vim behavior for |timestamp| changes. -" It also provides hooks to get call backs before and after handling the -" default FileChangedShell autocommand (effectively splitting it into a -" Pre and a Post event). Suggested usage is to use -" genutils#AddToFCShellPre() and either install a default event handling -" mechanism for all files by calling genutils#DefFCShellInstall() or -" create your own autocommand on a matching pattern to call -" genutils#DefFileChangedShell() function. Most useful for the source -" control plugins to conditionally reload a file, while being able to -" default to the Vim's standard behavior of asking the user. See -" perforce.vim for usage examples. -" - Utility function genutils#ExtractFuncListing() that is useful to to -" create snippets (see breakpts.vim, ntservices.vim and ntprocesses.vim -" for interesting ideas on how to use this function). -" -" Function Prototypes: -" The types in prototypes of the functions mimic Java. -" This is just a full list for a quick reference, see -" "Documentation With Function Prototypes" for more information on the -" functions. -" -" void genutils#DebugShowArgs(...) -" String genutils#ExtractFuncListing(String funcName, String hLines, String tLines) -" int genutils#NumberOfWindows() -" int genutils#FindBufferForName(String fileName) -" String genutils#GetBufNameForAu(String bufName) -" void genutils#MoveCursorToWindow(int winno) -" void genutils#MoveCurLineToWinLine(int winLine) -" void genutils#CloseWindow(int winnr, boolean force) -" void genutils#MarkActiveWindow() -" void genutils#RestoreActiveWindow() -" void genutils#IsOnlyVerticalWindow() -" void genutils#IsOnlyHorizontalWindow() -" int genutils#GetNextWinnrInStack(char dir) -" int genutils#GetLastWinnrInStack(char dir) -" void genutils#MoveCursorToNextInWinStack(char dir) -" void genutils#MoveCursorToLastInWinStack(char dir) -" void genutils#OpenWinNoEa(String openWinCmd) -" void genutils#CloseWinNoEa(int winnr, boolean force) -" void genutils#SetupScratchBuffer() -" void genutils#CleanDiffOptions() -" boolean genutils#ArrayVarExists(String varName, int index) -" void genutils#MapAppendCascaded(String lhs, String rhs, String mapMode) -" void genutils#SaveWindowSettings() -" void genutils#RestoreWindowSettings() -" void genutils#ResetWindowSettings() -" void genutils#SaveWindowSettings2(String id, boolean overwrite) -" void genutils#RestoreWindowSettings2(String id) -" void genutils#ResetWindowSettings2(String id) -" void genutils#SaveVisualSelection(String id) -" void genutils#RestoreVisualSelection(String id) -" void genutils#SaveSoftPosition(String id) -" void genutils#RestoreSoftPosition(String id) -" void genutils#ResetSoftPosition(String id) -" void genutils#SaveHardPosition(String id) -" void genutils#RestoreHardPosition(String id) -" void genutils#ResetHardPosition(String id) -" int genutils#GetLinePosition(String id) -" int genutils#GetColPosition(String id) -" boolean genutils#IsPositionSet(String id) -" String genutils#CleanupFileName(String fileName) -" String genutils#CleanupFileName2(String fileName, String win32ProtectedChars) -" boolean genutils#OnMS() -" boolean genutils#PathIsAbsolute(String path) -" boolean genutils#PathIsFileNameOnly(String path) -" void genutils#AddNotifyWindowClose(String windowTitle, String functionName) -" void genutils#RemoveNotifyWindowClose(String windowTitle) -" void genutils#CheckWindowClose() -" void genutils#ShowLinesWithSyntax() range -" void genutils#ShiftWordInSpace(int direction) -" void genutils#CenterWordInSpace() -" int genutils#BinSearchList(List list, int start, int end, Object item, -" [Funcref|String] cmp, int direction) -" int genutils#BinSearchForInsert(int start, int end, String line, -" String cmp, int direction) -" int genutils#BinSearchForInsert2(int start, int end, line, String cmp, -" int direction, String accessor, String context) -" String genutils#CommonPath(String path1, String path2) -" String genutils#CommonString(String str1, String str2) -" String genutils#RelPathFromFile(String srcFile, String tgtFile) -" String genutils#RelPathFromDir(String srcDir, String tgtFile) -" String genutils#Roman2Decimal(String str) -" String genutils#Escape(String str, String chars) -" String genutils#UnEscape(String str, String chars) -" String genutils#DeEscape(String str) -" String genutils#CrUnProtectedCharsPattern(String chars) -" String genutils#EscapeCommand(String cmd, List/String args, List/String pipe) -" int genutils#GetShellEnvType() -" String genutils#ExpandStr(String str) -" String genutils#QuoteStr(String str) -" boolean genutils#CurLineHasSign() -" void genutils#ClearAllSigns() -" String genutils#UserFileComplete(String ArgLead, String CmdLine, -" String CursorPos, String smartSlash, String searchPath) -" String genutils#UserFileExpand(String fileArgs) -" String genutils#GetVimCmdOutput(String cmd) -" void genutils#OptClearBuffer() -" int genutils#GetPreviewWinnr() -" void genutils#PutPersistentVar(String pluginName, String persistentVar, -" String value) -" void genutils#GetPersistentVar(String pluginName, String persistentVar, -" String default) -" void genutils#AddToFCShellPre(String funcName) -" void genutils#RemoveFromFCShellPre(String funcName) -" void genutils#DefFCShellInstall() -" void genutils#DefFCShellUninstall() -" boolean genutils#DefFileChangedShell() -" void genutils#SilentSubstitute(String pat, String cmd) -" void genutils#SilentDelete(String pat) -" void genutils#SilentDelete(String range, String pat) -" String genutils#GetSpacer(int width) -" String genutils#PromptForElement(List array, -" [String defaultValue | int defaultIndex], String msg, -" String skip, boolean useDialog, int nCols) -" int genutils#GetSelectedIndex() -" -" Documentation With Function Prototypes: -" ----------------------- -" Useful function to debug passing arguments to functions. See exactly what -" you would receive on the other side. -" Ex: :exec 'call genutils#DebugShowArgs('. genutils#CreateArgString("a 'b' c", ' ') . ')' -" -" void genutils#DebugShowArgs(...) -" ----------------------- -" This function returns the body of the specified function ( the name should be -" complete, including any scriptid prefix in case of a script local -" function), without the function header and tail. You can also pass in the -" number of additional lines to be removed from the head and or tail of the -" function. -" -" String genutils#ExtractFuncListing(String funcName, String hLines, String tLines) -" ----------------------- -" ----------------------- -" Return the number of windows open currently. -" -" int genutils#NumberOfWindows() -" ----------------------- -" Returns the buffer number of the given fileName if it is already loaded. -" The fileName argument is treated literally, unlike the bufnr() which treats -" the argument as a filename-pattern. The function first escape all the -" |filename-pattern| characters before passing it to bufnr(). It should work -" in most of the cases, except when backslashes are used in non-windows -" platforms, when the result could be unpredictable. -" -" Note: The function removes protections for "#%" characters because, these -" are special characters on Vim commandline, and so are usually escaped -" themselves, but bufnr() wouldn't like them. -" -" int genutils#FindBufferForName(String fileName) -" ----------------------- -" Returns the transformed buffer name that is suitable to be used in -" autocommands. -" -" String genutils#GetBufNameForAu(String bufName) -" ----------------------- -" Given the window number, moves the cursor to that window. -" -" void genutils#MoveCursorToWindow(int winno) -" ----------------------- -" Moves the current line such that it is going to be the nth line in the window -" without changing the column position. -" -" void genutils#MoveCurLineToWinLine(int winLine) -" ----------------------- -" Closes the given window and returns to the original window. It the simplest, -" this is equivalent to: -" -" let curWin = winnr() -" exec winnr 'wincmd w' -" close -" exec curWin 'wincmd w' -" -" But the function keeps track of the change in window numbers and restores -" the current window correctly. It also restores the previous window (the -" window that the cursor would jump to when executing "wincmd p" command). -" This is something that all plugins should do while moving around in the -" windows, behind the scenes. -" -" Pass 1 to force closing the window (:close!). -" -" void genutils#CloseWindow(int winnr, boolean force) -" ----------------------- -" Remembers the number of the current window as well as the previous-window -" (the one the cursor would jump to when executing "wincmd p" command). To -" determine the window number of the previous-window, the function temporarily -" jumps to the previous-window, so if your script intends to avoid generating -" unnecessary window events, consider disabling window events before calling -" this function (see :h 'eventignore'). -" -" void genutils#MarkActiveWindow() -" ----------------------- -" Restore the cursor to the window that was previously marked as "active", as -" well as its previous-window (the one the cursor would jump to when executing -" "wincmd p" command). To restore the window number of the previous-window, -" the function temporarily jumps to the previous-window, so if your script -" intends to avoid generating unnecessary window events, consider disabling -" window events before calling this function (see :h 'eventignore'). -" -" void genutils#RestoreActiveWindow() -" ----------------------- -" Returns 1 if the current window is the only window vertically. -" -" void genutils#IsOnlyVerticalWindow() -" ----------------------- -" Returns 1 if the current window is the only window horizontally. -" -" void genutils#IsOnlyHorizontalWindow() -" ----------------------- -" Returns the window number of the next window while remaining in the same -" horizontal or vertical window stack (or 0 when there are no more). Pass -" hjkl characters to indicate direction. -" Usage: -" let wn = genutils#GetNextWinnrInStack('h') left window number in stack. -" let wn = genutils#GetNextWinnrInStack('l') right window number in stack. -" let wn = genutils#GetNextWinnrInStack('j') upper window number in stack. -" let wn = genutils#GetNextWinnrInStack('k') lower window number in stack. -" -" int genutils#GetNextWinnrInStack(char dir) -" ----------------------- -" Returns the window number of the last window while remaining in the same -" horizontal or vertical window stack (or 0 when there are no more, or it is -" already the last window). Pass hjkl characters to indicate direction. -" Usage: -" let wn = genutils#GetLastWinnrInStack('h') leftmost window number in stack. -" let wn = genutils#GetLastWinnrInStack('l') rightmost window number in stack. -" let wn = genutils#GetLastWinnrInStack('j') top window number in stack. -" let wn = genutils#GetLastWinnrInStack('k') bottom window number in stack. -" -" int genutils#GetLastWinnrInStack(char dir) -" ----------------------- -" Move cursor to the next window in stack. See genutils#GetNextWinnrInStack() -" for more information. -" -" void genutils#MoveCursorToNextInWinStack(char dir) -" ----------------------- -" Move cursor to the last window in stack. See genutils#GetLastWinnrInStack() -" for more information. -" -" void genutils#MoveCursorToLastInWinStack(char dir) -" ----------------------- -" This function, which stands for "execute the given command that creates a -" window, while disabling the 'equalalways' setting", is a means for plugins -" to create new windows without disturbing the existing window dimensions as -" much as possible. This function would not be required if 'equalalways' is -" not set by the user. Even if set, the below code, though intuitive, -" wouldn't work: -" let _equalalways = &equalalways -" set noequalalways -" " open window now. -" let &equalalways = _equalalways -" -" The problem is that while restoring the value of equalalways, if the user -" originally had it set, Vim would immediately try to equalize all the -" window dimensions, which is exactly what we tried to avoid by setting -" 'noequalalways'. The function works around the problem by temporarily -" setting 'winfixheight' in all the existing windows and restoring them -" after done. -" Usage: -" call genutils#OpenWinNoEa('sb ' pluginBuf) -" -" Note: The function doesn't catch any exceptions that are generated by the -" operations, so it is advisable to catch them by the caller itself. -" -" void genutils#OpenWinNoEa(String openWinCmd) -" ----------------------- -" This is for the same purpose as described for genutils#OpenWinNoEa() -" function, except that it is used to close a given window. This is just a -" convenience function. -" -" void genutils#CloseWinNoEa(int winnr, boolean force) -" ----------------------- -" Turn on some buffer settings that make it suitable to be a scratch buffer. -" -" void genutils#SetupScratchBuffer() -" ----------------------- -" Turns off those options that are set by diff to the current window. -" Also removes the 'hor' option from scrollopt (which is a global option). -" Better alternative would be to close the window and reopen the buffer in a -" new window. -" -" void genutils#CleanDiffOptions() -" ----------------------- -" This function is an alternative to exists() function, for those odd array -" index names for which the built-in function fails. The var should be -" accessible to this functions, so it shouldn't be a local or script local -" variable. -" if genutils#ArrayVarExists("array", id) -" let val = array{id} -" endif -" -" boolean genutils#ArrayVarExists(String varName, int index) -" ----------------------- -" If lhs is already mapped, this function makes sure rhs is appended to it -" instead of overwriting it. If you are rhs has any script local functions, -" make sure you use the <SNR>\d\+_ prefix instead of the <SID> prefix (or the -" <SID> will be replaced by the SNR number of genutils script, instead of -" yours). -" mapMode is used to prefix to "oremap" and used as the map command. E.g., if -" mapMode is 'n', then the function call results in the execution of noremap -" command. -" -" void genutils#MapAppendCascaded(String lhs, String rhs, String mapMode) -" ----------------------- -" ----------------------- -" Saves the heights and widths of the currently open windows for restoring -" later. -" -" void genutils#SaveWindowSettings() -" ----------------------- -" Restores the heights of the windows from the information that is saved by -" genutils#SaveWindowSettings(). Works only when the number of windows -" haven't changed since the genutils#SaveWindowSettings is called. -" -" void genutils#RestoreWindowSettings() -" ----------------------- -" Reset the previously saved window settings using genutils#SaveWindowSettings. -" -" void genutils#ResetWindowSettings() -" ----------------------- -" Same as genutils#SaveWindowSettings, but uses the passed in id to create a -" private copy for the calling script. Pass in a unique id to avoid -" conflicting with other callers. If overwrite is zero and if the settings -" are already stored for the passed in id, it will overwrite previously -" saved settings. -" -" void genutils#SaveWindowSettings2(String id, boolean overwrite) -" ----------------------- -" Same as genutils#RestoreWindowSettings, but uses the passed in id to get the -" settings. The settings must have been previously saved using this -" id. Call genutils#ResetWindowSettings2() to explicitly reset the saved -" settings. -" -" void genutils#RestoreWindowSettings2(String id) -" ----------------------- -" Reset the previously saved window settings using genutils#SaveWindowSettings2. -" Releases the variables. -" -" void genutils#ResetWindowSettings2(String id) -" ----------------------- -" ----------------------- -" Save the current/last visual selection such that it can be later restored -" using genutils#RestoreVisualSelection(). Pass a unique id such that it will -" not interfere with the other callers to this function. Saved selections -" are not associated with the window so you can later restore the selection -" in any window, provided there are enough lines/columns. -" -" void genutils#SaveVisualSelection(String id) -" ----------------------- -" Restore the visual selection that was previuosly saved using -" genutils#SaveVisualSelection(). -" -" void genutils#RestoreVisualSelection(String id) -" ----------------------- -" ----------------------- -" This method tries to save the hard position along with the line context This -" is like the vim builtin marker. Pass in a unique id to avoid -" conflicting with other callers. -" -" void genutils#SaveSoftPosition(String id) -" ----------------------- -" Restore the cursor position using the information saved by the previous call -" to genutils#SaveSoftPosition. This first calls -" genutils#RestoreHardPosition() and then searches for the original line -" first in the forward direction and then in the backward and positions the -" cursor on the line if found. If the original line is not found it still -" behaves like a call to genutils#RestoreHardPosition. This is similar to -" the functionality of the built-in marker, as Vim is capable of maintaining -" the marker even when the line is moved up or down. However, if there are -" identical lines in the buffer and the original line has moved, this -" function might get confused. -" -" void genutils#RestoreSoftPosition(String id) -" ----------------------- -" Reset the previously cursor position using genutils#SaveSoftPosition. -" Releases the variables. -" -" void genutils#ResetSoftPosition(String id) -" ----------------------- -" Useful when you want to go to the exact (line, col), but marking will not -" work, or if you simply don't want to disturb the marks. Pass in a unique -" id. -" -" void genutils#SaveHardPosition(String id) -" ----------------------- -" Restore the cursor position using the information saved by the previous call -" to genutils#SaveHardPosition. -" -" void genutils#RestoreHardPosition(String id) -" ----------------------- -" Reset the previously cursor position using genutils#SaveHardPosition. -" Releases the variables. -" -" void genutils#ResetHardPosition(String id) -" ----------------------- -" Return the line number of the previously saved position for the id. -" This is like calling line() builtin function for a mark. -" -" int genutils#GetLinePosition(String id) -" ----------------------- -" Return the column number of the previously saved position for the id. -" This is like calling col() builtin function for a mark. -" -" int genutils#GetColPosition(String id) -" ----------------------- -" A convenience function to check if a position has been saved (and not reset) -" using the id given. -" -" boolean genutils#IsPositionSet(String id) -" ----------------------- -" ----------------------- -" Cleanup file name such that two *cleaned up* file names are easy to be -" compared. This probably works only on windows and unix platforms. Also -" recognizes UNC paths. Always returns paths with forward slashes only, -" irrespective of what your 'shellslash' setting is. The return path will -" always be a valid path for use in Vim, provided the original path itself -" was valid for the platform (a valid cygwin path after the cleanup will -" still be valid in a cygwin vim). The CleanupFileName2() variant is meant -" for win32, to avoid translating some backslash protections to be treated -" as regular path separators. Pass the characters that are protected, and -" the backslashes infront of them are preserved. -" -" String genutils#CleanupFileName(String fileName) -" String genutils#CleanupFileName2(String fileName, String win32ProtectedChars) -" ----------------------- -" Returns true if the current OS is any of the Microsoft OSes. Most useful to -" know if the path separator is "\". -" -" boolean genutils#OnMS() -" ----------------------- -" Returns true if the given path could be an absolute path. Probably works -" only on Unix and Windows platforms. -" -" boolean genutils#PathIsAbsolute(String path) -" ----------------------- -" Returns true if the given path doesn't have any directory components. -" Probably works only on Unix and Windows platforms. -" -" boolean genutils#PathIsFileNameOnly(String path) -" ----------------------- -" ----------------------- -" Add a notification to know when a buffer with the given name (referred to as -" windowTitle) is no longer visible in any window. This by functionality is -" like a BufWinLeavePost event. The function functionName is called back -" with the title (buffer name) as an argument. The notification gets removed -" after excuting it, so for future notifications, you need to reregister -" your function. You can only have one notification for any buffer. The -" function should be accessible from the script's local context. -" -" void genutils#AddNotifyWindowClose(String windowTitle, String functionName) -" ----------------------- -" Remove the notification previously added using genutils#AddNotifyWindowClose -" function. -" -" void genutils#RemoveNotifyWindowClose(String windowTitle) -" ----------------------- -" Normally the plugin checks for closed windows for every WinEnter event, but -" you can force a check at anytime by calling this function. -" -" void genutils#CheckWindowClose() -" ----------------------- -" ----------------------- -" Displays the given line(s) from the current file in the command area (i.e., -" echo), using that line's syntax highlighting (i.e., WYSIWYG). If no line -" number is given, display the current line. -" Originally, -" From: Gary Holloway "gary at castandcrew dot com" -" Date: Wed, 16 Jan 2002 14:31:56 -0800 -" -" void genutils#ShowLinesWithSyntax() range -" ----------------------- -" This function shifts the current word in the space without changing the -" column position of the next word. Doesn't work for tabs. -" -" void genutils#ShiftWordInSpace(int direction) -" ----------------------- -" This function centers the current word in the space without changing the -" column position of the next word. Doesn't work for tabs. -" -" void genutils#CenterWordInSpace() -" ----------------------- -" ----------------------- -" Find common path component of two filenames. -" Based on the thread, "computing relative path". -" Date: Mon, 29 Jul 2002 21:30:56 +0200 (CEST) -" The last two arguments are optional and default to 0 (false), but you can -" pass a value of 1 (true) to indicate that the path represents a directory. -" Ex: -" genutils#CommonPath('/a/b/c/d.e', '/a/b/f/g/h.i') => '/a/b/' -" genutils#CommonPath('/a/b/c/d.e', '/a/b/') => '/a/b' -" genutils#CommonPath('/a/b/c/d.e', '/a/b/', 0, 1) => '/a/b/' -" -" String genutils#CommonPath(String path1, String path2 [, boolean path1IsDir, boolean path2IsDir]) -" ----------------------- -" Find common string component of two strings. -" Based on the tread, "computing relative path". -" Date: Mon, 29 Jul 2002 21:30:56 +0200 (CEST) -" Ex: -" genutils#CommonString('abcde', 'abfghi') => 'ab' -" -" String genutils#CommonString(String str1, String str2) -" ----------------------- -" Find the relative path of tgtFile from the directory of srcFile. -" Based on the tread, "computing relative path". -" Date: Mon, 29 Jul 2002 21:30:56 +0200 (CEST) -" Ex: -" genutils#RelPathFromFile('/a/b/c/d.html', '/a/b/e/f.html') => '../f/g.html' -" -" String genutils#RelPathFromFile(String srcFile, String tgtFile) -" ----------------------- -" Find the relative path of tgtFile from the srcDir. -" Based on the tread, "computing relative path". -" Date: Mon, 29 Jul 2002 21:30:56 +0200 (CEST) -" Ex: -" genutils#RelPathFromDir('/a/b/c/d', '/a/b/e/f/g.html') => '../../e/f/g.html' -" -" String genutils#RelPathFromDir(String srcDir, String tgtFile) -" ----------------------- -" ----------------------- -" Convert Roman numerals to decimal. Doesn't detect format errors. -" Originally, -" From: "Preben Peppe Guldberg" <c928400@student.dtu.dk> -" Date: Fri, 10 May 2002 14:28:19 +0200 -" -" String genutils#Roman2Decimal(String str) -" ----------------------- -" ----------------------- -" Works like the built-in escape(), except that it escapes the specified -" characters only if they are not already escaped, so something like -" genutils#Escape('a\bc\\bd', 'b') would give 'a\bc\\\bd'. The chars value -" directly goes into the [] collection, so it can be anything that is -" accepted in []. -" -" String genutils#Escape(String str, String chars) -" ----------------------- -" Works like the reverse of the builtin escape() function, but un-escapes the -" specified characters only if they are already escaped (essentially the -" opposite of genutils#Escape()). The chars value directly goes into the [] -" collection, so it can be anything that is acceptable to []. -" -" String genutils#UnEscape(String str, String chars) -" ----------------------- -" Works like the reverse of the built-in escape() function. De-escapes all the -" escaped characters. Essentially removes one level of escaping from the -" string, so something like: 'a\b\\\\c\\d' would become 'ab\\c\d'. -" -" String genutils#DeEscape(String str) -" ----------------------- -" This function creates a pattern that avoids the given protected characters' -" from getting treated as separators, when used with split(). The argument -" goes directly into the [] atom, so make sure you pass in a valid string. -" When optional argument capture is true, the characters are placed in a -" capturing group. -" Ex: -" let paths = split(&path, genutils#CrUnProtectedCharsPattern(',')) -" -" String genutils#CrUnProtectedCharsPattern(String chars, [boolean capture = false]) -" ----------------------- -" genutils#Escape the passed in shell command with quotes and backslashes such -" a way that the arguments reach the command literally (avoids shell -" interpretations). See the function header for the kind of escapings that -" are done. The first argument is the actual command name, the second -" argument is the arguments to the command and third argument is any pipe -" command that should be appended to the command. The reason the function -" requires them to be passed separately is that the escaping is minimized -" for the first and third arguments. It is preferable to pass args as a Vim7 -" List, but it can be passed as a single string with spaces separating the -" arguments (spaces in side each argument then needs to be protected) -" Usage: -" let fullCmd = genutils#EscapeCommand('ls', ['-u', expand('%:h')], ['|', 'grep', 'xxx']) -" Note: -" If the escaped command is used on Vim command-line (such as with ":w !", -" ":r !" and ":!"), you need to further protect '%', '#' and '!' chars, -" even if they are in quotes, to avoid getting expanded by Vim before -" invoking external cmd. However this is not required for using it with -" system() function. The easiest way to escape them is by using the -" genutils#Escape() function as in "Escape(fullCmd, '%#!')". -" String genutils#EscapeCommand(String cmd, List/String args, List/String pipe) -" ----------------------- -" Returns the global ST_* constants (g:ST_WIN_CMD, g:ST_WIN_SH, g:ST_UNIX) -" based on the values of shell related settings and the OS on which Vim is -" running. -" -" int genutils#GetShellEnvType() -" ----------------------- -" -" Expands the string for the special characters. The return value should -" essentially be what you would see if it was a string constant with -" double-quotes. -" Ex: -" genutils#ExpandStr('a\tA') => 'a A' -" String genutils#ExpandStr(String str) -" ----------------------- -" Quotes the passed in string such that it can be used as a string expression -" in :execute. It sorrounds the passed in string with single-quotes while -" escaping any existing single-quotes in the string. -" -" String genutils#QuoteStr(String str) -" ----------------------- -" ----------------------- -" Returns true if the current line has a sign placed. -" -" boolean genutils#CurLineHasSign() -" ----------------------- -" Clears all signs in the current buffer. -" -" void genutils#ClearAllSigns() -" ----------------------- -" ----------------------- -" This function is suitable to be used by custom command completion functions -" for expanding filenames conditionally. The function could based on the -" context, decide whether to do a file completion or a different custom -" completion. See breakpts.vim and perforce.vim for examples. -" If you pass non-zero value to smartSlash, the function decides to use -" backslash or forwardslash as the path separator based on the user settings -" and the ArgLead, but if you always want to use only forwardslash as the -" path separator, then pass 0. If you pass in a comma separated list of -" directories as searchPath, then the file expansion is limited to the files -" under these directories. This means, you can implement your own commands -" that don't expect the user to type in the full path name to the file -" (e.g., if the user types in the command while in the explorer window, you -" could assume that the path is relative to the directory being viewed). Most -" useful with a single directory, but also useful in combination with vim -" 'runtimepath' in loading scripts etc. (see Runtime command in -" breakpts.vim). -" -" String genutils#UserFileComplete(String ArgLead, String CmdLine, String -" CursorPos, String smartSlash, String searchPath) -" ----------------------- -" This is a convenience function to expand filename meta-sequences in the -" given arguments just as Vim would have if given to a user-defined command -" as arguments with completion mode set to "file". Useful -" if you set the completion mode of your command to anything -" other than the "file", and later conditionally expand arguments (for -" characters such as % and # and other sequences such as #10 and <cword>) -" after deciding which arguments represent filenames/patterns. -" -" String genutils#UserFileExpand(String fileArgs) -" ----------------------- -" This returns the output of the vim command as a string, without corrupting -" any registers. Returns empty string on errors. Check for v:errmsg after -" calling this function for any error messages. -" -" String genutils#GetVimCmdOutput(String cmd) -" ----------------------- -" Clear the contents of the current buffer in an optimum manner. For plugins -" that keep redrawing the contents of its buffer, executing "1,$d" or its -" equivalents result in overloading Vim's undo mechanism. Using this function -" avoids that problem. -" -" void genutils#OptClearBuffer() -" ----------------------- -" Returns the window number of the preview window if open or -1 if not. -" int genutils#GetPreviewWinnr() -" ----------------------- -" ----------------------- -" These functions provide a persistent storage mechanism. -" -" Example: Put the following in a file called t.vim in your plugin -" directory and watch the magic. You can set new value using SetVar() and -" see that it returns the same value across session when GetVar() is -" called. -" >>>>t.vim<<<< -" au VimEnter * call LoadSettings() -" au VimLeavePre * call SaveSettings() -" -" function! LoadSettings() -" let s:tVar = genutils#GetPersistentVar("T", "tVar", "defVal") -" endfunction -" -" function! SaveSettings() -" call genutils#PutPersistentVar("T", "tVar", s:tVar) -" endfunction -" -" function! SetVar(val) -" let s:tVar = a:val -" endfunction -" -" function! GetVar() -" return s:tVar -" endfunction -" <<<<t.vim>>>> -" -" The pluginName and persistentVar have to be unique and are case insensitive. -" Ideally called from your VimLeavePre autocommand handler of your plugin. -" This simply creates a global variable which will be persisted by Vim -" through viminfo. The variable can be read back in the next session by the -" plugin using genutils#GetPersistentVar() function, ideally from your -" VimEnter autocommand handler. The pluginName is to provide a name space -" for different plugins, and avoid conflicts in using the same persistentVar -" name. -" This feature uses the '!' option of viminfo, to avoid storing all the -" temporary and other plugin specific global variables getting saved. -" -" void genutils#PutPersistentVar(String pluginName, String persistentVar, -" String value) -" ----------------------- -" Ideally called from VimEnter, this simply reads the value of the global -" variable for the persistentVar that is saved in the viminfo in a previous -" session using genutils#PutPersistentVar() and returns it (and default if -" the variable is not found). It removes the variable from global space -" before returning the value, so can be called only once. It also means that -" genutils#PutPersistentVar should be called again in the next VimLeavePre -" if the variable continues to be persisted. -" -" void genutils#GetPersistentVar(String pluginName, String persistentVar, -" String default) -" ----------------------- -" ----------------------- -" These functions channel the FileChangedShell autocommand and extend it to -" create an additional fictitious FileChangedShellPre and FileChangedShellPost -" events. -" -" Add the given noarg function to the list of functions that need to be -" notified before processing the FileChangedShell event. The function when -" called can expand "<abuf>" or "<afile>" to get the details of the buffer -" for which this autocommand got executed. It should return 0 to mean -" noautoread and 1 to mean autoread the current buffer. It can also return -" -1 to make its return value ignored and use default autoread mechanism -" (which could still be overridden by the return value of other functions). -" The return value of all the functions is ORed to determine the effective -" autoread value. -" -" void genutils#AddToFCShellPre(String funcName) -" ----------------------- -" Remove the given function previously added by calling -" genutils#AddToFCShellPre. -" -" void genutils#RemoveFromFCShellPre(String funcName) -" ----------------------- -" Same as genutils#AddToFCShellPre except that the function is called after -" the event is processed, so this is like a fictitious FileChangedShellPost -" event. -" -" void genutils#DefFCShellInstall() -" ----------------------- -" Uninstall the default autocommand handler that was previously installed -" using genutils#DefFCShellInstall. Calling this function may not actually -" result in removing the handler, in case there are other callers still -" dependent on it (which is kept track of by the number of times -" genutils#DefFCShellInstall has been called). -" -" void genutils#DefFCShellUninstall() -" ----------------------- -" This function emulates the Vim's default behavior when a |timestamp| change -" is detected. Register your functions by calling genutils#AddToFCShellPre -" and have this function called during the FileChangedShell event (or just -" install the default handler by calling genutils#DefFCShellInstall). From -" your callbacks, return 1 to mean autoread, 0 to mean noautoread and -1 to -" mean system default (or ignore). The return value of this method is 1 if -" the file was reloaded and 0 otherwise. The return value of all the -" functions is ORed to determine the effective autoread value. See my -" perforce plugin for usage example. -" -" boolean genutils#DefFileChangedShell() -" ----------------------- -" Execute a substitute command silently and without corrupting the search -" register. It also preserves the cursor position. -" Ex: -" To insert a tab infrontof all lines: -" call genutils#SilentSubstitute('^', '%s//\t/e') -" To remote all carriage returns at the line ending: -" call genutils#SilentSubstitute("\<CR>$", '%s///e') -" -" void genutils#SilentSubstitute(String pat, String cmd) -" ----------------------- -" Delete all lines matching the given pattern silently and without corrupting -" the search register. The range argument if passed should be a valid prefix -" for the :global command. It also preserves the cursor position. -" Ex: -" To delete all lines that are empty: -" call genutils#SilentDelete('^\s*$') -" To delete all lines that are empty only in the range 10 to 100: -" call genutils#SilentDelete('10,100', '^\s*$') -" -" void genutils#SilentDelete(String pat) -" void genutils#SilentDelete(String range, String pat) -" ----------------------- -" Can return a spacer from 0 to 80 characters width. -" -" String genutils#GetSpacer(int width) -" ----------------------- -" Function to prompt user for an element out of the passed in array. The -" user will be prompted with a list of choices to make. The elements will be -" formatted in to the given number of columns. Each element will be given a -" number that the user can enter to indicate the selection. This is very -" much like the inputlist() method, but better for a large number of options -" formatted into multiple columns (instead of one per row). However, if the -" formatted options run for multiple pages, no special handling is done. -" Params: -" default - The default value for the selection. Default can be the -" element-index or the element itself. If number (type() returns -" 0), it is treated as an index. -" msg - The message that should appear in the prompt (passed to input()). -" skip - The element that needs to be skipped from selection (pass a -" non-existent element to disable this, such as an empty value ''). -" useDialog - if true, uses dialogs for prompts, instead of the command-line( -" inputdialog() instead of input()). But personally, I don't -" like this because the power user then can't use the -" expression register. -" nCols - Number of columns to use for formatting the options. Using "1" -" will make the output look very like that of inputlist() -" Returns: -" the selected element or empty string, "" if nothing is selected. Call -" genutils#GetSelectedIndex() for the index entered by the user. -" -" Ex: -" echo genutils#PromptForElement(map(range(0,25), -" \ "nr2char(char2nr('a')+v:val)") , 'd', 'Enter: ', 'x', 1, 5) -" String genutils#PromptForElement(List array, -" [String defaultValue | int defaultIndex], String msg, -" String skip, boolean useDialog, int nCols) -" -" Returns the index of the element selected by the user in the previous -" genutils#PromptForElement call. Returns -1 when the user didn't select -" any element (aborted the selection). This function is useful if there are -" empty or duplicate elements in the selection. -" int genutils#GetSelectedIndex() -" ----------------------- -" Deprecations: -" - CleanDiffOptions() is deprecated as Vim now has the :diffoff command. -" - MakeArgumentString, MakeArgumentList and CreateArgString are deprecated. -" Vim7 now includes call() function to receive and pass argument lists -" around. -" - The g:makeArgumentString and g:makeArgumentList are obsolete and are -" deprecated, please use MakeArgumentString() and MakeArgumentList() -" instead. -" - FindWindowForBuffer() function is now deprecated, as the corresponding -" Vim bugs are fixed. Use the below expr instead: -" bufwinnr(genutils#FindBufferForName(fileName)) -" - QSort(), QSort2(), BinInsertSort() and BinInsertSort2() functions are -" now deprecated in favor of sort() function. -" -" -" Sample Usages Or Tips: -" - Add the following commands to create simple sort commands. -" command! -nargs=0 -range=% SortByLength <line1>,<line2>call -" \ genutils#QSort('genutils#CmpByLineLengthNname', 1) -" command! -nargs=0 -range=% RSortByLength <line1>,<line2>call -" \ genutils#QSort('genutils#CmpByLineLengthNname', -1) -" command! -nargs=0 -range=% SortJavaImports <line1>,<line2>call -" \ genutils#QSort('genutils#CmpJavaImports', 1) -" -" - You might like the following mappings to adjust spacing: -" nnoremap <silent> <C-Space> :call genutils#ShiftWordInSpace(1)<CR> -" nnoremap <silent> <C-BS> :call genutils#ShiftWordInSpace(-1)<CR> -" nnoremap <silent> \cw :call genutils#CenterWordInSpace()<CR> -" nnoremap <silent> \va :call -" \ genutils#AlignWordWithWordInPreviousLine()<CR> -" -" - The :find command is very useful to search for a file in path, but it -" doesn't support file completion. Add the following command in your vimrc -" to add this functionality: -" command! -nargs=1 -bang -complete=custom,<SID>PathComplete FindInPath -" \ :find<bang> <args> -" function! s:PathComplete(ArgLead, CmdLine, CursorPos) -" return genutils#UserFileComplete(a:ArgLead, a:CmdLine, a:CursorPos, 1, -" \ &path) -" endfunction -" -" - If you are running commands that generate multiple pages of output, you -" might find it useful to redirect the output to a new buffer. Put the -" following command in your vimrc: -" command! -nargs=* -complete=command Redir -" \ :new | put! =genutils#GetVimCmdOutput('<args>') | -" \ setl bufhidden=wipe | setl nomodified -" -" Changes in 2.4: -" - Fixed some corner cases in RelPathFromDir()/RelPathFromFile(). -" - Made the default comparators sort() function friendly. -" Changes in 2.3: -" - SilentSubstitute() and SilentDelete() should preserve cursor position. -" - CleanupFileName() should also remove any leading or trailing whitespace. -" Changes in 2.2: -" - EscapeCommand() now supports Lists as arguments. -" - CrUnProtectedCharsPattern() now accepts an optional "capture" argument. -" - Renamed PromptForElement2 to PromptForElement. It was a typo. -" Changes in 2.1: -" - Fixed a typo in AddNotifyWindowClose() in the previous release. -" - Added BinSearchList() function. -" Changes in 2.0: -" - Converted to Vim7 autoload script. Since there is no common prefix to -" find all the usages of genutils functions in your script, Use the -" pattern \<\(:\|>\|#\)\@<!\zs\u\w\+( to find all the global functions and -" prefix the ones from genutils with genutils#. -" - The new version is not backwards compatible with prior versions. If you -" have plugins that depend on the older versions of genutils, you should try -" to request the author to port their plugin to use the new genutils. If -" having them to coexist is a must, then use the below trick: -" - Install the latest version of genutils first. Overwriting all existing -" files. -" - Open the plugin/genutils.vim file and note the value set to -" loaded_genutils variable. -" - Install the older version of genutils (non autoload version) in to -" plugin directory, overwriting the existing file. -" - Open the plugin/genutils.vim again and change the value of -" loaded_genutils variable to the value you noted before and save it. -" - Fix for Save/RestoreHardPosition() not working right when there are -" wrapped lines in the window. -" - Dropped the AddToFCShell and RemoveFromFCShell functions as these can't be -" implemented in Vim7 because of new restrictions on FileChangedShell -" autocommand. Use AddToFcShellPre and RemoveFromFCShellPre functions -" instead. -" - No longer depends on multvals plugin. Inherits some useful functions from -" multvals to make way for it to be retired. New functions are: -" genutils#CrUnProtectedCharsPattern -" PromptForElement/GetSelectedIndex - -if exists('loaded_genutils') - finish -endif -if v:version < 700 - echomsg 'genutils: You need at least Vim 7.0' - finish -endif - -let loaded_genutils = 204 diff --git a/.vim/plugin/gotags.vim b/.vim/plugin/gotags.vim deleted file mode 100644 index 6ba029c..0000000 --- a/.vim/plugin/gotags.vim +++ /dev/null @@ -1,27 +0,0 @@ -let g:tagbar_type_go = { - \ 'ctagstype' : 'go', - \ 'kinds' : [ - \ 'p:package', - \ 'i:imports:1', - \ 'c:constants', - \ 'v:variables', - \ 't:types', - \ 'n:interfaces', - \ 'w:fields', - \ 'e:embedded', - \ 'm:methods', - \ 'r:constructor', - \ 'f:functions' - \ ], - \ 'sro' : '.', - \ 'kind2scope' : { - \ 't' : 'ctype', - \ 'n' : 'ntype' - \ }, - \ 'scope2kind' : { - \ 'ctype' : 't', - \ 'ntype' : 'n' - \ }, - \ 'ctagsbin' : 'gotags', - \ 'ctagsargs' : '-sort -silent' - \ } diff --git a/.vim/plugin/matchit.vim b/.vim/plugin/matchit.vim deleted file mode 100755 index e41cda9..0000000 --- a/.vim/plugin/matchit.vim +++ /dev/null @@ -1,812 +0,0 @@ -" matchit.vim: (global plugin) Extended "%" matching -" Last Change: Fri Jan 25 10:00 AM 2008 EST -" Maintainer: Benji Fisher PhD <benji@member.AMS.org> -" Version: 1.13.2, for Vim 6.3+ -" URL: http://www.vim.org/script.php?script_id=39 - -" Documentation: -" The documentation is in a separate file, matchit.txt . - -" Credits: -" Vim editor by Bram Moolenaar (Thanks, Bram!) -" Original script and design by Raul Segura Acevedo -" Support for comments by Douglas Potts -" Support for back references and other improvements by Benji Fisher -" Support for many languages by Johannes Zellner -" Suggestions for improvement, bug reports, and support for additional -" languages by Jordi-Albert Batalla, Neil Bird, Servatius Brandt, Mark -" Collett, Stephen Wall, Dany St-Amant, Yuheng Xie, and Johannes Zellner. - -" Debugging: -" If you'd like to try the built-in debugging commands... -" :MatchDebug to activate debugging for the current buffer -" This saves the values of several key script variables as buffer-local -" variables. See the MatchDebug() function, below, for details. - -" TODO: I should think about multi-line patterns for b:match_words. -" This would require an option: how many lines to scan (default 1). -" This would be useful for Python, maybe also for *ML. -" TODO: Maybe I should add a menu so that people will actually use some of -" the features that I have implemented. -" TODO: Eliminate the MultiMatch function. Add yet another argument to -" Match_wrapper() instead. -" TODO: Allow :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1' -" TODO: Make backrefs safer by using '\V' (very no-magic). -" TODO: Add a level of indirection, so that custom % scripts can use my -" work but extend it. - -" allow user to prevent loading -" and prevent duplicate loading -if exists("loaded_matchit") || &cp - finish -endif -let loaded_matchit = 1 -let s:last_mps = "" -let s:last_words = ":" - -let s:save_cpo = &cpo -set cpo&vim - -nnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'n') <CR> -nnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'n') <CR> -vnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'v') <CR>m'gv`` -vnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'v') <CR>m'gv`` -onoremap <silent> % v:<C-U>call <SID>Match_wrapper('',1,'o') <CR> -onoremap <silent> g% v:<C-U>call <SID>Match_wrapper('',0,'o') <CR> - -" Analogues of [{ and ]} using matching patterns: -nnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "n") <CR> -nnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "n") <CR> -vmap [% <Esc>[%m'gv`` -vmap ]% <Esc>]%m'gv`` -" vnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "v") <CR>m'gv`` -" vnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "v") <CR>m'gv`` -onoremap <silent> [% v:<C-U>call <SID>MultiMatch("bW", "o") <CR> -onoremap <silent> ]% v:<C-U>call <SID>MultiMatch("W", "o") <CR> - -" text object: -vmap a% <Esc>[%v]% - -" Auto-complete mappings: (not yet "ready for prime time") -" TODO Read :help write-plugin for the "right" way to let the user -" specify a key binding. -" let g:match_auto = '<C-]>' -" let g:match_autoCR = '<C-CR>' -" if exists("g:match_auto") -" execute "inoremap " . g:match_auto . ' x<Esc>"=<SID>Autocomplete()<CR>Pls' -" endif -" if exists("g:match_autoCR") -" execute "inoremap " . g:match_autoCR . ' <CR><C-R>=<SID>Autocomplete()<CR>' -" endif -" if exists("g:match_gthhoh") -" execute "inoremap " . g:match_gthhoh . ' <C-O>:call <SID>Gthhoh()<CR>' -" endif " gthhoh = "Get the heck out of here!" - -let s:notslash = '\\\@<!\%(\\\\\)*' - -function! s:Match_wrapper(word, forward, mode) range - " In s:CleanUp(), :execute "set" restore_options . - let restore_options = (&ic ? " " : " no") . "ignorecase" - if exists("b:match_ignorecase") - let &ignorecase = b:match_ignorecase - endif - let restore_options = " ve=" . &ve . restore_options - set ve= - " If this function was called from Visual mode, make sure that the cursor - " is at the correct end of the Visual range: - if a:mode == "v" - execute "normal! gv\<Esc>" - endif - " In s:CleanUp(), we may need to check whether the cursor moved forward. - let startline = line(".") - let startcol = col(".") - " Use default behavior if called with a count. - if v:count - exe "normal! " . v:count . "%" - return s:CleanUp(restore_options, a:mode, startline, startcol) - end - - " First step: if not already done, set the script variables - " s:do_BR flag for whether there are backrefs - " s:pat parsed version of b:match_words - " s:all regexp based on s:pat and the default groups - " - if !exists("b:match_words") || b:match_words == "" - let match_words = "" - " Allow b:match_words = "GetVimMatchWords()" . - elseif b:match_words =~ ":" - let match_words = b:match_words - else - execute "let match_words =" b:match_words - endif -" Thanks to Preben "Peppe" Guldberg and Bram Moolenaar for this suggestion! - if (match_words != s:last_words) || (&mps != s:last_mps) || - \ exists("b:match_debug") - let s:last_words = match_words - let s:last_mps = &mps - " The next several lines were here before - " BF started messing with this script. - " quote the special chars in 'matchpairs', replace [,:] with \| and then - " append the builtin pairs (/*, */, #if, #ifdef, #else, #elif, #endif) - " let default = substitute(escape(&mps, '[$^.*~\\/?]'), '[,:]\+', - " \ '\\|', 'g').'\|\/\*\|\*\/\|#if\>\|#ifdef\>\|#else\>\|#elif\>\|#endif\>' - let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") . - \ '\/\*:\*\/,#if\%(def\)\=:#else\>:#elif\>:#endif\>' - " s:all = pattern with all the keywords - let match_words = match_words . (strlen(match_words) ? "," : "") . default - if match_words !~ s:notslash . '\\\d' - let s:do_BR = 0 - let s:pat = match_words - else - let s:do_BR = 1 - let s:pat = s:ParseWords(match_words) - endif - let s:all = substitute(s:pat, s:notslash . '\zs[,:]\+', '\\|', 'g') - let s:all = '\%(' . s:all . '\)' - " let s:all = '\%(' . substitute(s:all, '\\\ze[,:]', '', 'g') . '\)' - if exists("b:match_debug") - let b:match_pat = s:pat - endif - endif - - " Second step: set the following local variables: - " matchline = line on which the cursor started - " curcol = number of characters before match - " prefix = regexp for start of line to start of match - " suffix = regexp for end of match to end of line - " Require match to end on or after the cursor and prefer it to - " start on or before the cursor. - let matchline = getline(startline) - if a:word != '' - " word given - if a:word !~ s:all - echohl WarningMsg|echo 'Missing rule for word:"'.a:word.'"'|echohl NONE - return s:CleanUp(restore_options, a:mode, startline, startcol) - endif - let matchline = a:word - let curcol = 0 - let prefix = '^\%(' - let suffix = '\)$' - " Now the case when "word" is not given - else " Find the match that ends on or after the cursor and set curcol. - let regexp = s:Wholematch(matchline, s:all, startcol-1) - let curcol = match(matchline, regexp) - " If there is no match, give up. - if curcol == -1 - return s:CleanUp(restore_options, a:mode, startline, startcol) - endif - let endcol = matchend(matchline, regexp) - let suf = strlen(matchline) - endcol - let prefix = (curcol ? '^.*\%' . (curcol + 1) . 'c\%(' : '^\%(') - let suffix = (suf ? '\)\%' . (endcol + 1) . 'c.*$' : '\)$') - endif - if exists("b:match_debug") - let b:match_match = matchstr(matchline, regexp) - let b:match_col = curcol+1 - endif - - " Third step: Find the group and single word that match, and the original - " (backref) versions of these. Then, resolve the backrefs. - " Set the following local variable: - " group = colon-separated list of patterns, one of which matches - " = ini:mid:fin or ini:fin - " - " Reconstruct the version with unresolved backrefs. - let patBR = substitute(match_words.',', - \ s:notslash.'\zs[,:]*,[,:]*', ',', 'g') - let patBR = substitute(patBR, s:notslash.'\zs:\{2,}', ':', 'g') - " Now, set group and groupBR to the matching group: 'if:endif' or - " 'while:endwhile' or whatever. A bit of a kluge: s:Choose() returns - " group . "," . groupBR, and we pick it apart. - let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR) - let i = matchend(group, s:notslash . ",") - let groupBR = strpart(group, i) - let group = strpart(group, 0, i-1) - " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix - if s:do_BR " Do the hard part: resolve those backrefs! - let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline) - endif - if exists("b:match_debug") - let b:match_wholeBR = groupBR - let i = matchend(groupBR, s:notslash . ":") - let b:match_iniBR = strpart(groupBR, 0, i-1) - endif - - " Fourth step: Set the arguments for searchpair(). - let i = matchend(group, s:notslash . ":") - let j = matchend(group, '.*' . s:notslash . ":") - let ini = strpart(group, 0, i-1) - let mid = substitute(strpart(group, i,j-i-1), s:notslash.'\zs:', '\\|', 'g') - let fin = strpart(group, j) - "Un-escape the remaining , and : characters. - let ini = substitute(ini, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') - let mid = substitute(mid, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') - let fin = substitute(fin, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') - " searchpair() requires that these patterns avoid \(\) groups. - let ini = substitute(ini, s:notslash . '\zs\\(', '\\%(', 'g') - let mid = substitute(mid, s:notslash . '\zs\\(', '\\%(', 'g') - let fin = substitute(fin, s:notslash . '\zs\\(', '\\%(', 'g') - " Set mid. This is optimized for readability, not micro-efficiency! - if a:forward && matchline =~ prefix . fin . suffix - \ || !a:forward && matchline =~ prefix . ini . suffix - let mid = "" - endif - " Set flag. This is optimized for readability, not micro-efficiency! - if a:forward && matchline =~ prefix . fin . suffix - \ || !a:forward && matchline !~ prefix . ini . suffix - let flag = "bW" - else - let flag = "W" - endif - " Set skip. - if exists("b:match_skip") - let skip = b:match_skip - elseif exists("b:match_comment") " backwards compatibility and testing! - let skip = "r:" . b:match_comment - else - let skip = 's:comment\|string' - endif - let skip = s:ParseSkip(skip) - if exists("b:match_debug") - let b:match_ini = ini - let b:match_tail = (strlen(mid) ? mid.'\|' : '') . fin - endif - - " Fifth step: actually start moving the cursor and call searchpair(). - " Later, :execute restore_cursor to get to the original screen. - let restore_cursor = virtcol(".") . "|" - normal! g0 - let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor - normal! H - let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor - execute restore_cursor - call cursor(0, curcol + 1) - " normal! 0 - " if curcol - " execute "normal!" . curcol . "l" - " endif - if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on")) - let skip = "0" - else - execute "if " . skip . "| let skip = '0' | endif" - endif - let sp_return = searchpair(ini, mid, fin, flag, skip) - let final_position = "call cursor(" . line(".") . "," . col(".") . ")" - " Restore cursor position and original screen. - execute restore_cursor - normal! m' - if sp_return > 0 - execute final_position - endif - return s:CleanUp(restore_options, a:mode, startline, startcol, mid.'\|'.fin) -endfun - -" Restore options and do some special handling for Operator-pending mode. -" The optional argument is the tail of the matching group. -fun! s:CleanUp(options, mode, startline, startcol, ...) - execute "set" a:options - " Open folds, if appropriate. - if a:mode != "o" - if &foldopen =~ "percent" - normal! zv - endif - " In Operator-pending mode, we want to include the whole match - " (for example, d%). - " This is only a problem if we end up moving in the forward direction. - elseif (a:startline < line(".")) || - \ (a:startline == line(".") && a:startcol < col(".")) - if a:0 - " Check whether the match is a single character. If not, move to the - " end of the match. - let matchline = getline(".") - let currcol = col(".") - let regexp = s:Wholematch(matchline, a:1, currcol-1) - let endcol = matchend(matchline, regexp) - if endcol > currcol " This is NOT off by one! - execute "normal!" . (endcol - currcol) . "l" - endif - endif " a:0 - endif " a:mode != "o" && etc. - return 0 -endfun - -" Example (simplified HTML patterns): if -" a:groupBR = '<\(\k\+\)>:</\1>' -" a:prefix = '^.\{3}\(' -" a:group = '<\(\k\+\)>:</\(\k\+\)>' -" a:suffix = '\).\{2}$' -" a:matchline = "123<tag>12" or "123</tag>12" -" then extract "tag" from a:matchline and return "<tag>:</tag>" . -fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline) - if a:matchline !~ a:prefix . - \ substitute(a:group, s:notslash . '\zs:', '\\|', 'g') . a:suffix - return a:group - endif - let i = matchend(a:groupBR, s:notslash . ':') - let ini = strpart(a:groupBR, 0, i-1) - let tailBR = strpart(a:groupBR, i) - let word = s:Choose(a:group, a:matchline, ":", "", a:prefix, a:suffix, - \ a:groupBR) - let i = matchend(word, s:notslash . ":") - let wordBR = strpart(word, i) - let word = strpart(word, 0, i-1) - " Now, a:matchline =~ a:prefix . word . a:suffix - if wordBR != ini - let table = s:Resolve(ini, wordBR, "table") - else - " let table = "----------" - let table = "" - let d = 0 - while d < 10 - if tailBR =~ s:notslash . '\\' . d - " let table[d] = d - let table = table . d - else - let table = table . "-" - endif - let d = d + 1 - endwhile - endif - let d = 9 - while d - if table[d] != "-" - let backref = substitute(a:matchline, a:prefix.word.a:suffix, - \ '\'.table[d], "") - " Are there any other characters that should be escaped? - let backref = escape(backref, '*,:') - execute s:Ref(ini, d, "start", "len") - let ini = strpart(ini, 0, start) . backref . strpart(ini, start+len) - let tailBR = substitute(tailBR, s:notslash . '\zs\\' . d, - \ escape(backref, '\\'), 'g') - endif - let d = d-1 - endwhile - if exists("b:match_debug") - if s:do_BR - let b:match_table = table - let b:match_word = word - else - let b:match_table = "" - let b:match_word = "" - endif - endif - return ini . ":" . tailBR -endfun - -" Input a comma-separated list of groups with backrefs, such as -" a:groups = '\(foo\):end\1,\(bar\):end\1' -" and return a comma-separated list of groups with backrefs replaced: -" return '\(foo\):end\(foo\),\(bar\):end\(bar\)' -fun! s:ParseWords(groups) - let groups = substitute(a:groups.",", s:notslash.'\zs[,:]*,[,:]*', ',', 'g') - let groups = substitute(groups, s:notslash . '\zs:\{2,}', ':', 'g') - let parsed = "" - while groups =~ '[^,:]' - let i = matchend(groups, s:notslash . ':') - let j = matchend(groups, s:notslash . ',') - let ini = strpart(groups, 0, i-1) - let tail = strpart(groups, i, j-i-1) . ":" - let groups = strpart(groups, j) - let parsed = parsed . ini - let i = matchend(tail, s:notslash . ':') - while i != -1 - " In 'if:else:endif', ini='if' and word='else' and then word='endif'. - let word = strpart(tail, 0, i-1) - let tail = strpart(tail, i) - let i = matchend(tail, s:notslash . ':') - let parsed = parsed . ":" . s:Resolve(ini, word, "word") - endwhile " Now, tail has been used up. - let parsed = parsed . "," - endwhile " groups =~ '[^,:]' - let parsed = substitute(parsed, ',$', '', '') - return parsed -endfun - -" TODO I think this can be simplified and/or made more efficient. -" TODO What should I do if a:start is out of range? -" Return a regexp that matches all of a:string, such that -" matchstr(a:string, regexp) represents the match for a:pat that starts -" as close to a:start as possible, before being preferred to after, and -" ends after a:start . -" Usage: -" let regexp = s:Wholematch(getline("."), 'foo\|bar', col(".")-1) -" let i = match(getline("."), regexp) -" let j = matchend(getline("."), regexp) -" let match = matchstr(getline("."), regexp) -fun! s:Wholematch(string, pat, start) - let group = '\%(' . a:pat . '\)' - let prefix = (a:start ? '\(^.*\%<' . (a:start + 2) . 'c\)\zs' : '^') - let len = strlen(a:string) - let suffix = (a:start+1 < len ? '\(\%>'.(a:start+1).'c.*$\)\@=' : '$') - if a:string !~ prefix . group . suffix - let prefix = '' - endif - return prefix . group . suffix -endfun - -" No extra arguments: s:Ref(string, d) will -" find the d'th occurrence of '\(' and return it, along with everything up -" to and including the matching '\)'. -" One argument: s:Ref(string, d, "start") returns the index of the start -" of the d'th '\(' and any other argument returns the length of the group. -" Two arguments: s:Ref(string, d, "foo", "bar") returns a string to be -" executed, having the effect of -" :let foo = s:Ref(string, d, "start") -" :let bar = s:Ref(string, d, "len") -fun! s:Ref(string, d, ...) - let len = strlen(a:string) - if a:d == 0 - let start = 0 - else - let cnt = a:d - let match = a:string - while cnt - let cnt = cnt - 1 - let index = matchend(match, s:notslash . '\\(') - if index == -1 - return "" - endif - let match = strpart(match, index) - endwhile - let start = len - strlen(match) - if a:0 == 1 && a:1 == "start" - return start - 2 - endif - let cnt = 1 - while cnt - let index = matchend(match, s:notslash . '\\(\|\\)') - 1 - if index == -2 - return "" - endif - " Increment if an open, decrement if a ')': - let cnt = cnt + (match[index]=="(" ? 1 : -1) " ')' - " let cnt = stridx('0(', match[index]) + cnt - let match = strpart(match, index+1) - endwhile - let start = start - 2 - let len = len - start - strlen(match) - endif - if a:0 == 1 - return len - elseif a:0 == 2 - return "let " . a:1 . "=" . start . "| let " . a:2 . "=" . len - else - return strpart(a:string, start, len) - endif -endfun - -" Count the number of disjoint copies of pattern in string. -" If the pattern is a literal string and contains no '0' or '1' characters -" then s:Count(string, pattern, '0', '1') should be faster than -" s:Count(string, pattern). -fun! s:Count(string, pattern, ...) - let pat = escape(a:pattern, '\\') - if a:0 > 1 - let foo = substitute(a:string, '[^'.a:pattern.']', "a:1", "g") - let foo = substitute(a:string, pat, a:2, "g") - let foo = substitute(foo, '[^' . a:2 . ']', "", "g") - return strlen(foo) - endif - let result = 0 - let foo = a:string - let index = matchend(foo, pat) - while index != -1 - let result = result + 1 - let foo = strpart(foo, index) - let index = matchend(foo, pat) - endwhile - return result -endfun - -" s:Resolve('\(a\)\(b\)', '\(c\)\2\1\1\2') should return table.word, where -" word = '\(c\)\(b\)\(a\)\3\2' and table = '-32-------'. That is, the first -" '\1' in target is replaced by '\(a\)' in word, table[1] = 3, and this -" indicates that all other instances of '\1' in target are to be replaced -" by '\3'. The hard part is dealing with nesting... -" Note that ":" is an illegal character for source and target, -" unless it is preceded by "\". -fun! s:Resolve(source, target, output) - let word = a:target - let i = matchend(word, s:notslash . '\\\d') - 1 - let table = "----------" - while i != -2 " There are back references to be replaced. - let d = word[i] - let backref = s:Ref(a:source, d) - " The idea is to replace '\d' with backref. Before we do this, - " replace any \(\) groups in backref with :1, :2, ... if they - " correspond to the first, second, ... group already inserted - " into backref. Later, replace :1 with \1 and so on. The group - " number w+b within backref corresponds to the group number - " s within a:source. - " w = number of '\(' in word before the current one - let w = s:Count( - \ substitute(strpart(word, 0, i-1), '\\\\', '', 'g'), '\(', '1') - let b = 1 " number of the current '\(' in backref - let s = d " number of the current '\(' in a:source - while b <= s:Count(substitute(backref, '\\\\', '', 'g'), '\(', '1') - \ && s < 10 - if table[s] == "-" - if w + b < 10 - " let table[s] = w + b - let table = strpart(table, 0, s) . (w+b) . strpart(table, s+1) - endif - let b = b + 1 - let s = s + 1 - else - execute s:Ref(backref, b, "start", "len") - let ref = strpart(backref, start, len) - let backref = strpart(backref, 0, start) . ":". table[s] - \ . strpart(backref, start+len) - let s = s + s:Count(substitute(ref, '\\\\', '', 'g'), '\(', '1') - endif - endwhile - let word = strpart(word, 0, i-1) . backref . strpart(word, i+1) - let i = matchend(word, s:notslash . '\\\d') - 1 - endwhile - let word = substitute(word, s:notslash . '\zs:', '\\', 'g') - if a:output == "table" - return table - elseif a:output == "word" - return word - else - return table . word - endif -endfun - -" Assume a:comma = ",". Then the format for a:patterns and a:1 is -" a:patterns = "<pat1>,<pat2>,..." -" a:1 = "<alt1>,<alt2>,..." -" If <patn> is the first pattern that matches a:string then return <patn> -" if no optional arguments are given; return <patn>,<altn> if a:1 is given. -fun! s:Choose(patterns, string, comma, branch, prefix, suffix, ...) - let tail = (a:patterns =~ a:comma."$" ? a:patterns : a:patterns . a:comma) - let i = matchend(tail, s:notslash . a:comma) - if a:0 - let alttail = (a:1 =~ a:comma."$" ? a:1 : a:1 . a:comma) - let j = matchend(alttail, s:notslash . a:comma) - endif - let current = strpart(tail, 0, i-1) - if a:branch == "" - let currpat = current - else - let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g') - endif - while a:string !~ a:prefix . currpat . a:suffix - let tail = strpart(tail, i) - let i = matchend(tail, s:notslash . a:comma) - if i == -1 - return -1 - endif - let current = strpart(tail, 0, i-1) - if a:branch == "" - let currpat = current - else - let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g') - endif - if a:0 - let alttail = strpart(alttail, j) - let j = matchend(alttail, s:notslash . a:comma) - endif - endwhile - if a:0 - let current = current . a:comma . strpart(alttail, 0, j-1) - endif - return current -endfun - -" Call this function to turn on debugging information. Every time the main -" script is run, buffer variables will be saved. These can be used directly -" or viewed using the menu items below. -if !exists(":MatchDebug") - command! -nargs=0 MatchDebug call s:Match_debug() -endif - -fun! s:Match_debug() - let b:match_debug = 1 " Save debugging information. - " pat = all of b:match_words with backrefs parsed - amenu &Matchit.&pat :echo b:match_pat<CR> - " match = bit of text that is recognized as a match - amenu &Matchit.&match :echo b:match_match<CR> - " curcol = cursor column of the start of the matching text - amenu &Matchit.&curcol :echo b:match_col<CR> - " wholeBR = matching group, original version - amenu &Matchit.wh&oleBR :echo b:match_wholeBR<CR> - " iniBR = 'if' piece, original version - amenu &Matchit.ini&BR :echo b:match_iniBR<CR> - " ini = 'if' piece, with all backrefs resolved from match - amenu &Matchit.&ini :echo b:match_ini<CR> - " tail = 'else\|endif' piece, with all backrefs resolved from match - amenu &Matchit.&tail :echo b:match_tail<CR> - " fin = 'endif' piece, with all backrefs resolved from match - amenu &Matchit.&word :echo b:match_word<CR> - " '\'.d in ini refers to the same thing as '\'.table[d] in word. - amenu &Matchit.t&able :echo '0:' . b:match_table . ':9'<CR> -endfun - -" Jump to the nearest unmatched "(" or "if" or "<tag>" if a:spflag == "bW" -" or the nearest unmatched "</tag>" or "endif" or ")" if a:spflag == "W". -" Return a "mark" for the original position, so that -" let m = MultiMatch("bW", "n") ... execute m -" will return to the original position. If there is a problem, do not -" move the cursor and return "", unless a count is given, in which case -" go up or down as many levels as possible and again return "". -" TODO This relies on the same patterns as % matching. It might be a good -" idea to give it its own matching patterns. -fun! s:MultiMatch(spflag, mode) - if !exists("b:match_words") || b:match_words == "" - return "" - end - let restore_options = (&ic ? "" : "no") . "ignorecase" - if exists("b:match_ignorecase") - let &ignorecase = b:match_ignorecase - endif - let startline = line(".") - let startcol = col(".") - - " First step: if not already done, set the script variables - " s:do_BR flag for whether there are backrefs - " s:pat parsed version of b:match_words - " s:all regexp based on s:pat and the default groups - " This part is copied and slightly modified from s:Match_wrapper(). - let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") . - \ '\/\*:\*\/,#if\%(def\)\=:#else\>:#elif\>:#endif\>' - " Allow b:match_words = "GetVimMatchWords()" . - if b:match_words =~ ":" - let match_words = b:match_words - else - execute "let match_words =" b:match_words - endif - if (match_words != s:last_words) || (&mps != s:last_mps) || - \ exists("b:match_debug") - let s:last_words = match_words - let s:last_mps = &mps - if match_words !~ s:notslash . '\\\d' - let s:do_BR = 0 - let s:pat = match_words - else - let s:do_BR = 1 - let s:pat = s:ParseWords(match_words) - endif - let s:all = '\%(' . substitute(s:pat . (strlen(s:pat)?",":"") . default, - \ '[,:]\+','\\|','g') . '\)' - if exists("b:match_debug") - let b:match_pat = s:pat - endif - endif - - " Second step: figure out the patterns for searchpair() - " and save the screen, cursor position, and 'ignorecase'. - " - TODO: A lot of this is copied from s:Match_wrapper(). - " - maybe even more functionality should be split off - " - into separate functions! - let cdefault = (s:pat =~ '[^,]$' ? "," : "") . default - let open = substitute(s:pat . cdefault, - \ s:notslash . '\zs:.\{-}' . s:notslash . ',', '\\),\\(', 'g') - let open = '\(' . substitute(open, s:notslash . '\zs:.*$', '\\)', '') - let close = substitute(s:pat . cdefault, - \ s:notslash . '\zs,.\{-}' . s:notslash . ':', '\\),\\(', 'g') - let close = substitute(close, '^.\{-}' . s:notslash . ':', '\\(', '') . '\)' - if exists("b:match_skip") - let skip = b:match_skip - elseif exists("b:match_comment") " backwards compatibility and testing! - let skip = "r:" . b:match_comment - else - let skip = 's:comment\|string' - endif - let skip = s:ParseSkip(skip) - " let restore_cursor = line(".") . "G" . virtcol(".") . "|" - " normal! H - " let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor - let restore_cursor = virtcol(".") . "|" - normal! g0 - let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor - normal! H - let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor - execute restore_cursor - - " Third step: call searchpair(). - " Replace '\('--but not '\\('--with '\%(' and ',' with '\|'. - let openpat = substitute(open, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g') - let openpat = substitute(openpat, ',', '\\|', 'g') - let closepat = substitute(close, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g') - let closepat = substitute(closepat, ',', '\\|', 'g') - if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on")) - let skip = '0' - else - execute "if " . skip . "| let skip = '0' | endif" - endif - mark ' - let level = v:count1 - while level - if searchpair(openpat, '', closepat, a:spflag, skip) < 1 - call s:CleanUp(restore_options, a:mode, startline, startcol) - return "" - endif - let level = level - 1 - endwhile - - " Restore options and return a string to restore the original position. - call s:CleanUp(restore_options, a:mode, startline, startcol) - return restore_cursor -endfun - -" Search backwards for "if" or "while" or "<tag>" or ... -" and return "endif" or "endwhile" or "</tag>" or ... . -" For now, this uses b:match_words and the same script variables -" as s:Match_wrapper() . Later, it may get its own patterns, -" either from a buffer variable or passed as arguments. -" fun! s:Autocomplete() -" echo "autocomplete not yet implemented :-(" -" if !exists("b:match_words") || b:match_words == "" -" return "" -" end -" let startpos = s:MultiMatch("bW") -" -" if startpos == "" -" return "" -" endif -" " - TODO: figure out whether 'if' or '<tag>' matched, and construct -" " - the appropriate closing. -" let matchline = getline(".") -" let curcol = col(".") - 1 -" " - TODO: Change the s:all argument if there is a new set of match pats. -" let regexp = s:Wholematch(matchline, s:all, curcol) -" let suf = strlen(matchline) - matchend(matchline, regexp) -" let prefix = (curcol ? '^.\{' . curcol . '}\%(' : '^\%(') -" let suffix = (suf ? '\).\{' . suf . '}$' : '\)$') -" " Reconstruct the version with unresolved backrefs. -" let patBR = substitute(b:match_words.',', '[,:]*,[,:]*', ',', 'g') -" let patBR = substitute(patBR, ':\{2,}', ':', "g") -" " Now, set group and groupBR to the matching group: 'if:endif' or -" " 'while:endwhile' or whatever. -" let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR) -" let i = matchend(group, s:notslash . ",") -" let groupBR = strpart(group, i) -" let group = strpart(group, 0, i-1) -" " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix -" if s:do_BR -" let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline) -" endif -" " let g:group = group -" -" " - TODO: Construct the closing from group. -" let fake = "end" . expand("<cword>") -" execute startpos -" return fake -" endfun - -" Close all open structures. "Get the heck out of here!" -" fun! s:Gthhoh() -" let close = s:Autocomplete() -" while strlen(close) -" put=close -" let close = s:Autocomplete() -" endwhile -" endfun - -" Parse special strings as typical skip arguments for searchpair(): -" s:foo becomes (current syntax item) =~ foo -" S:foo becomes (current syntax item) !~ foo -" r:foo becomes (line before cursor) =~ foo -" R:foo becomes (line before cursor) !~ foo -fun! s:ParseSkip(str) - let skip = a:str - if skip[1] == ":" - if skip[0] == "s" - let skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" . - \ strpart(skip,2) . "'" - elseif skip[0] == "S" - let skip = "synIDattr(synID(line('.'),col('.'),1),'name') !~? '" . - \ strpart(skip,2) . "'" - elseif skip[0] == "r" - let skip = "strpart(getline('.'),0,col('.'))=~'" . strpart(skip,2). "'" - elseif skip[0] == "R" - let skip = "strpart(getline('.'),0,col('.'))!~'" . strpart(skip,2). "'" - endif - endif - return skip -endfun - -let &cpo = s:save_cpo - -" vim:sts=2:sw=2: diff --git a/.vim/plugin/vcsbzr.vim b/.vim/plugin/vcsbzr.vim deleted file mode 100644 index 1cc5fda..0000000 --- a/.vim/plugin/vcsbzr.vim +++ /dev/null @@ -1,257 +0,0 @@ -" vim600: set foldmethod=marker: -" -" BZR extension for VCSCommand. -" -" Version: VCS development -" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> -" License: -" Copyright (c) 2009 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. -" -" Section: Documentation {{{1 -" -" Options documentation: {{{2 -" -" VCSCommandBZRExec -" This variable specifies the BZR executable. If not set, it defaults to -" 'bzr' executed from the user's executable path. - -" Section: Plugin header {{{1 - -if exists('VCSCommandDisableAll') - finish -endif - -if v:version < 700 - echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None - finish -endif - -runtime plugin/vcscommand.vim - -if !executable(VCSCommandGetOption('VCSCommandBZRExec', 'bzr')) - " BZR is not installed - finish -endif - -let s:save_cpo=&cpo -set cpo&vim - -" Section: Variable initialization {{{1 - -let s:bzrFunctions = {} - -" Section: Utility functions {{{1 - -" Function: s:Executable() {{{2 -" Returns the executable used to invoke bzr suitable for use in a shell -" command. -function! s:Executable() - return shellescape(VCSCommandGetOption('VCSCommandBZRExec', 'bzr')) -endfunction - -" Function: s:DoCommand(cmd, cmdName, statusText) {{{2 -" Wrapper to VCSCommandDoCommand to add the name of the BZR executable to the -" command argument. -function! s:DoCommand(cmd, cmdName, statusText, options) - if VCSCommandGetVCSType(expand('%')) == 'BZR' - let fullCmd = s:Executable() . ' ' . a:cmd - return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options) - else - throw 'BZR VCSCommand plugin called on non-BZR item.' - endif -endfunction - -" Section: VCS function implementations {{{1 - -" Function: s:bzrFunctions.Identify(buffer) {{{2 -function! s:bzrFunctions.Identify(buffer) - let fileName = resolve(bufname(a:buffer)) - let statusText = s:VCSCommandUtility.system(s:Executable() . ' info -- "' . fileName . '"') - if(v:shell_error) - return 0 - else - return 1 - endif -endfunction - -" Function: s:bzrFunctions.Add() {{{2 -function! s:bzrFunctions.Add(argList) - return s:DoCommand(join(['add'] + a:argList, ' '), 'add', join(a:argList, ' '), {}) -endfunction - -" Function: s:bzrFunctions.Annotate(argList) {{{2 -function! s:bzrFunctions.Annotate(argList) - if len(a:argList) == 0 - if &filetype == 'BZRannotate' - " Perform annotation of the version indicated by the current line. - let caption = matchstr(getline('.'),'\v^\s+\zs\d+') - let options = ' -r' . caption - else - let caption = '' - let options = '' - endif - elseif len(a:argList) == 1 && a:argList[0] !~ '^-' - let caption = a:argList[0] - let options = ' -r' . caption - else - let caption = join(a:argList, ' ') - let options = ' ' . caption - endif - - let resultBuffer = s:DoCommand('blame' . options, 'annotate', caption, {}) - if resultBuffer > 0 - normal 1G2dd - endif - return resultBuffer -endfunction - -" Function: s:bzrFunctions.Commit(argList) {{{2 -function! s:bzrFunctions.Commit(argList) - let resultBuffer = s:DoCommand('commit -F "' . a:argList[0] . '"', 'commit', '', {}) - if resultBuffer == 0 - echomsg 'No commit needed.' - endif -endfunction - -" Function: s:bzrFunctions.Delete() {{{2 -function! s:bzrFunctions.Delete(argList) - return s:DoCommand(join(['rm'] + a:argList, ' '), 'rm', join(a:argList, ' '), {}) -endfunction - -" Function: s:bzrFunctions.Diff(argList) {{{2 -function! s:bzrFunctions.Diff(argList) - if len(a:argList) == 0 - let revOptions = [] - let caption = '' - elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 - let revOptions = ['-r' . join(a:argList, '..')] - let caption = '(' . a:argList[0] . ' : ' . get(a:argList, 1, 'current') . ')' - else - " Pass-through - let caption = join(a:argList, ' ') - let revOptions = a:argList - endif - - return s:DoCommand(join(['diff'] + revOptions), 'diff', caption, {'allowNonZeroExit': 1}) -endfunction - -" Function: s:bzrFunctions.GetBufferInfo() {{{2 -" Provides version control details for the current file. Current version -" number and current repository version number are required to be returned by -" the vcscommand plugin. -" Returns: List of results: [revision, repository] - -function! s:bzrFunctions.GetBufferInfo() - let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) - let fileName = resolve(bufname(originalBuffer)) - let statusText = s:VCSCommandUtility.system(s:Executable() . ' status -S -- "' . fileName . '"') - let revision = s:VCSCommandUtility.system(s:Executable() . ' revno -- "' . fileName . '"') - if(v:shell_error) - return [] - endif - - " File not under BZR control. - if statusText =~ '^?' - return ['Unknown'] - endif - - let [flags, repository] = matchlist(statusText, '^\(.\{3}\)\s\+\(\S\+\)')[1:2] - if revision == '' - " Error - return ['Unknown'] - elseif flags =~ '^A' - return ['New', 'New'] - else - return [revision, repository] - endif -endfunction - -" Function: s:bzrFunctions.Info(argList) {{{2 -function! s:bzrFunctions.Info(argList) - return s:DoCommand(join(['version-info'] + a:argList, ' '), 'version-info', join(a:argList, ' '), {}) -endfunction - -" Function: s:bzrFunctions.Lock(argList) {{{2 -function! s:bzrFunctions.Lock(argList) - echomsg 'bzr lock is not necessary' -endfunction - -" Function: s:bzrFunctions.Log() {{{2 -function! s:bzrFunctions.Log(argList) - if len(a:argList) == 0 - let options = [] - let caption = '' - elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 - let options = ['-r' . join(a:argList, ':')] - let caption = options[0] - else - " Pass-through - let options = a:argList - let caption = join(a:argList, ' ') - endif - - let resultBuffer = s:DoCommand(join(['log', '-v'] + options), 'log', caption, {}) - return resultBuffer -endfunction - -" Function: s:bzrFunctions.Revert(argList) {{{2 -function! s:bzrFunctions.Revert(argList) - return s:DoCommand('revert', 'revert', '', {}) -endfunction - -" Function: s:bzrFunctions.Review(argList) {{{2 -function! s:bzrFunctions.Review(argList) - if len(a:argList) == 0 - let versiontag = '(current)' - let versionOption = '' - else - let versiontag = a:argList[0] - let versionOption = ' -r ' . versiontag . ' ' - endif - - return s:DoCommand('cat' . versionOption, 'review', versiontag, {}) -endfunction - -" Function: s:bzrFunctions.Status(argList) {{{2 -function! s:bzrFunctions.Status(argList) - let options = ['-S'] - if len(a:argList) == 0 - let options = a:argList - endif - return s:DoCommand(join(['status'] + options, ' '), 'status', join(options, ' '), {}) -endfunction - -" Function: s:bzrFunctions.Unlock(argList) {{{2 -function! s:bzrFunctions.Unlock(argList) - echomsg 'bzr unlock is not necessary' -endfunction -" Function: s:bzrFunctions.Update(argList) {{{2 -function! s:bzrFunctions.Update(argList) - return s:DoCommand('update', 'update', '', {}) -endfunction - -" Annotate setting {{{2 -let s:bzrFunctions.AnnotateSplitRegex = '^[^|]\+ | ' - -" Section: Plugin Registration {{{1 -let s:VCSCommandUtility = VCSCommandRegisterModule('BZR', expand('<sfile>'), s:bzrFunctions, []) - -let &cpo = s:save_cpo diff --git a/.vim/plugin/vcscommand.vim b/.vim/plugin/vcscommand.vim deleted file mode 100644 index 1c5b98e..0000000 --- a/.vim/plugin/vcscommand.vim +++ /dev/null @@ -1,1402 +0,0 @@ -" vim600: set foldmethod=marker: -" -" Vim plugin to assist in working with files under control of various Version -" Control Systems, such as CVS, SVN, SVK, and git. -" -" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> -" License: -" Copyright (c) 2008 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. -" -" Section: Documentation {{{1 -" -" Provides functions to invoke various source control commands on the current -" file (either the current buffer, or, in the case of an directory buffer, the -" directory and all subdirectories associated with the current buffer). The -" output of the commands is captured in a new scratch window. -" -" This plugin needs additional extension plugins, each specific to a source -" control system, to function. Several options include the name of the -" version control system in the option name. Such options use the placeholder -" text '{VCSType}', which would be replaced in actual usage with 'CVS' or -" 'SVN', for instance. -" -" Command documentation {{{2 -" -" VCSAdd Adds the current file to source control. -" -" VCSAnnotate[!] Displays the current file with each line annotated with the -" version in which it was most recently changed. If an -" argument is given, the argument is used as a revision -" number to display. If not given an argument, it uses the -" most recent version of the file on the current branch. -" Additionally, if the current buffer is a VCSAnnotate buffer -" already, the version number on the current line is used. -" -" If '!' is used, the view of the annotated buffer is split -" so that the annotation is in a separate window from the -" content, and each is highlighted separately. -" -" VCSBlame Alias for 'VCSAnnotate'. -" -" VCSCommit[!] Commits changes to the current file to source control. -" -" If called with arguments, the arguments are the log message. -" -" If '!' is used, an empty log message is committed. -" -" If called with no arguments, this is a two-step command. -" The first step opens a buffer to accept a log message. -" When that buffer is written, it is automatically closed and -" the file is committed using the information from that log -" message. The commit can be abandoned if the log message -" buffer is deleted or wiped before being written. -" -" VCSDelete Deletes the current file and removes it from source control. -" -" VCSDiff With no arguments, this displays the differences between -" the current file and its parent version under source -" control in a new scratch buffer. -" -" With one argument, the diff is performed on the -" current file against the specified revision. -" -" With two arguments, the diff is performed between the -" specified revisions of the current file. -" -" This command uses the 'VCSCommand{VCSType}DiffOpt' variable -" to specify diff options. If that variable does not exist, -" a plugin-specific default is used. If you wish to have no -" options, then set it to the empty string. -" -" VCSGotoOriginal Jumps to the source buffer if the current buffer is a VCS -" scratch buffer. If VCSGotoOriginal[!] is used, remove all -" VCS scratch buffers associated with the original file. -" -" VCSInfo Displays extended information about the current file in a -" new scratch buffer. -" -" VCSLock Locks the current file in order to prevent other users from -" concurrently modifying it. The exact semantics of this -" command depend on the underlying VCS. -" -" VCSLog Displays the version history of the current file in a new -" scratch buffer. -" -" VCSRemove Alias for 'VCSDelete'. -" -" VCSRevert Replaces the modified version of the current file with the -" most recent version from the repository. -" -" VCSReview Displays a particular version of the current file in a new -" scratch buffer. If no argument is given, the most recent -" version of the file on the current branch is retrieved. -" -" VCSStatus Displays versioning information about the current file in a -" new scratch buffer. -" -" VCSUnlock Unlocks the current file in order to allow other users from -" concurrently modifying it. The exact semantics of this -" command depend on the underlying VCS. -" -" VCSUpdate Updates the current file with any relevant changes from the -" repository. -" -" VCSVimDiff Uses vimdiff to display differences between versions of the -" current file. -" -" If no revision is specified, the most recent version of the -" file on the current branch is used. With one argument, -" that argument is used as the revision as above. With two -" arguments, the differences between the two revisions is -" displayed using vimdiff. -" -" With either zero or one argument, the original buffer is -" used to perform the vimdiff. When the scratch buffer is -" closed, the original buffer will be returned to normal -" mode. -" -" Once vimdiff mode is started using the above methods, -" additional vimdiff buffers may be added by passing a single -" version argument to the command. There may be up to 4 -" vimdiff buffers total. -" -" Using the 2-argument form of the command resets the vimdiff -" to only those 2 versions. Additionally, invoking the -" command on a different file will close the previous vimdiff -" buffers. -" -" Mapping documentation: {{{2 -" -" By default, a mapping is defined for each command. User-provided mappings -" can be used instead by mapping to <Plug>CommandName, for instance: -" -" nmap ,ca <Plug>VCSAdd -" -" The default mappings are as follow: -" -" <Leader>ca VCSAdd -" <Leader>cn VCSAnnotate -" <Leader>cN VCSAnnotate! -" <Leader>cc VCSCommit -" <Leader>cD VCSDelete -" <Leader>cd VCSDiff -" <Leader>cg VCSGotoOriginal -" <Leader>cG VCSGotoOriginal! -" <Leader>ci VCSInfo -" <Leader>cl VCSLog -" <Leader>cL VCSLock -" <Leader>cr VCSReview -" <Leader>cs VCSStatus -" <Leader>cu VCSUpdate -" <Leader>cU VCSUnlock -" <Leader>cv VCSVimDiff -" -" Options documentation: {{{2 -" -" Several variables are checked by the script to determine behavior as follow: -" -" VCSCommandCommitOnWrite -" This variable, if set to a non-zero value, causes the pending commit to -" take place immediately as soon as the log message buffer is written. If -" set to zero, only the VCSCommit mapping will cause the pending commit to -" occur. If not set, it defaults to 1. -" -" VCSCommandDeleteOnHide -" This variable, if set to a non-zero value, causes the temporary VCS result -" buffers to automatically delete themselves when hidden. -" -" VCSCommand{VCSType}DiffOpt -" This variable, if set, determines the options passed to the diff command -" of the underlying VCS. Each VCS plugin defines a default value. -" -" VCSCommandDiffSplit -" This variable overrides the VCSCommandSplit variable, but only for buffers -" created with VCSVimDiff. -" -" VCSCommandDisableAll -" This variable, if set, prevents the plugin or any extensions from loading -" at all. This is useful when a single runtime distribution is used on -" multiple systems with varying versions. -" -" VCSCommandDisableMappings -" This variable, if set to a non-zero value, prevents the default command -" mappings from being set. -" -" VCSCommandDisableExtensionMappings -" This variable, if set to a non-zero value, prevents the default command -" mappings from being set for commands specific to an individual VCS. -" -" VCSCommandEdit -" This variable controls whether to split the current window to display a -" scratch buffer ('split'), or to display it in the current buffer ('edit'). -" If not set, it defaults to 'split'. -" -" VCSCommandEnableBufferSetup -" This variable, if set to a non-zero value, activates VCS buffer management -" mode. This mode means that the buffer variable 'VCSRevision' is set if -" the file is VCS-controlled. This is useful for displaying version -" information in the status bar. Additional options may be set by -" individual VCS plugins. -" -" VCSCommandMappings -" This variable, if set, overrides the default mappings used for shortcuts. -" It should be a List of 2-element Lists, each containing a shortcut and -" function name pair. -" -" VCSCommandMapPrefix -" This variable, if set, overrides the default mapping prefix ('<Leader>c'). -" This allows customization of the mapping space used by the vcscommand -" shortcuts. -" -" VCSCommandResultBufferNameExtension -" This variable, if set to a non-blank value, is appended to the name of the -" VCS command output buffers. For example, '.vcs'. Using this option may -" help avoid problems caused by autocommands dependent on file extension. -" -" VCSCommandResultBufferNameFunction -" This variable, if set, specifies a custom function for naming VCS command -" output buffers. This function will be passed the following arguments: -" -" command - name of the VCS command being executed (such as 'Log' or -" 'Diff'). -" -" originalBuffer - buffer number of the source file. -" -" vcsType - type of VCS controlling this file (such as 'CVS' or 'SVN'). -" -" statusText - extra text associated with the VCS action (such as version -" numbers). -" -" VCSCommandSplit -" This variable controls the orientation of the various window splits that -" may occur (such as with VCSVimDiff, when using a VCS command on a VCS -" command buffer, or when the 'VCSCommandEdit' variable is set to 'split'. -" If set to 'horizontal', the resulting windows will be on stacked on top of -" one another. If set to 'vertical', the resulting windows will be -" side-by-side. If not set, it defaults to 'horizontal' for all but -" VCSVimDiff windows. -" -" VCSCommandVCSTypeOverride -" This variable allows the VCS type detection to be overridden on a -" path-by-path basis. The value of this variable is expected to be a List -" of Lists. Each high-level List item is a List containing two elements. -" The first element is a regular expression that will be matched against the -" full file name of a given buffer. If it matches, the second element will -" be used as the VCS type. -" -" Event documentation {{{2 -" For additional customization, VCSCommand.vim uses User event autocommand -" hooks. Each event is in the VCSCommand group, and different patterns -" match the various hooks. -" -" For instance, the following could be added to the vimrc to provide a 'q' -" mapping to quit a VCS scratch buffer: -" -" augroup VCSCommand -" au VCSCommand User VCSBufferCreated silent! nmap <unique> <buffer> q :bwipeout<cr> -" augroup END -" -" The following hooks are available: -" -" VCSBufferCreated This event is fired just after a VCS command -" output buffer is created. It is executed -" within the context of the new buffer. -" -" VCSBufferSetup This event is fired just after VCS buffer setup -" occurs, if enabled. -" -" VCSPluginInit This event is fired when the VCSCommand plugin -" first loads. -" -" VCSPluginFinish This event is fired just after the VCSCommand -" plugin loads. -" -" VCSVimDiffFinish This event is fired just after the VCSVimDiff -" command executes to allow customization of, -" for instance, window placement and focus. -" -" Section: Plugin header {{{1 - -" loaded_VCSCommand is set to 1 when the initialization begins, and 2 when it -" completes. This allows various actions to only be taken by functions after -" system initialization. - -if exists('VCSCommandDisableAll') - finish -endif - -if exists('loaded_VCSCommand') - finish -endif -let loaded_VCSCommand = 1 - -if v:version < 700 - echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None - finish -endif - -let s:save_cpo=&cpo -set cpo&vim - -" Section: Event group setup {{{1 - -augroup VCSCommand -augroup END - -augroup VCSCommandCommit -augroup END - -" Section: Plugin initialization {{{1 -silent do VCSCommand User VCSPluginInit - -" Section: Constants declaration {{{1 - -let g:VCSCOMMAND_IDENTIFY_EXACT = 1 -let g:VCSCOMMAND_IDENTIFY_INEXACT = -1 - -" Section: Script variable initialization {{{1 - -" Hidden functions for use by extensions -let s:VCSCommandUtility = {} - -" plugin-specific information: {vcs -> [script, {command -> function}, {key -> mapping}]} -let s:plugins = {} - -" temporary values of overridden configuration variables -let s:optionOverrides = {} - -" state flag used to vary behavior of certain automated actions -let s:isEditFileRunning = 0 - -" commands needed to restore diff buffers to their original state -unlet! s:vimDiffRestoreCmd - -" original buffer currently reflected in vimdiff windows -unlet! s:vimDiffSourceBuffer - -" -unlet! s:vimDiffScratchList - -" Section: Utility functions {{{1 - -" Function: s:ReportError(mapping) {{{2 -" Displays the given error in a consistent faction. This is intended to be -" invoked from a catch statement. - -function! s:ReportError(error) - echohl WarningMsg|echomsg 'VCSCommand: ' . a:error|echohl None -endfunction - -" Function s:VCSCommandUtility.system(...) {{{2 -" Replacement for system() function. This version protects the quoting in the -" command line on Windows systems. - -function! s:VCSCommandUtility.system(...) - if (has("win32") || has("win64")) && &sxq !~ '"' - let save_sxq = &sxq - set sxq=\" - endif - try - return call('system', a:000) - finally - if exists("save_sxq") - let &sxq = save_sxq - endif - endtry -endfunction - -" Function: s:CreateMapping(shortcut, expansion, display) {{{2 -" Creates the given mapping by prepending the contents of -" 'VCSCommandMapPrefix' (by default '<Leader>c') to the given shortcut and -" mapping it to the given plugin function. If a mapping exists for the -" specified shortcut + prefix, emit an error but continue. If a mapping -" exists for the specified function, do nothing. - -function! s:CreateMapping(shortcut, expansion, display) - let lhs = VCSCommandGetOption('VCSCommandMapPrefix', '<Leader>c') . a:shortcut - if !hasmapto(a:expansion) - try - execute 'nmap <silent> <unique>' lhs a:expansion - catch /^Vim(.*):E227:/ - if(&verbose != 0) - echohl WarningMsg|echomsg 'VCSCommand: mapping ''' . lhs . ''' already exists, refusing to overwrite. The mapping for ' . a:display . ' will not be available.'|echohl None - endif - endtry - endif -endfunction - -" Function: s:ExecuteExtensionMapping(mapping) {{{2 -" Invokes the appropriate extension mapping depending on the type of the -" current buffer. - -function! s:ExecuteExtensionMapping(mapping) - let buffer = bufnr('%') - let vcsType = VCSCommandGetVCSType(buffer) - if !has_key(s:plugins, vcsType) - throw 'Unknown VCS type: ' . vcsType - endif - if !has_key(s:plugins[vcsType][2], a:mapping) - throw 'This extended mapping is not defined for ' . vcsType - endif - silent execute 'normal' ':' . s:plugins[vcsType][2][a:mapping] . "\<CR>" -endfunction - -" Function: s:ExecuteVCSCommand(command, argList) {{{2 -" Calls the indicated plugin-specific VCS command on the current buffer. -" Returns: buffer number of resulting output scratch buffer, or -1 if an error -" occurs. - -function! s:ExecuteVCSCommand(command, argList) - try - let buffer = bufnr('%') - - let vcsType = VCSCommandGetVCSType(buffer) - if !has_key(s:plugins, vcsType) - throw 'Unknown VCS type: ' . vcsType - endif - - let originalBuffer = VCSCommandGetOriginalBuffer(buffer) - let bufferName = bufname(originalBuffer) - - " It is already known that the directory is under VCS control. No further - " checks are needed. Otherwise, perform some basic sanity checks to avoid - " VCS-specific error messages from confusing things. - if !isdirectory(bufferName) - if !filereadable(bufferName) - throw 'No such file ' . bufferName - endif - endif - - let functionMap = s:plugins[vcsType][1] - if !has_key(functionMap, a:command) - throw 'Command ''' . a:command . ''' not implemented for ' . vcsType - endif - return functionMap[a:command](a:argList) - catch - call s:ReportError(v:exception) - return -1 - endtry -endfunction - -" Function: s:GenerateResultBufferName(command, originalBuffer, vcsType, statusText) {{{2 -" Default method of generating the name for VCS result buffers. This can be -" overridden with the VCSResultBufferNameFunction variable. - -function! s:GenerateResultBufferName(command, originalBuffer, vcsType, statusText) - let fileName = bufname(a:originalBuffer) - let bufferName = a:vcsType . ' ' . a:command - if strlen(a:statusText) > 0 - let bufferName .= ' ' . a:statusText - endif - let bufferName .= ' ' . fileName - let counter = 0 - let versionedBufferName = bufferName - while buflisted(versionedBufferName) - let counter += 1 - let versionedBufferName = bufferName . ' (' . counter . ')' - endwhile - return versionedBufferName -endfunction - -" Function: s:GenerateResultBufferNameWithExtension(command, originalBuffer, vcsType, statusText) {{{2 -" Method of generating the name for VCS result buffers that uses the original -" file name with the VCS type and command appended as extensions. - -function! s:GenerateResultBufferNameWithExtension(command, originalBuffer, vcsType, statusText) - let fileName = bufname(a:originalBuffer) - let bufferName = a:vcsType . ' ' . a:command - if strlen(a:statusText) > 0 - let bufferName .= ' ' . a:statusText - endif - let bufferName .= ' ' . fileName . VCSCommandGetOption('VCSCommandResultBufferNameExtension', '.vcs') - let counter = 0 - let versionedBufferName = bufferName - while buflisted(versionedBufferName) - let counter += 1 - let versionedBufferName = '(' . counter . ') ' . bufferName - endwhile - return versionedBufferName -endfunction - -" Function: s:EditFile(command, originalBuffer, statusText) {{{2 -" Creates a new buffer of the given name and associates it with the given -" original buffer. - -function! s:EditFile(command, originalBuffer, statusText) - let vcsType = getbufvar(a:originalBuffer, 'VCSCommandVCSType') - - " Protect against useless buffer set-up - let s:isEditFileRunning += 1 - try - let editCommand = VCSCommandGetOption('VCSCommandEdit', 'split') - if editCommand == 'split' - if VCSCommandGetOption('VCSCommandSplit', 'horizontal') == 'horizontal' - rightbelow split - else - vert rightbelow split - endif - endif - - enew - - call s:SetupScratchBuffer(a:command, vcsType, a:originalBuffer, a:statusText) - - finally - let s:isEditFileRunning -= 1 - endtry -endfunction - -" Function: s:SetupScratchBuffer(command, vcsType, originalBuffer, statusText) {{{2 -" Creates convenience buffer variables and the name of a vcscommand result -" buffer. - -function! s:SetupScratchBuffer(command, vcsType, originalBuffer, statusText) - let nameExtension = VCSCommandGetOption('VCSCommandResultBufferNameExtension', '') - if nameExtension == '' - let nameFunction = VCSCommandGetOption('VCSCommandResultBufferNameFunction', 's:GenerateResultBufferName') - else - let nameFunction = VCSCommandGetOption('VCSCommandResultBufferNameFunction', 's:GenerateResultBufferNameWithExtension') - endif - - let name = call(nameFunction, [a:command, a:originalBuffer, a:vcsType, a:statusText]) - - let b:VCSCommandCommand = a:command - let b:VCSCommandOriginalBuffer = a:originalBuffer - let b:VCSCommandSourceFile = bufname(a:originalBuffer) - let b:VCSCommandVCSType = a:vcsType - if a:statusText != '' - let b:VCSCommandStatusText = a:statusText - endif - - setlocal buftype=nofile - setlocal noswapfile - let &filetype = tolower(a:vcsType . a:command) - - if VCSCommandGetOption('VCSCommandDeleteOnHide', 0) - setlocal bufhidden=delete - endif - silent noautocmd file `=name` -endfunction - -" Function: s:SetupBuffer() {{{2 -" Attempts to set the b:VCSCommandBufferInfo variable - -function! s:SetupBuffer() - if (exists('b:VCSCommandBufferSetup') && b:VCSCommandBufferSetup) - " This buffer is already set up. - return - endif - - if !isdirectory(@%) && (strlen(&buftype) > 0 || !filereadable(@%)) - " No special status for special buffers other than directory buffers. - return - endif - - if !VCSCommandGetOption('VCSCommandEnableBufferSetup', 0) || s:isEditFileRunning > 0 - unlet! b:VCSCommandBufferSetup - return - endif - - try - let vcsType = VCSCommandGetVCSType(bufnr('%')) - let b:VCSCommandBufferInfo = s:plugins[vcsType][1].GetBufferInfo() - silent do VCSCommand User VCSBufferSetup - catch /No suitable plugin/ - " This is not a VCS-controlled file. - let b:VCSCommandBufferInfo = [] - endtry - - let b:VCSCommandBufferSetup = 1 -endfunction - -" Function: s:MarkOrigBufferForSetup(buffer) {{{2 -" Resets the buffer setup state of the original buffer for a given VCS scratch -" buffer. -" Returns: The VCS buffer number in a passthrough mode. - -function! s:MarkOrigBufferForSetup(buffer) - checktime - if a:buffer > 0 - let origBuffer = VCSCommandGetOriginalBuffer(a:buffer) - " This should never not work, but I'm paranoid - if origBuffer != a:buffer - call setbufvar(origBuffer, 'VCSCommandBufferSetup', 0) - endif - endif - return a:buffer -endfunction - -" Function: s:OverrideOption(option, [value]) {{{2 -" Provides a temporary override for the given VCS option. If no value is -" passed, the override is disabled. - -function! s:OverrideOption(option, ...) - if a:0 == 0 - call remove(s:optionOverrides[a:option], -1) - else - if !has_key(s:optionOverrides, a:option) - let s:optionOverrides[a:option] = [] - endif - call add(s:optionOverrides[a:option], a:1) - endif -endfunction - -" Function: s:WipeoutCommandBuffers() {{{2 -" Clears all current VCS output buffers of the specified type for a given source. - -function! s:WipeoutCommandBuffers(originalBuffer, VCSCommand) - let buffer = 1 - while buffer <= bufnr('$') - if getbufvar(buffer, 'VCSCommandOriginalBuffer') == a:originalBuffer - if getbufvar(buffer, 'VCSCommandCommand') == a:VCSCommand - execute 'bw' buffer - endif - endif - let buffer = buffer + 1 - endwhile -endfunction - -" Function: s:VimDiffRestore(vimDiffBuff) {{{2 -" Checks whether the given buffer is one whose deletion should trigger -" restoration of an original buffer after it was diffed. If so, it executes -" the appropriate setting command stored with that original buffer. - -function! s:VimDiffRestore(vimDiffBuff) - let s:isEditFileRunning += 1 - try - if exists('s:vimDiffSourceBuffer') - if a:vimDiffBuff == s:vimDiffSourceBuffer - " Original file is being removed. - unlet! s:vimDiffSourceBuffer - unlet! s:vimDiffRestoreCmd - unlet! s:vimDiffScratchList - else - let index = index(s:vimDiffScratchList, a:vimDiffBuff) - if index >= 0 - call remove(s:vimDiffScratchList, index) - if len(s:vimDiffScratchList) == 0 - if exists('s:vimDiffRestoreCmd') - " All scratch buffers are gone, reset the original. - " Only restore if the source buffer is still in Diff mode - - let sourceWinNR = bufwinnr(s:vimDiffSourceBuffer) - if sourceWinNR != -1 - " The buffer is visible in at least one window - let currentWinNR = winnr() - while winbufnr(sourceWinNR) != -1 - if winbufnr(sourceWinNR) == s:vimDiffSourceBuffer - execute sourceWinNR . 'wincmd w' - if getwinvar(0, '&diff') - execute s:vimDiffRestoreCmd - endif - endif - let sourceWinNR = sourceWinNR + 1 - endwhile - execute currentWinNR . 'wincmd w' - else - " The buffer is hidden. It must be visible in order to set the - " diff option. - let currentBufNR = bufnr('') - execute 'hide buffer' s:vimDiffSourceBuffer - if getwinvar(0, '&diff') - execute s:vimDiffRestoreCmd - endif - execute 'hide buffer' currentBufNR - endif - - unlet s:vimDiffRestoreCmd - endif - " All buffers are gone. - unlet s:vimDiffSourceBuffer - unlet s:vimDiffScratchList - endif - endif - endif - endif - finally - let s:isEditFileRunning -= 1 - endtry -endfunction - -" Section: Generic VCS command functions {{{1 - -" Function: s:VCSAnnotate(...) {{{2 -function! s:VCSAnnotate(bang, ...) - try - let line = line('.') - let currentBuffer = bufnr('%') - let originalBuffer = VCSCommandGetOriginalBuffer(currentBuffer) - - let annotateBuffer = s:ExecuteVCSCommand('Annotate', a:000) - if annotateBuffer == -1 - return -1 - endif - if a:bang == '!' && VCSCommandGetOption('VCSCommandDisableSplitAnnotate', 0) == 0 - let vcsType = VCSCommandGetVCSType(annotateBuffer) - let functionMap = s:plugins[vcsType][1] - let splitRegex = '' - if has_key(s:plugins[vcsType][1], 'AnnotateSplitRegex') - let splitRegex = s:plugins[vcsType][1]['AnnotateSplitRegex'] - endif - let splitRegex = VCSCommandGetOption('VCSCommand' . vcsType . 'AnnotateSplitRegex', splitRegex) - if splitRegex == '' - return annotateBuffer - endif - let originalFileType = getbufvar(originalBuffer, '&ft') - let annotateFileType = getbufvar(annotateBuffer, '&ft') - execute "normal 0zR\<c-v>G/" . splitRegex . "/e\<cr>d" - call setbufvar('%', '&filetype', getbufvar(originalBuffer, '&filetype')) - set scrollbind - leftabove vert new - normal 0P - execute "normal" . col('$') . "\<c-w>|" - call s:SetupScratchBuffer('annotate', vcsType, originalBuffer, 'header') - wincmd l - endif - - if currentBuffer == originalBuffer - " Starting from the original source buffer, so the - " current line is relevant. - if a:0 == 0 - " No argument list means that we're annotating - " the current version, so jumping to the same - " line is the expected action. - execute "normal" line . 'G' - if has('folding') - " The execution of the buffer created autocommand - " re-folds the buffer. Display the current line - " unfolded. - normal zv - endif - endif - endif - - return annotateBuffer - catch - call s:ReportError(v:exception) - return -1 - endtry -endfunction - -" Function: s:VCSCommit() {{{2 -function! s:VCSCommit(bang, message) - try - let vcsType = VCSCommandGetVCSType(bufnr('%')) - if !has_key(s:plugins, vcsType) - throw 'Unknown VCS type: ' . vcsType - endif - - let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) - - " Handle the commit message being specified. If a message is supplied, it - " is used; if bang is supplied, an empty message is used; otherwise, the - " user is provided a buffer from which to edit the commit message. - - if strlen(a:message) > 0 || a:bang == '!' - return s:VCSFinishCommit([a:message], originalBuffer) - endif - - call s:EditFile('commitlog', originalBuffer, '') - setlocal ft=vcscommit - - " Create a commit mapping. - - nnoremap <silent> <buffer> <Plug>VCSCommit :call <SID>VCSFinishCommitWithBuffer()<CR> - - silent 0put ='VCS: ----------------------------------------------------------------------' - silent put ='VCS: Please enter log message. Lines beginning with ''VCS:'' are removed automatically.' - silent put ='VCS: To finish the commit, Type <leader>cc (or your own <Plug>VCSCommit mapping)' - - if VCSCommandGetOption('VCSCommandCommitOnWrite', 1) == 1 - setlocal buftype=acwrite - au VCSCommandCommit BufWriteCmd <buffer> call s:VCSFinishCommitWithBuffer() - silent put ='VCS: or write this buffer' - endif - - silent put ='VCS: ----------------------------------------------------------------------' - $ - setlocal nomodified - catch - call s:ReportError(v:exception) - return -1 - endtry -endfunction - -" Function: s:VCSFinishCommitWithBuffer() {{{2 -" Wrapper for s:VCSFinishCommit which is called only from a commit log buffer -" which removes all lines starting with 'VCS:'. - -function! s:VCSFinishCommitWithBuffer() - setlocal nomodified - let currentBuffer = bufnr('%') - let logMessageList = getbufline('%', 1, '$') - call filter(logMessageList, 'v:val !~ ''^\s*VCS:''') - let resultBuffer = s:VCSFinishCommit(logMessageList, b:VCSCommandOriginalBuffer) - if resultBuffer >= 0 - execute 'bw' currentBuffer - endif - return resultBuffer -endfunction - -" Function: s:VCSFinishCommit(logMessageList, originalBuffer) {{{2 -function! s:VCSFinishCommit(logMessageList, originalBuffer) - let shellSlashBak = &shellslash - try - set shellslash - let messageFileName = tempname() - call writefile(a:logMessageList, messageFileName) - try - let resultBuffer = s:ExecuteVCSCommand('Commit', [messageFileName]) - if resultBuffer < 0 - return resultBuffer - endif - return s:MarkOrigBufferForSetup(resultBuffer) - finally - call delete(messageFileName) - endtry - finally - let &shellslash = shellSlashBak - endtry -endfunction - -" Function: s:VCSGotoOriginal(bang) {{{2 -function! s:VCSGotoOriginal(bang) - let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) - if originalBuffer > 0 - let origWinNR = bufwinnr(originalBuffer) - if origWinNR == -1 - execute 'buffer' originalBuffer - else - execute origWinNR . 'wincmd w' - endif - if a:bang == '!' - let buffnr = 1 - let buffmaxnr = bufnr('$') - while buffnr <= buffmaxnr - if getbufvar(buffnr, 'VCSCommandOriginalBuffer') == originalBuffer - execute 'bw' buffnr - endif - let buffnr = buffnr + 1 - endwhile - endif - endif -endfunction - -function! s:VCSDiff(...) "{{{2 - let resultBuffer = s:ExecuteVCSCommand('Diff', a:000) - if resultBuffer > 0 - let &filetype = 'diff' - elseif resultBuffer == 0 - echomsg 'No differences found' - endif - return resultBuffer -endfunction - -function! s:VCSReview(...) "{{{2 - let resultBuffer = s:ExecuteVCSCommand('Review', a:000) - if resultBuffer > 0 - let &filetype = getbufvar(b:VCSCommandOriginalBuffer, '&filetype') - endif - return resultBuffer -endfunction - -" Function: s:VCSVimDiff(...) {{{2 -function! s:VCSVimDiff(...) - try - let vcsType = VCSCommandGetVCSType(bufnr('%')) - if !has_key(s:plugins, vcsType) - throw 'Unknown VCS type: ' . vcsType - endif - let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) - let s:isEditFileRunning = s:isEditFileRunning + 1 - try - " If there's already a VimDiff'ed window, restore it. - " There may only be one VCSVimDiff original window at a time. - - if exists('s:vimDiffSourceBuffer') && s:vimDiffSourceBuffer != originalBuffer - " Clear the existing vimdiff setup by removing the result buffers. - call s:WipeoutCommandBuffers(s:vimDiffSourceBuffer, 'vimdiff') - endif - - let orientation = &diffopt =~ 'horizontal' ? 'horizontal' : 'vertical' - let orientation = VCSCommandGetOption('VCSCommandSplit', orientation) - let orientation = VCSCommandGetOption('VCSCommandDiffSplit', orientation) - - " Split and diff - if(a:0 == 2) - " Reset the vimdiff system, as 2 explicit versions were provided. - if exists('s:vimDiffSourceBuffer') - call s:WipeoutCommandBuffers(s:vimDiffSourceBuffer, 'vimdiff') - endif - let resultBuffer = s:VCSReview(a:1) - if resultBuffer < 0 - echomsg 'Can''t open revision ' . a:1 - return resultBuffer - endif - let b:VCSCommandCommand = 'vimdiff' - diffthis - let s:vimDiffScratchList = [resultBuffer] - " If no split method is defined, cheat, and set it to vertical. - try - call s:OverrideOption('VCSCommandSplit', orientation) - let resultBuffer = s:VCSReview(a:2) - finally - call s:OverrideOption('VCSCommandSplit') - endtry - if resultBuffer < 0 - echomsg 'Can''t open revision ' . a:1 - return resultBuffer - endif - let b:VCSCommandCommand = 'vimdiff' - diffthis - let s:vimDiffScratchList += [resultBuffer] - else - " Add new buffer - call s:OverrideOption('VCSCommandEdit', 'split') - try - " Force splitting behavior, otherwise why use vimdiff? - call s:OverrideOption('VCSCommandSplit', orientation) - try - if(a:0 == 0) - let resultBuffer = s:VCSReview() - else - let resultBuffer = s:VCSReview(a:1) - endif - finally - call s:OverrideOption('VCSCommandSplit') - endtry - finally - call s:OverrideOption('VCSCommandEdit') - endtry - if resultBuffer < 0 - echomsg 'Can''t open current revision' - return resultBuffer - endif - let b:VCSCommandCommand = 'vimdiff' - diffthis - - if !exists('s:vimDiffSourceBuffer') - " New instance of vimdiff. - let s:vimDiffScratchList = [resultBuffer] - - " This could have been invoked on a VCS result buffer, not the - " original buffer. - wincmd W - execute 'buffer' originalBuffer - " Store info for later original buffer restore - let s:vimDiffRestoreCmd = - \ 'call setbufvar('.originalBuffer.', ''&diff'', '.getbufvar(originalBuffer, '&diff').')' - \ . '|call setbufvar('.originalBuffer.', ''&foldcolumn'', '.getbufvar(originalBuffer, '&foldcolumn').')' - \ . '|call setbufvar('.originalBuffer.', ''&foldenable'', '.getbufvar(originalBuffer, '&foldenable').')' - \ . '|call setbufvar('.originalBuffer.', ''&foldmethod'', '''.getbufvar(originalBuffer, '&foldmethod').''')' - \ . '|call setbufvar('.originalBuffer.', ''&foldlevel'', '''.getbufvar(originalBuffer, '&foldlevel').''')' - \ . '|call setbufvar('.originalBuffer.', ''&scrollbind'', '.getbufvar(originalBuffer, '&scrollbind').')' - \ . '|call setbufvar('.originalBuffer.', ''&wrap'', '.getbufvar(originalBuffer, '&wrap').')' - \ . '|if &foldmethod==''manual''|execute ''normal zE''|endif' - diffthis - wincmd w - else - " Adding a window to an existing vimdiff - let s:vimDiffScratchList += [resultBuffer] - endif - endif - - let s:vimDiffSourceBuffer = originalBuffer - - " Avoid executing the modeline in the current buffer after the autocommand. - - let currentBuffer = bufnr('%') - let saveModeline = getbufvar(currentBuffer, '&modeline') - try - call setbufvar(currentBuffer, '&modeline', 0) - silent do VCSCommand User VCSVimDiffFinish - finally - call setbufvar(currentBuffer, '&modeline', saveModeline) - endtry - return resultBuffer - finally - let s:isEditFileRunning = s:isEditFileRunning - 1 - endtry - catch - call s:ReportError(v:exception) - return -1 - endtry -endfunction - -" Section: Public functions {{{1 - -" Function: VCSCommandGetVCSType() {{{2 -" Sets the b:VCSCommandVCSType variable in the given buffer to the -" appropriate source control system name. -" -" This uses the Identify extension function to test the buffer. If the -" Identify function returns VCSCOMMAND_IDENTIFY_EXACT, the match is considered -" exact. If the Identify function returns VCSCOMMAND_IDENTIFY_INEXACT, the -" match is considered inexact, and is only applied if no exact match is found. -" Multiple inexact matches is currently considered an error. - -function! VCSCommandGetVCSType(buffer) - let vcsType = getbufvar(a:buffer, 'VCSCommandVCSType') - if strlen(vcsType) > 0 - return vcsType - endif - if exists("g:VCSCommandVCSTypeOverride") - let fullpath = fnamemodify(bufname(a:buffer), ':p') - for [path, vcsType] in g:VCSCommandVCSTypeOverride - if match(fullpath, path) > -1 - call setbufvar(a:buffer, 'VCSCommandVCSType', vcsType) - return vcsType - endif - endfor - endif - let matches = [] - for vcsType in keys(s:plugins) - let identified = s:plugins[vcsType][1].Identify(a:buffer) - if identified - if identified == g:VCSCOMMAND_IDENTIFY_EXACT - let matches = [vcsType] - break - else - let matches += [vcsType] - endif - endif - endfor - if len(matches) == 1 - call setbufvar(a:buffer, 'VCSCommandVCSType', matches[0]) - return matches[0] - elseif len(matches) == 0 - throw 'No suitable plugin' - else - throw 'Too many matching VCS: ' . join(matches) - endif -endfunction - -" Function: VCSCommandChdir(directory) {{{2 -" Changes the current directory, respecting :lcd changes. - -function! VCSCommandChdir(directory) - let command = 'cd' - if exists("*haslocaldir") && haslocaldir() - let command = 'lcd' - endif - execute command escape(a:directory, ' ') -endfunction - -" Function: VCSCommandChangeToCurrentFileDir() {{{2 -" Go to the directory in which the given file is located. - -function! VCSCommandChangeToCurrentFileDir(fileName) - let oldCwd = getcwd() - let newCwd = fnamemodify(resolve(a:fileName), ':p:h') - if strlen(newCwd) > 0 - call VCSCommandChdir(newCwd) - endif - return oldCwd -endfunction - -" Function: VCSCommandGetOriginalBuffer(vcsBuffer) {{{2 -" Attempts to locate the original file to which VCS operations were applied -" for a given buffer. - -function! VCSCommandGetOriginalBuffer(vcsBuffer) - let origBuffer = getbufvar(a:vcsBuffer, 'VCSCommandOriginalBuffer') - if origBuffer - if bufexists(origBuffer) - return origBuffer - else - " Original buffer no longer exists. - throw 'Original buffer for this VCS buffer no longer exists.' - endif - else - " No original buffer - return a:vcsBuffer - endif -endfunction - -" Function: VCSCommandRegisterModule(name, file, commandMap) {{{2 -" Allows VCS modules to register themselves. - -function! VCSCommandRegisterModule(name, path, commandMap, mappingMap) - let s:plugins[a:name] = [a:path, a:commandMap, a:mappingMap] - if !empty(a:mappingMap) - \ && !VCSCommandGetOption('VCSCommandDisableMappings', 0) - \ && !VCSCommandGetOption('VCSCommandDisableExtensionMappings', 0) - for shortcut in keys(a:mappingMap) - let expansion = ":call <SID>ExecuteExtensionMapping('" . shortcut . "')<CR>" - call s:CreateMapping(shortcut, expansion, a:name . " extension mapping " . shortcut) - endfor - endif - return s:VCSCommandUtility -endfunction - -" Function: VCSCommandDoCommand(cmd, cmdName, statusText, [options]) {{{2 -" General skeleton for VCS function execution. The given command is executed -" after appending the current buffer name (or substituting it for -" <VCSCOMMANDFILE>, if such a token is present). The output is captured in a -" new buffer. -" -" The optional 'options' Dictionary may contain the following options: -" allowNonZeroExit: if non-zero, if the underlying VCS command has a -" non-zero exit status, the command is still considered -" successfuly. This defaults to zero. -" Returns: name of the new command buffer containing the command results - -function! VCSCommandDoCommand(cmd, cmdName, statusText, options) - let allowNonZeroExit = 0 - if has_key(a:options, 'allowNonZeroExit') - let allowNonZeroExit = a:options.allowNonZeroExit - endif - - let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) - if originalBuffer == -1 - throw 'Original buffer no longer exists, aborting.' - endif - - let path = resolve(bufname(originalBuffer)) - - " Work with netrw or other systems where a directory listing is displayed in - " a buffer. - - if isdirectory(path) - let fileName = '.' - else - let fileName = fnamemodify(path, ':t') - endif - - if match(a:cmd, '<VCSCOMMANDFILE>') > 0 - let fullCmd = substitute(a:cmd, '<VCSCOMMANDFILE>', fileName, 'g') - else - let fullCmd = a:cmd . ' -- "' . fileName . '"' - endif - - " Change to the directory of the current buffer. This is done for CVS, but - " is left in for other systems as it does not affect them negatively. - - let oldCwd = VCSCommandChangeToCurrentFileDir(path) - try - let output = s:VCSCommandUtility.system(fullCmd) - finally - call VCSCommandChdir(oldCwd) - endtry - - " HACK: if line endings in the repository have been corrupted, the output - " of the command will be confused. - let output = substitute(output, "\r", '', 'g') - - if v:shell_error && !allowNonZeroExit - if strlen(output) == 0 - throw 'Version control command failed' - else - let output = substitute(output, '\n', ' ', 'g') - throw 'Version control command failed: ' . output - endif - endif - - if strlen(output) == 0 - " Handle case of no output. In this case, it is important to check the - " file status, especially since cvs edit/unedit may change the attributes - " of the file with no visible output. - - checktime - return 0 - endif - - call s:EditFile(a:cmdName, originalBuffer, a:statusText) - - silent 0put=output - - " The last command left a blank line at the end of the buffer. If the - " last line is folded (a side effect of the 'put') then the attempt to - " remove the blank line will kill the last fold. - " - " This could be fixed by explicitly detecting whether the last line is - " within a fold, but I prefer to simply unfold the result buffer altogether. - - if has('folding') - normal zR - endif - - $d - 1 - - " Define the environment and execute user-defined hooks. - - silent do VCSCommand User VCSBufferCreated - return bufnr('%') -endfunction - -" Function: VCSCommandGetOption(name, default) {{{2 -" Grab a user-specified option to override the default provided. Options are -" searched in the window, buffer, then global spaces. - -function! VCSCommandGetOption(name, default) - if has_key(s:optionOverrides, a:name) && len(s:optionOverrides[a:name]) > 0 - return s:optionOverrides[a:name][-1] - elseif exists('w:' . a:name) - return w:{a:name} - elseif exists('b:' . a:name) - return b:{a:name} - elseif exists('g:' . a:name) - return g:{a:name} - else - return a:default - endif -endfunction - -" Function: VCSCommandDisableBufferSetup() {{{2 -" Global function for deactivating the buffer autovariables. - -function! VCSCommandDisableBufferSetup() - let g:VCSCommandEnableBufferSetup = 0 - silent! augroup! VCSCommandPlugin -endfunction - -" Function: VCSCommandEnableBufferSetup() {{{2 -" Global function for activating the buffer autovariables. - -function! VCSCommandEnableBufferSetup() - let g:VCSCommandEnableBufferSetup = 1 - augroup VCSCommandPlugin - au! - au BufEnter * call s:SetupBuffer() - augroup END - - " Only auto-load if the plugin is fully loaded. This gives other plugins a - " chance to run. - if g:loaded_VCSCommand == 2 - call s:SetupBuffer() - endif -endfunction - -" Function: VCSCommandGetStatusLine() {{{2 -" Default (sample) status line entry for VCS-controlled files. This is only -" useful if VCS-managed buffer mode is on (see the VCSCommandEnableBufferSetup -" variable for how to do this). - -function! VCSCommandGetStatusLine() - if exists('b:VCSCommandCommand') - " This is a result buffer. Return nothing because the buffer name - " contains information already. - return '' - endif - - if exists('b:VCSCommandVCSType') - \ && exists('g:VCSCommandEnableBufferSetup') - \ && g:VCSCommandEnableBufferSetup - \ && exists('b:VCSCommandBufferInfo') - return '[' . join(extend([b:VCSCommandVCSType], b:VCSCommandBufferInfo), ' ') . ']' - else - return '' - endif -endfunction - -" Section: Command definitions {{{1 -" Section: Primary commands {{{2 -com! -nargs=* VCSAdd call s:MarkOrigBufferForSetup(s:ExecuteVCSCommand('Add', [<f-args>])) -com! -nargs=* -bang VCSAnnotate call s:VCSAnnotate(<q-bang>, <f-args>) -com! -nargs=* -bang VCSBlame call s:VCSAnnotate(<q-bang>, <f-args>) -com! -nargs=? -bang VCSCommit call s:VCSCommit(<q-bang>, <q-args>) -com! -nargs=* VCSDelete call s:ExecuteVCSCommand('Delete', [<f-args>]) -com! -nargs=* VCSDiff call s:VCSDiff(<f-args>) -com! -nargs=0 -bang VCSGotoOriginal call s:VCSGotoOriginal(<q-bang>) -com! -nargs=* VCSInfo call s:ExecuteVCSCommand('Info', [<f-args>]) -com! -nargs=* VCSLock call s:MarkOrigBufferForSetup(s:ExecuteVCSCommand('Lock', [<f-args>])) -com! -nargs=* VCSLog call s:ExecuteVCSCommand('Log', [<f-args>]) -com! -nargs=* VCSRemove call s:ExecuteVCSCommand('Delete', [<f-args>]) -com! -nargs=0 VCSRevert call s:MarkOrigBufferForSetup(s:ExecuteVCSCommand('Revert', [])) -com! -nargs=? VCSReview call s:VCSReview(<f-args>) -com! -nargs=* VCSStatus call s:ExecuteVCSCommand('Status', [<f-args>]) -com! -nargs=* VCSUnlock call s:MarkOrigBufferForSetup(s:ExecuteVCSCommand('Unlock', [<f-args>])) -com! -nargs=0 VCSUpdate call s:MarkOrigBufferForSetup(s:ExecuteVCSCommand('Update', [])) -com! -nargs=* VCSVimDiff call s:VCSVimDiff(<f-args>) - -" Section: VCS buffer management commands {{{2 -com! VCSCommandDisableBufferSetup call VCSCommandDisableBufferSetup() -com! VCSCommandEnableBufferSetup call VCSCommandEnableBufferSetup() - -" Allow reloading VCSCommand.vim -com! VCSReload let savedPlugins = s:plugins|let s:plugins = {}|aunmenu Plugin.VCS|unlet! g:loaded_VCSCommand|runtime plugin/vcscommand.vim|for plugin in values(savedPlugins)|execute 'source' plugin[0]|endfor|unlet savedPlugins - -" Section: Plugin command mappings {{{1 -nnoremap <silent> <Plug>VCSAdd :VCSAdd<CR> -nnoremap <silent> <Plug>VCSAnnotate :VCSAnnotate<CR> -nnoremap <silent> <Plug>VCSCommit :VCSCommit<CR> -nnoremap <silent> <Plug>VCSDelete :VCSDelete<CR> -nnoremap <silent> <Plug>VCSDiff :VCSDiff<CR> -nnoremap <silent> <Plug>VCSGotoOriginal :VCSGotoOriginal<CR> -nnoremap <silent> <Plug>VCSClearAndGotoOriginal :VCSGotoOriginal!<CR> -nnoremap <silent> <Plug>VCSInfo :VCSInfo<CR> -nnoremap <silent> <Plug>VCSLock :VCSLock<CR> -nnoremap <silent> <Plug>VCSLog :VCSLog<CR> -nnoremap <silent> <Plug>VCSRevert :VCSRevert<CR> -nnoremap <silent> <Plug>VCSReview :VCSReview<CR> -nnoremap <silent> <Plug>VCSSplitAnnotate :VCSAnnotate!<CR> -nnoremap <silent> <Plug>VCSStatus :VCSStatus<CR> -nnoremap <silent> <Plug>VCSUnlock :VCSUnlock<CR> -nnoremap <silent> <Plug>VCSUpdate :VCSUpdate<CR> -nnoremap <silent> <Plug>VCSVimDiff :VCSVimDiff<CR> - -" Section: Default mappings {{{1 - -let s:defaultMappings = [ - \['a', 'VCSAdd'], - \['c', 'VCSCommit'], - \['D', 'VCSDelete'], - \['d', 'VCSDiff'], - \['G', 'VCSClearAndGotoOriginal'], - \['g', 'VCSGotoOriginal'], - \['i', 'VCSInfo'], - \['L', 'VCSLock'], - \['l', 'VCSLog'], - \['N', 'VCSSplitAnnotate'], - \['n', 'VCSAnnotate'], - \['q', 'VCSRevert'], - \['r', 'VCSReview'], - \['s', 'VCSStatus'], - \['U', 'VCSUnlock'], - \['u', 'VCSUpdate'], - \['v', 'VCSVimDiff'], - \] - -if !VCSCommandGetOption('VCSCommandDisableMappings', 0) - for [shortcut, vcsFunction] in VCSCommandGetOption('VCSCommandMappings', s:defaultMappings) - call s:CreateMapping(shortcut, '<Plug>' . vcsFunction, '''' . vcsFunction . '''') - endfor -endif - -" Section: Menu items {{{1 -amenu <silent> &Plugin.VCS.&Add <Plug>VCSAdd -amenu <silent> &Plugin.VCS.A&nnotate <Plug>VCSAnnotate -amenu <silent> &Plugin.VCS.&Commit <Plug>VCSCommit -amenu <silent> &Plugin.VCS.Delete <Plug>VCSDelete -amenu <silent> &Plugin.VCS.&Diff <Plug>VCSDiff -amenu <silent> &Plugin.VCS.&Info <Plug>VCSInfo -amenu <silent> &Plugin.VCS.&Log <Plug>VCSLog -amenu <silent> &Plugin.VCS.Revert <Plug>VCSRevert -amenu <silent> &Plugin.VCS.&Review <Plug>VCSReview -amenu <silent> &Plugin.VCS.&Status <Plug>VCSStatus -amenu <silent> &Plugin.VCS.&Update <Plug>VCSUpdate -amenu <silent> &Plugin.VCS.&VimDiff <Plug>VCSVimDiff - -" Section: Autocommands to restore vimdiff state {{{1 -augroup VimDiffRestore - au! - au BufUnload * call s:VimDiffRestore(str2nr(expand('<abuf>'))) -augroup END - -" Section: Optional activation of buffer management {{{1 - -if VCSCommandGetOption('VCSCommandEnableBufferSetup', 0) - call VCSCommandEnableBufferSetup() -endif - -" Section: VIM shutdown hook {{{1 - -" Close all result buffers when VIM exits, to prevent them from being restored -" via viminfo. - -" Function: s:CloseAllResultBuffers() {{{2 -" Closes all vcscommand result buffers. -function! s:CloseAllResultBuffers() - " This avoids using bufdo as that may load buffers already loaded in another - " vim process, resulting in an error. - let buffnr = 1 - let buffmaxnr = bufnr('$') - while buffnr <= buffmaxnr - if getbufvar(buffnr, 'VCSCommandOriginalBuffer') != "" - execute 'bw' buffnr - endif - let buffnr = buffnr + 1 - endwhile -endfunction - -augroup VCSCommandVIMShutdown - au! - au VimLeavePre * call s:CloseAllResultBuffers() -augroup END - -" Section: Plugin completion {{{1 - -let loaded_VCSCommand = 2 - -silent do VCSCommand User VCSPluginFinish - -let &cpo = s:save_cpo diff --git a/.vim/plugin/vcscvs.vim b/.vim/plugin/vcscvs.vim deleted file mode 100644 index 2766348..0000000 --- a/.vim/plugin/vcscvs.vim +++ /dev/null @@ -1,445 +0,0 @@ -" vim600: set foldmethod=marker: -" -" CVS extension for VCSCommand. -" -" Version: VCS development -" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> -" License: -" Copyright (c) 2007 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. -" -" Section: Documentation {{{1 -" -" Command documentation {{{2 -" -" The following commands only apply to files under CVS source control. -" -" CVSEdit Performs "cvs edit" on the current file. -" -" CVSEditors Performs "cvs editors" on the current file. -" -" CVSUnedit Performs "cvs unedit" on the current file. -" -" CVSWatch Takes an argument which must be one of [on|off|add|remove]. -" Performs "cvs watch" with the given argument on the current -" file. -" -" CVSWatchers Performs "cvs watchers" on the current file. -" -" CVSWatchAdd Alias for "CVSWatch add" -" -" CVSWatchOn Alias for "CVSWatch on" -" -" CVSWatchOff Alias for "CVSWatch off" -" -" CVSWatchRemove Alias for "CVSWatch remove" -" -" Mapping documentation: {{{2 -" -" By default, a mapping is defined for each command. User-provided mappings -" can be used instead by mapping to <Plug>CommandName, for instance: -" -" nnoremap ,ce <Plug>CVSEdit -" -" The default mappings are as follow: -" -" <Leader>ce CVSEdit -" <Leader>cE CVSEditors -" <Leader>ct CVSUnedit -" <Leader>cwv CVSWatchers -" <Leader>cwa CVSWatchAdd -" <Leader>cwn CVSWatchOn -" <Leader>cwf CVSWatchOff -" <Leader>cwr CVSWatchRemove -" -" Options documentation: {{{2 -" -" VCSCommandCVSExec -" This variable specifies the CVS executable. If not set, it defaults to -" 'cvs' executed from the user's executable path. -" -" VCSCommandCVSDiffOpt -" This variable, if set, determines the options passed to the cvs diff -" command. If not set, it defaults to 'u'. - -" Section: Plugin header {{{1 - -if exists('VCSCommandDisableAll') - finish -endif - -if v:version < 700 - echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None - finish -endif - -runtime plugin/vcscommand.vim - -if !executable(VCSCommandGetOption('VCSCommandCVSExec', 'cvs')) - " CVS is not installed - finish -endif - -let s:save_cpo=&cpo -set cpo&vim - -" Section: Variable initialization {{{1 - -let s:cvsFunctions = {} - -" Section: Utility functions {{{1 - -" Function: s:Executable() {{{2 -" Returns the executable used to invoke cvs suitable for use in a shell -" command. -function! s:Executable() - return shellescape(VCSCommandGetOption('VCSCommandCVSExec', 'cvs')) -endfunction - -" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 -" Wrapper to VCSCommandDoCommand to add the name of the CVS executable to the -" command argument. -function! s:DoCommand(cmd, cmdName, statusText, options) - if VCSCommandGetVCSType(expand('%')) == 'CVS' - let fullCmd = s:Executable() . ' ' . a:cmd - let ret = VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options) - - if ret > 0 - if getline(line('$')) =~ '^cvs \w\+: closing down connection' - $d - 1 - endif - - endif - - return ret - else - throw 'CVS VCSCommand plugin called on non-CVS item.' - endif -endfunction - -" Function: s:GetRevision() {{{2 -" Function for retrieving the current buffer's revision number. -" Returns: Revision number or an empty string if an error occurs. - -function! s:GetRevision() - if !exists('b:VCSCommandBufferInfo') - let b:VCSCommandBufferInfo = s:cvsFunctions.GetBufferInfo() - endif - - if len(b:VCSCommandBufferInfo) > 0 - return b:VCSCommandBufferInfo[0] - else - return '' - endif -endfunction - -" Section: VCS function implementations {{{1 - -" Function: s:cvsFunctions.Identify(buffer) {{{2 -function! s:cvsFunctions.Identify(buffer) - let fileName = resolve(bufname(a:buffer)) - if isdirectory(fileName) - let directoryName = fileName - else - let directoryName = fnamemodify(fileName, ':h') - endif - if strlen(directoryName) > 0 - let CVSRoot = directoryName . '/CVS/Root' - else - let CVSRoot = 'CVS/Root' - endif - if filereadable(CVSRoot) - return 1 - else - return 0 - endif -endfunction - -" Function: s:cvsFunctions.Add(argList) {{{2 -function! s:cvsFunctions.Add(argList) - return s:DoCommand(join(['add'] + a:argList, ' '), 'add', join(a:argList, ' '), {}) -endfunction - -" Function: s:cvsFunctions.Annotate(argList) {{{2 -function! s:cvsFunctions.Annotate(argList) - if len(a:argList) == 0 - if &filetype == 'CVSannotate' - " This is a CVSAnnotate buffer. Perform annotation of the version - " indicated by the current line. - let caption = matchstr(getline('.'),'\v^[0-9.]+') - - if VCSCommandGetOption('VCSCommandCVSAnnotateParent', 0) != 0 - if caption != '1.1' - let revmaj = matchstr(caption,'\v[0-9.]+\ze\.[0-9]+') - let revmin = matchstr(caption,'\v[0-9.]+\.\zs[0-9]+') - 1 - if revmin == 0 - " Jump to ancestor branch - let caption = matchstr(revmaj,'\v[0-9.]+\ze\.[0-9]+') - else - let caption = revmaj . "." . revmin - endif - endif - endif - - let options = ['-r' . caption] - else - " CVS defaults to pulling HEAD, regardless of current branch. - " Therefore, always pass desired revision. - let caption = '' - let options = ['-r' . s:GetRevision()] - endif - elseif len(a:argList) == 1 && a:argList[0] !~ '^-' - let caption = a:argList[0] - let options = ['-r' . caption] - else - let caption = join(a:argList) - let options = a:argList - endif - - let resultBuffer = s:DoCommand(join(['-q', 'annotate'] + options), 'annotate', caption, {}) - if resultBuffer > 0 - " Remove header lines from standard error - silent v/^\d\+\%(\.\d\+\)\+/d - endif - return resultBuffer -endfunction - -" Function: s:cvsFunctions.Commit(argList) {{{2 -function! s:cvsFunctions.Commit(argList) - let resultBuffer = s:DoCommand('commit -F "' . a:argList[0] . '"', 'commit', '', {}) - if resultBuffer == 0 - echomsg 'No commit needed.' - endif - return resultBuffer -endfunction - -" Function: s:cvsFunctions.Delete() {{{2 -" By default, use the -f option to remove the file first. If options are -" passed in, use those instead. -function! s:cvsFunctions.Delete(argList) - let options = ['-f'] - let caption = '' - if len(a:argList) > 0 - let options = a:argList - let caption = join(a:argList, ' ') - endif - return s:DoCommand(join(['remove'] + options, ' '), 'delete', caption, {}) -endfunction - -" Function: s:cvsFunctions.Diff(argList) {{{2 -function! s:cvsFunctions.Diff(argList) - if len(a:argList) == 0 - let revOptions = [] - let caption = '' - elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 - let revOptions = ['-r' . join(a:argList, ' -r')] - let caption = '(' . a:argList[0] . ' : ' . get(a:argList, 1, 'current') . ')' - else - " Pass-through - let caption = join(a:argList, ' ') - let revOptions = a:argList - endif - - let cvsDiffOpt = VCSCommandGetOption('VCSCommandCVSDiffOpt', 'u') - if cvsDiffOpt == '' - let diffOptions = [] - else - let diffOptions = ['-' . cvsDiffOpt] - endif - - return s:DoCommand(join(['diff'] + diffOptions + revOptions), 'diff', caption, {'allowNonZeroExit': 1}) -endfunction - -" Function: s:cvsFunctions.GetBufferInfo() {{{2 -" Provides version control details for the current file. Current version -" number and current repository version number are required to be returned by -" the vcscommand plugin. This CVS extension adds branch name to the return -" list as well. -" Returns: List of results: [revision, repository, branch] - -function! s:cvsFunctions.GetBufferInfo() - let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) - let fileName = bufname(originalBuffer) - if isdirectory(fileName) - let tag = '' - if filereadable(fileName . '/CVS/Tag') - let tagFile = readfile(fileName . '/CVS/Tag') - if len(tagFile) == 1 - let tag = substitute(tagFile[0], '^T', '', '') - endif - endif - return [tag] - endif - let realFileName = fnamemodify(resolve(fileName), ':t') - if !filereadable(fileName) - return ['Unknown'] - endif - let oldCwd = VCSCommandChangeToCurrentFileDir(fileName) - try - let statusText=s:VCSCommandUtility.system(s:Executable() . ' status -- "' . realFileName . '"') - if(v:shell_error) - return [] - endif - let revision=substitute(statusText, '^\_.*Working revision:\s*\(\d\+\%(\.\d\+\)\+\|New file!\)\_.*$', '\1', '') - - " We can still be in a CVS-controlled directory without this being a CVS - " file - if match(revision, '^New file!$') >= 0 - let revision='New' - elseif match(revision, '^\d\+\.\d\+\%(\.\d\+\.\d\+\)*$') <0 - return ['Unknown'] - endif - - let branch=substitute(statusText, '^\_.*Sticky Tag:\s\+\(\d\+\%(\.\d\+\)\+\|\a[A-Za-z0-9-_]*\|(none)\).*$', '\1', '') - let repository=substitute(statusText, '^\_.*Repository revision:\s*\(\d\+\%(\.\d\+\)\+\|New file!\|No revision control file\)\_.*$', '\1', '') - let repository=substitute(repository, '^New file!\|No revision control file$', 'New', '') - return [revision, repository, branch] - finally - call VCSCommandChdir(oldCwd) - endtry -endfunction - -" Function: s:cvsFunctions.Log() {{{2 -function! s:cvsFunctions.Log(argList) - if len(a:argList) == 0 - let options = [] - let caption = '' - elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 - let options = ['-r' . join(a:argList, ':')] - let caption = options[0] - else - " Pass-through - let options = a:argList - let caption = join(a:argList, ' ') - endif - - return s:DoCommand(join(['log'] + options), 'log', caption, {}) -endfunction - -" Function: s:cvsFunctions.Revert(argList) {{{2 -function! s:cvsFunctions.Revert(argList) - return s:DoCommand('update -C', 'revert', '', {}) -endfunction - -" Function: s:cvsFunctions.Review(argList) {{{2 -function! s:cvsFunctions.Review(argList) - if len(a:argList) == 0 - let versiontag = '(current)' - let versionOption = '' - else - let versiontag = a:argList[0] - let versionOption = ' -r ' . versiontag . ' ' - endif - - return s:DoCommand('-q update -p' . versionOption, 'review', versiontag, {}) -endfunction - -" Function: s:cvsFunctions.Status(argList) {{{2 -function! s:cvsFunctions.Status(argList) - return s:DoCommand(join(['status'] + a:argList, ' '), 'status', join(a:argList, ' '), {}) -endfunction - -" Function: s:cvsFunctions.Update(argList) {{{2 -function! s:cvsFunctions.Update(argList) - return s:DoCommand('update', 'update', '', {}) -endfunction - -" Section: CVS-specific functions {{{1 - -" Function: s:CVSEdit() {{{2 -function! s:CVSEdit() - return s:DoCommand('edit', 'cvsedit', '', {}) -endfunction - -" Function: s:CVSEditors() {{{2 -function! s:CVSEditors() - return s:DoCommand('editors', 'cvseditors', '', {}) -endfunction - -" Function: s:CVSUnedit() {{{2 -function! s:CVSUnedit() - return s:DoCommand('unedit', 'cvsunedit', '', {}) -endfunction - -" Function: s:CVSWatch(onoff) {{{2 -function! s:CVSWatch(onoff) - if a:onoff !~ '^\c\%(on\|off\|add\|remove\)$' - echoerr 'Argument to CVSWatch must be one of [on|off|add|remove]' - return -1 - end - return s:DoCommand('watch ' . tolower(a:onoff), 'cvswatch', '', {}) -endfunction - -" Function: s:CVSWatchers() {{{2 -function! s:CVSWatchers() - return s:DoCommand('watchers', 'cvswatchers', '', {}) -endfunction - -" Annotate setting {{{2 -let s:cvsFunctions.AnnotateSplitRegex = '): ' - -" Section: Command definitions {{{1 -" Section: Primary commands {{{2 -com! CVSEdit call s:CVSEdit() -com! CVSEditors call s:CVSEditors() -com! CVSUnedit call s:CVSUnedit() -com! -nargs=1 CVSWatch call s:CVSWatch(<f-args>) -com! CVSWatchAdd call s:CVSWatch('add') -com! CVSWatchOn call s:CVSWatch('on') -com! CVSWatchOff call s:CVSWatch('off') -com! CVSWatchRemove call s:CVSWatch('remove') -com! CVSWatchers call s:CVSWatchers() - -" Section: Plugin command mappings {{{1 - -let s:cvsExtensionMappings = {} -let mappingInfo = [ - \['CVSEdit', 'CVSEdit', 'e'], - \['CVSEditors', 'CVSEditors', 'E'], - \['CVSUnedit', 'CVSUnedit', 't'], - \['CVSWatchers', 'CVSWatchers', 'wv'], - \['CVSWatchAdd', 'CVSWatch add', 'wa'], - \['CVSWatchOff', 'CVSWatch off', 'wf'], - \['CVSWatchOn', 'CVSWatch on', 'wn'], - \['CVSWatchRemove', 'CVSWatch remove', 'wr'] - \] - -for [pluginName, commandText, shortCut] in mappingInfo - execute 'nnoremap <silent> <Plug>' . pluginName . ' :' . commandText . '<CR>' - if !hasmapto('<Plug>' . pluginName) - let s:cvsExtensionMappings[shortCut] = commandText - endif -endfor - -" Section: Menu items {{{1 -amenu <silent> &Plugin.VCS.CVS.&Edit <Plug>CVSEdit -amenu <silent> &Plugin.VCS.CVS.Ed&itors <Plug>CVSEditors -amenu <silent> &Plugin.VCS.CVS.Unedi&t <Plug>CVSUnedit -amenu <silent> &Plugin.VCS.CVS.&Watchers <Plug>CVSWatchers -amenu <silent> &Plugin.VCS.CVS.WatchAdd <Plug>CVSWatchAdd -amenu <silent> &Plugin.VCS.CVS.WatchOn <Plug>CVSWatchOn -amenu <silent> &Plugin.VCS.CVS.WatchOff <Plug>CVSWatchOff -amenu <silent> &Plugin.VCS.CVS.WatchRemove <Plug>CVSWatchRemove - -" Section: Plugin Registration {{{1 -let s:VCSCommandUtility = VCSCommandRegisterModule('CVS', expand('<sfile>'), s:cvsFunctions, s:cvsExtensionMappings) - -let &cpo = s:save_cpo diff --git a/.vim/plugin/vcsgit.vim b/.vim/plugin/vcsgit.vim deleted file mode 100644 index 8ecbcf2..0000000 --- a/.vim/plugin/vcsgit.vim +++ /dev/null @@ -1,248 +0,0 @@ -" vim600: set foldmethod=marker: -" -" git extension for VCSCommand. -" -" Version: VCS development -" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> -" License: -" Copyright (c) 2008 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. -" -" Section: Documentation {{{1 -" -" Options documentation: {{{2 -" -" VCSCommandGitExec -" This variable specifies the git executable. If not set, it defaults to -" 'git' executed from the user's executable path. -" -" VCSCommandGitDiffOpt -" This variable, if set, determines the default options passed to the -" VCSDiff command. If any options (starting with '-') are passed to the -" command, this variable is not used. - -" Section: Plugin header {{{1 - -if exists('VCSCommandDisableAll') - finish -endif - -if v:version < 700 - echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None - finish -endif - -runtime plugin/vcscommand.vim - -if !executable(VCSCommandGetOption('VCSCommandGitExec', 'git')) - " git is not installed - finish -endif - -let s:save_cpo=&cpo -set cpo&vim - -" Section: Variable initialization {{{1 - -let s:gitFunctions = {} - -" Section: Utility functions {{{1 - -" Function: s:Executable() {{{2 -" Returns the executable used to invoke git suitable for use in a shell -" command. -function! s:Executable() - return shellescape(VCSCommandGetOption('VCSCommandGitExec', 'git')) -endfunction - -" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 -" Wrapper to VCSCommandDoCommand to add the name of the git executable to the -" command argument. -function! s:DoCommand(cmd, cmdName, statusText, options) - if VCSCommandGetVCSType(expand('%')) == 'git' - let fullCmd = s:Executable() . ' ' . a:cmd - return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options) - else - throw 'git VCSCommand plugin called on non-git item.' - endif -endfunction - -" Section: VCS function implementations {{{1 - -" Function: s:gitFunctions.Identify(buffer) {{{2 -" This function only returns an inexact match due to the detection method used -" by git, which simply traverses the directory structure upward. -function! s:gitFunctions.Identify(buffer) - let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname(a:buffer))) - try - call s:VCSCommandUtility.system(s:Executable() . ' rev-parse --is-inside-work-tree') - if(v:shell_error) - return 0 - else - return g:VCSCOMMAND_IDENTIFY_INEXACT - endif - finally - call VCSCommandChdir(oldCwd) - endtry -endfunction - -" Function: s:gitFunctions.Add(argList) {{{2 -function! s:gitFunctions.Add(argList) - return s:DoCommand(join(['add'] + ['-v'] + a:argList, ' '), 'add', join(a:argList, ' '), {}) -endfunction - -" Function: s:gitFunctions.Annotate(argList) {{{2 -function! s:gitFunctions.Annotate(argList) - if len(a:argList) == 0 - if &filetype == 'gitannotate' - " Perform annotation of the version indicated by the current line. - let options = matchstr(getline('.'),'^\x\+') - else - let options = '' - endif - elseif len(a:argList) == 1 && a:argList[0] !~ '^-' - let options = a:argList[0] - else - let options = join(a:argList, ' ') - endif - - return s:DoCommand('blame ' . options, 'annotate', options, {}) -endfunction - -" Function: s:gitFunctions.Commit(argList) {{{2 -function! s:gitFunctions.Commit(argList) - let resultBuffer = s:DoCommand('commit -F "' . a:argList[0] . '"', 'commit', '', {}) - if resultBuffer == 0 - echomsg 'No commit needed.' - endif - return resultBuffer -endfunction - -" Function: s:gitFunctions.Delete() {{{2 -" All options are passed through. -function! s:gitFunctions.Delete(argList) - let options = a:argList - let caption = join(a:argList, ' ') - return s:DoCommand(join(['rm'] + options, ' '), 'delete', caption, {}) -endfunction - -" Function: s:gitFunctions.Diff(argList) {{{2 -" Pass-through call to git-diff. If no options (starting with '-') are found, -" then the options in the 'VCSCommandGitDiffOpt' variable are added. -function! s:gitFunctions.Diff(argList) - let gitDiffOpt = VCSCommandGetOption('VCSCommandGitDiffOpt', '') - if gitDiffOpt == '' - let diffOptions = [] - else - let diffOptions = [gitDiffOpt] - for arg in a:argList - if arg =~ '^-' - let diffOptions = [] - break - endif - endfor - endif - - return s:DoCommand(join(['diff'] + diffOptions + a:argList), 'diff', join(a:argList), {}) -endfunction - -" Function: s:gitFunctions.GetBufferInfo() {{{2 -" Provides version control details for the current file. Current version -" number and current repository version number are required to be returned by -" the vcscommand plugin. This CVS extension adds branch name to the return -" list as well. -" Returns: List of results: [revision, repository, branch] - -function! s:gitFunctions.GetBufferInfo() - let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname('%'))) - try - let branch = substitute(s:VCSCommandUtility.system(s:Executable() . ' symbolic-ref -q HEAD'), '\n$', '', '') - if v:shell_error - let branch = 'DETACHED' - else - let branch = substitute(branch, '^refs/heads/', '', '') - endif - - let info = [branch] - - for method in split(VCSCommandGetOption('VCSCommandGitDescribeArgList', (',tags,all,always')), ',', 1) - if method != '' - let method = ' --' . method - endif - let tag = substitute(s:VCSCommandUtility.system(s:Executable() . ' describe' . method), '\n$', '', '') - if !v:shell_error - call add(info, tag) - break - endif - endfor - - return info - finally - call VCSCommandChdir(oldCwd) - endtry -endfunction - -" Function: s:gitFunctions.Log() {{{2 -function! s:gitFunctions.Log(argList) - return s:DoCommand(join(['log'] + a:argList), 'log', join(a:argList, ' '), {}) -endfunction - -" Function: s:gitFunctions.Revert(argList) {{{2 -function! s:gitFunctions.Revert(argList) - return s:DoCommand('checkout', 'revert', '', {}) -endfunction - -" Function: s:gitFunctions.Review(argList) {{{2 -function! s:gitFunctions.Review(argList) - if len(a:argList) == 0 - let revision = 'HEAD' - else - let revision = a:argList[0] - endif - - let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname(VCSCommandGetOriginalBuffer('%')))) - try - let prefix = s:VCSCommandUtility.system(s:Executable() . ' rev-parse --show-prefix') - finally - call VCSCommandChdir(oldCwd) - endtry - - let prefix = substitute(prefix, '\n$', '', '') - let blob = '"' . revision . ':' . prefix . '<VCSCOMMANDFILE>"' - return s:DoCommand('show ' . blob, 'review', revision, {}) -endfunction - -" Function: s:gitFunctions.Status(argList) {{{2 -function! s:gitFunctions.Status(argList) - return s:DoCommand(join(['status'] + a:argList), 'status', join(a:argList), {'allowNonZeroExit': 1}) -endfunction - -" Function: s:gitFunctions.Update(argList) {{{2 -function! s:gitFunctions.Update(argList) - throw "This command is not implemented for git because file-by-file update doesn't make much sense in that context. If you have an idea for what it should do, please let me know." -endfunction - -" Annotate setting {{{2 -let s:gitFunctions.AnnotateSplitRegex = ') ' - -" Section: Plugin Registration {{{1 -let s:VCSCommandUtility = VCSCommandRegisterModule('git', expand('<sfile>'), s:gitFunctions, []) - -let &cpo = s:save_cpo diff --git a/.vim/plugin/vcshg.vim b/.vim/plugin/vcshg.vim deleted file mode 100755 index a520172..0000000 --- a/.vim/plugin/vcshg.vim +++ /dev/null @@ -1,273 +0,0 @@ -" vim600: set foldmethod=marker: -" -" Mercurial extension for VCSCommand. -" -" Version: VCS development -" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> -" License: -" Copyright (c) 2009 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. -" -" Section: Documentation {{{1 -" -" Options documentation: {{{2 -" -" VCSCommandHGExec -" This variable specifies the mercurial executable. If not set, it defaults -" to 'hg' executed from the user's executable path. -" -" VCSCommandHGDiffExt -" This variable, if set, sets the external diff program used by Subversion. -" -" VCSCommandHGDiffOpt -" This variable, if set, determines the options passed to the hg diff -" command (such as 'u', 'w', or 'b'). - -" Section: Plugin header {{{1 - -if exists('VCSCommandDisableAll') - finish -endif - -if v:version < 700 - echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None - finish -endif - -runtime plugin/vcscommand.vim - -if !executable(VCSCommandGetOption('VCSCommandHGExec', 'hg')) - " HG is not installed - finish -endif - -let s:save_cpo=&cpo -set cpo&vim - -" Section: Variable initialization {{{1 - -let s:hgFunctions = {} - -" Section: Utility functions {{{1 - -" Function: s:Executable() {{{2 -" Returns the executable used to invoke hg suitable for use in a shell -" command. -function! s:Executable() - return shellescape(VCSCommandGetOption('VCSCommandHGExec', 'hg')) -endfunction - -" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 -" Wrapper to VCSCommandDoCommand to add the name of the HG executable to the -" command argument. -function! s:DoCommand(cmd, cmdName, statusText, options) - if VCSCommandGetVCSType(expand('%')) == 'HG' - let fullCmd = s:Executable() . ' ' . a:cmd - return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options) - else - throw 'HG VCSCommand plugin called on non-HG item.' - endif -endfunction - -" Section: VCS function implementations {{{1 - -" Function: s:hgFunctions.Identify(buffer) {{{2 -function! s:hgFunctions.Identify(buffer) - let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname(a:buffer))) - try - call s:VCSCommandUtility.system(s:Executable() . ' root') - if(v:shell_error) - return 0 - else - return g:VCSCOMMAND_IDENTIFY_INEXACT - endif - finally - call VCSCommandChdir(oldCwd) - endtry -endfunction - -" Function: s:hgFunctions.Add() {{{2 -function! s:hgFunctions.Add(argList) - return s:DoCommand(join(['add'] + a:argList, ' '), 'add', join(a:argList, ' '), {}) -endfunction - -" Function: s:hgFunctions.Annotate(argList) {{{2 -function! s:hgFunctions.Annotate(argList) - if len(a:argList) == 0 - if &filetype == 'HGannotate' - " Perform annotation of the version indicated by the current line. - let caption = matchstr(getline('.'),'\v^\s+\zs\d+') - let options = ' -r' . caption - else - let caption = '' - let options = ' -un' - endif - elseif len(a:argList) == 1 && a:argList[0] !~ '^-' - let caption = a:argList[0] - let options = ' -un -r' . caption - else - let caption = join(a:argList, ' ') - let options = ' ' . caption - endif - - return s:DoCommand('blame' . options, 'annotate', caption, {}) -endfunction - -" Function: s:hgFunctions.Commit(argList) {{{2 -function! s:hgFunctions.Commit(argList) - let resultBuffer = s:DoCommand('commit -l "' . a:argList[0] . '"', 'commit', '', {}) - if resultBuffer == 0 - echomsg 'No commit needed.' - endif -endfunction - -" Function: s:hgFunctions.Delete() {{{2 -function! s:hgFunctions.Delete(argList) - return s:DoCommand(join(['remove'] + a:argList, ' '), 'remove', join(a:argList, ' '), {}) -endfunction - -" Function: s:hgFunctions.Diff(argList) {{{2 -function! s:hgFunctions.Diff(argList) - if len(a:argList) == 0 - let revOptions = [] - let caption = '' - elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 - let revOptions = ['-r' . join(a:argList, ':')] - let caption = '(' . a:argList[0] . ' : ' . get(a:argList, 1, 'current') . ')' - else - " Pass-through - let caption = join(a:argList, ' ') - let revOptions = a:argList - endif - - let hgDiffExt = VCSCommandGetOption('VCSCommandHGDiffExt', '') - if hgDiffExt == '' - let diffExt = [] - else - let diffExt = ['--diff-cmd ' . hgDiffExt] - endif - - let hgDiffOpt = VCSCommandGetOption('VCSCommandHGDiffOpt', '') - if hgDiffOpt == '' - let diffOptions = [] - else - let diffOptions = ['-x -' . hgDiffOpt] - endif - - return s:DoCommand(join(['diff'] + diffExt + diffOptions + revOptions), 'diff', caption, {}) -endfunction - -" Function: s:hgFunctions.Info(argList) {{{2 -function! s:hgFunctions.Info(argList) - return s:DoCommand(join(['log --limit 1'] + a:argList, ' '), 'log', join(a:argList, ' '), {}) -endfunction - -" Function: s:hgFunctions.GetBufferInfo() {{{2 -" Provides version control details for the current file. Current version -" number and current repository version number are required to be returned by -" the vcscommand plugin. -" Returns: List of results: [revision, repository, branch] - -function! s:hgFunctions.GetBufferInfo() - let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) - let fileName = bufname(originalBuffer) - let statusText = s:VCSCommandUtility.system(s:Executable() . ' status -- "' . fileName . '"') - if(v:shell_error) - return [] - endif - - " File not under HG control. - if statusText =~ '^?' - return ['Unknown'] - endif - - let parentsText = s:VCSCommandUtility.system(s:Executable() . ' parents -- "' . fileName . '"') - let revision = matchlist(parentsText, '^changeset:\s\+\(\S\+\)\n')[1] - - let logText = s:VCSCommandUtility.system(s:Executable() . ' log -- "' . fileName . '"') - let repository = matchlist(logText, '^changeset:\s\+\(\S\+\)\n')[1] - - if revision == '' - " Error - return ['Unknown'] - elseif statusText =~ '^A' - return ['New', 'New'] - else - return [revision, repository] - endif -endfunction - -" Function: s:hgFunctions.Log(argList) {{{2 -function! s:hgFunctions.Log(argList) - if len(a:argList) == 0 - let options = [] - let caption = '' - elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 - let options = ['-r' . join(a:argList, ':')] - let caption = options[0] - else - " Pass-through - let options = a:argList - let caption = join(a:argList, ' ') - endif - - let resultBuffer = s:DoCommand(join(['log', '-v'] + options), 'log', caption, {}) - return resultBuffer -endfunction - -" Function: s:hgFunctions.Revert(argList) {{{2 -function! s:hgFunctions.Revert(argList) - return s:DoCommand('revert', 'revert', '', {}) -endfunction - -" Function: s:hgFunctions.Review(argList) {{{2 -function! s:hgFunctions.Review(argList) - if len(a:argList) == 0 - let versiontag = '(current)' - let versionOption = '' - else - let versiontag = a:argList[0] - let versionOption = ' -r ' . versiontag . ' ' - endif - - return s:DoCommand('cat' . versionOption, 'review', versiontag, {}) -endfunction - -" Function: s:hgFunctions.Status(argList) {{{2 -function! s:hgFunctions.Status(argList) - let options = ['-u', '-v'] - if len(a:argList) == 0 - let options = a:argList - endif - return s:DoCommand(join(['status'] + options, ' '), 'status', join(options, ' '), {}) -endfunction - -" Function: s:hgFunctions.Update(argList) {{{2 -function! s:hgFunctions.Update(argList) - return s:DoCommand('update', 'update', '', {}) -endfunction - -" Annotate setting {{{2 -let s:hgFunctions.AnnotateSplitRegex = '\d\+: ' - -" Section: Plugin Registration {{{1 -let s:VCSCommandUtility = VCSCommandRegisterModule('HG', expand('<sfile>'), s:hgFunctions, []) - -let &cpo = s:save_cpo diff --git a/.vim/plugin/vcssvk.vim b/.vim/plugin/vcssvk.vim deleted file mode 100644 index 15e1c1e..0000000 --- a/.vim/plugin/vcssvk.vim +++ /dev/null @@ -1,258 +0,0 @@ -" vim600: set foldmethod=marker: -" -" SVK extension for VCSCommand. -" -" Version: VCS development -" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> -" License: -" Copyright (c) 2007 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. -" -" Section: Documentation {{{1 -" -" Options documentation: {{{2 -" -" VCSCommandSVKExec -" This variable specifies the SVK executable. If not set, it defaults to -" 'svk' executed from the user's executable path. - -" Section: Plugin header {{{1 - -if exists('VCSCommandDisableAll') - finish -endif - -if v:version < 700 - echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None - finish -endif - -runtime plugin/vcscommand.vim - -if !executable(VCSCommandGetOption('VCSCommandSVKExec', 'svk')) - " SVK is not installed - finish -endif - -let s:save_cpo=&cpo -set cpo&vim - -" Section: Variable initialization {{{1 - -let s:svkFunctions = {} - -" Section: Utility functions {{{1 - -" Function: s:Executable() {{{2 -" Returns the executable used to invoke SVK suitable for use in a shell -" command. -function! s:Executable() - return shellescape(VCSCommandGetOption('VCSCommandSVKExec', 'svk')) -endfunction - -" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 -" Wrapper to VCSCommandDoCommand to add the name of the SVK executable to the -" command argument. -function! s:DoCommand(cmd, cmdName, statusText, options) - if VCSCommandGetVCSType(expand('%')) == 'SVK' - let fullCmd = s:Executable() . ' ' . a:cmd - return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options) - else - throw 'SVK VCSCommand plugin called on non-SVK item.' - endif -endfunction - -" Section: VCS function implementations {{{1 - -" Function: s:svkFunctions.Identify(buffer) {{{2 -function! s:svkFunctions.Identify(buffer) - let fileName = resolve(bufname(a:buffer)) - if isdirectory(fileName) - let directoryName = fileName - else - let directoryName = fnamemodify(fileName, ':p:h') - endif - let statusText = s:VCSCommandUtility.system(s:Executable() . ' info -- "' . directoryName . '"', "no") - if(v:shell_error) - return 0 - else - return 1 - endif -endfunction - -" Function: s:svkFunctions.Add() {{{2 -function! s:svkFunctions.Add(argList) - return s:DoCommand(join(['add'] + a:argList, ' '), 'add', join(a:argList, ' '), {}) -endfunction - -" Function: s:svkFunctions.Annotate(argList) {{{2 -function! s:svkFunctions.Annotate(argList) - if len(a:argList) == 0 - if &filetype == 'SVKannotate' - " Perform annotation of the version indicated by the current line. - let caption = matchstr(getline('.'),'\v^\s+\zs\d+') - let options = ' -r' . caption - else - let caption = '' - let options = '' - endif - elseif len(a:argList) == 1 && a:argList[0] !~ '^-' - let caption = a:argList[0] - let options = ' -r' . caption - else - let caption = join(a:argList, ' ') - let options = ' ' . caption - endif - - let resultBuffer = s:DoCommand('blame' . options, 'annotate', caption, {}) - if resultBuffer > 0 - normal 1G2dd - endif - return resultBuffer -endfunction - -" Function: s:svkFunctions.Commit(argList) {{{2 -function! s:svkFunctions.Commit(argList) - let resultBuffer = s:DoCommand('commit -F "' . a:argList[0] . '"', 'commit', '', {}) - if resultBuffer == 0 - echomsg 'No commit needed.' - endif -endfunction - -" Function: s:svkFunctions.Delete() {{{2 -function! s:svkFunctions.Delete(argList) - return s:DoCommand(join(['delete'] + a:argList, ' '), 'delete', join(a:argList, ' '), {}) -endfunction - -" Function: s:svkFunctions.Diff(argList) {{{2 -function! s:svkFunctions.Diff(argList) - if len(a:argList) == 0 - let revOptions = [] - let caption = '' - elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 - let revOptions = ['-r' . join(a:argList, ':')] - let caption = '(' . a:argList[0] . ' : ' . get(a:argList, 1, 'current') . ')' - else - " Pass-through - let caption = join(a:argList, ' ') - let revOptions = a:argList - endif - - return s:DoCommand(join(['diff'] + revOptions), 'diff', caption, {}) -endfunction - -" Function: s:svkFunctions.GetBufferInfo() {{{2 -" Provides version control details for the current file. Current version -" number and current repository version number are required to be returned by -" the vcscommand plugin. -" Returns: List of results: [revision, repository] - -function! s:svkFunctions.GetBufferInfo() - let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) - let fileName = resolve(bufname(originalBuffer)) - let statusText = s:VCSCommandUtility.system(s:Executable() . ' status -v -- "' . fileName . '"') - if(v:shell_error) - return [] - endif - - " File not under SVK control. - if statusText =~ '^?' - return ['Unknown'] - endif - - let [flags, revision, repository] = matchlist(statusText, '^\(.\{3}\)\s\+\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)\s')[1:3] - if revision == '' - " Error - return ['Unknown'] - elseif flags =~ '^A' - return ['New', 'New'] - else - return [revision, repository] - endif -endfunction - -" Function: s:svkFunctions.Info(argList) {{{2 -function! s:svkFunctions.Info(argList) - return s:DoCommand(join(['info'] + a:argList, ' '), 'info', join(a:argList, ' '), {}) -endfunction - -" Function: s:svkFunctions.Lock(argList) {{{2 -function! s:svkFunctions.Lock(argList) - return s:DoCommand(join(['lock'] + a:argList, ' '), 'lock', join(a:argList, ' '), {}) -endfunction - -" Function: s:svkFunctions.Log() {{{2 -function! s:svkFunctions.Log(argList) - if len(a:argList) == 0 - let options = [] - let caption = '' - elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 - let options = ['-r' . join(a:argList, ':')] - let caption = options[0] - else - " Pass-through - let options = a:argList - let caption = join(a:argList, ' ') - endif - - let resultBuffer = s:DoCommand(join(['log', '-v'] + options), 'log', caption, {}) - return resultBuffer -endfunction - -" Function: s:svkFunctions.Revert(argList) {{{2 -function! s:svkFunctions.Revert(argList) - return s:DoCommand('revert', 'revert', '', {}) -endfunction - -" Function: s:svkFunctions.Review(argList) {{{2 -function! s:svkFunctions.Review(argList) - if len(a:argList) == 0 - let versiontag = '(current)' - let versionOption = '' - else - let versiontag = a:argList[0] - let versionOption = ' -r ' . versiontag . ' ' - endif - - return s:DoCommand('cat' . versionOption, 'review', versiontag, {}) -endfunction - -" Function: s:svkFunctions.Status(argList) {{{2 -function! s:svkFunctions.Status(argList) - let options = ['-v'] - if len(a:argList) == 0 - let options = a:argList - endif - return s:DoCommand(join(['status'] + options, ' '), 'status', join(options, ' '), {}) -endfunction - -" Function: s:svkFunctions.Unlock(argList) {{{2 -function! s:svkFunctions.Unlock(argList) - return s:DoCommand(join(['unlock'] + a:argList, ' '), 'unlock', join(a:argList, ' '), {}) -endfunction -" Function: s:svkFunctions.Update(argList) {{{2 -function! s:svkFunctions.Update(argList) - return s:DoCommand('update', 'update', '', {}) -endfunction - -" Section: Plugin Registration {{{1 -let s:VCSCommandUtility = VCSCommandRegisterModule('SVK', expand('<sfile>'), s:svkFunctions, []) - -let &cpo = s:save_cpo diff --git a/.vim/plugin/vcssvn.vim b/.vim/plugin/vcssvn.vim deleted file mode 100644 index 08e46d2..0000000 --- a/.vim/plugin/vcssvn.vim +++ /dev/null @@ -1,283 +0,0 @@ -" vim600: set foldmethod=marker: -" -" SVN extension for VCSCommand. -" -" Version: VCS development -" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> -" License: -" Copyright (c) 2007 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. -" -" Section: Documentation {{{1 -" -" Options documentation: {{{2 -" -" VCSCommandSVNExec -" This variable specifies the SVN executable. If not set, it defaults to -" 'svn' executed from the user's executable path. -" -" VCSCommandSVNDiffExt -" This variable, if set, sets the external diff program used by Subversion. -" -" VCSCommandSVNDiffOpt -" This variable, if set, determines the options passed to the svn diff -" command (such as 'u', 'w', or 'b'). - -" Section: Plugin header {{{1 - -if exists('VCSCommandDisableAll') - finish -endif - -if v:version < 700 - echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None - finish -endif - -runtime plugin/vcscommand.vim - -if !executable(VCSCommandGetOption('VCSCommandSVNExec', 'svn')) - " SVN is not installed - finish -endif - -let s:save_cpo=&cpo -set cpo&vim - -" Section: Variable initialization {{{1 - -let s:svnFunctions = {} - -" Section: Utility functions {{{1 - -" Function: s:Executable() {{{2 -" Returns the executable used to invoke git suitable for use in a shell -" command. -function! s:Executable() - return shellescape(VCSCommandGetOption('VCSCommandSVNExec', 'svn')) -endfunction - -" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 -" Wrapper to VCSCommandDoCommand to add the name of the SVN executable to the -" command argument. -function! s:DoCommand(cmd, cmdName, statusText, options) - if VCSCommandGetVCSType(expand('%')) == 'SVN' - let fullCmd = s:Executable() . ' ' . a:cmd - return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options) - else - throw 'SVN VCSCommand plugin called on non-SVN item.' - endif -endfunction - -" Section: VCS function implementations {{{1 - -" Function: s:svnFunctions.Identify(buffer) {{{2 -function! s:svnFunctions.Identify(buffer) - let fileName = resolve(bufname(a:buffer)) - if isdirectory(fileName) - let directoryName = fileName - else - let directoryName = fnamemodify(fileName, ':h') - endif - if strlen(directoryName) > 0 - let svnDir = directoryName . '/.svn' - else - let svnDir = '.svn' - endif - if isdirectory(svnDir) - return 1 - else - return 0 - endif -endfunction - -" Function: s:svnFunctions.Add() {{{2 -function! s:svnFunctions.Add(argList) - return s:DoCommand(join(['add'] + a:argList, ' '), 'add', join(a:argList, ' '), {}) -endfunction - -" Function: s:svnFunctions.Annotate(argList) {{{2 -function! s:svnFunctions.Annotate(argList) - if len(a:argList) == 0 - if &filetype == 'SVNannotate' - " Perform annotation of the version indicated by the current line. - let caption = matchstr(getline('.'),'\v^\s+\zs\d+') - let options = ' -r' . caption - else - let caption = '' - let options = '' - endif - elseif len(a:argList) == 1 && a:argList[0] !~ '^-' - let caption = a:argList[0] - let options = ' -r' . caption - else - let caption = join(a:argList, ' ') - let options = ' ' . caption - endif - - return s:DoCommand('blame --non-interactive' . options, 'annotate', caption, {}) -endfunction - -" Function: s:svnFunctions.Commit(argList) {{{2 -function! s:svnFunctions.Commit(argList) - let resultBuffer = s:DoCommand('commit --non-interactive -F "' . a:argList[0] . '"', 'commit', '', {}) - if resultBuffer == 0 - echomsg 'No commit needed.' - endif -endfunction - -" Function: s:svnFunctions.Delete() {{{2 -function! s:svnFunctions.Delete(argList) - return s:DoCommand(join(['delete --non-interactive'] + a:argList, ' '), 'delete', join(a:argList, ' '), {}) -endfunction - -" Function: s:svnFunctions.Diff(argList) {{{2 -function! s:svnFunctions.Diff(argList) - if len(a:argList) == 0 - let revOptions = [] - let caption = '' - elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 - let revOptions = ['-r' . join(a:argList, ':')] - let caption = '(' . a:argList[0] . ' : ' . get(a:argList, 1, 'current') . ')' - else - " Pass-through - let caption = join(a:argList, ' ') - let revOptions = a:argList - endif - - let svnDiffExt = VCSCommandGetOption('VCSCommandSVNDiffExt', '') - if svnDiffExt == '' - let diffExt = [] - else - let diffExt = ['--diff-cmd ' . svnDiffExt] - endif - - let svnDiffOpt = VCSCommandGetOption('VCSCommandSVNDiffOpt', '') - if svnDiffOpt == '' - let diffOptions = [] - else - let diffOptions = ['-x -' . svnDiffOpt] - endif - - return s:DoCommand(join(['diff --non-interactive'] + diffExt + diffOptions + revOptions), 'diff', caption, {}) -endfunction - -" Function: s:svnFunctions.GetBufferInfo() {{{2 -" Provides version control details for the current file. Current version -" number and current repository version number are required to be returned by -" the vcscommand plugin. -" Returns: List of results: [revision, repository, branch] - -function! s:svnFunctions.GetBufferInfo() - let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) - let fileName = bufname(originalBuffer) - let statusText = s:VCSCommandUtility.system(s:Executable() . ' status --non-interactive -vu -- "' . fileName . '"') - if(v:shell_error) - return [] - endif - - " File not under SVN control. - if statusText =~ '^?' - return ['Unknown'] - endif - - let [flags, revision, repository] = matchlist(statusText, '^\(.\{8}\)\s\+\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)\s')[1:3] - if revision == '' - " Error - return ['Unknown'] - elseif flags =~ '^A' - return ['New', 'New'] - else - return [revision, repository] - endif -endfunction - -" Function: s:svnFunctions.Info(argList) {{{2 -function! s:svnFunctions.Info(argList) - return s:DoCommand(join(['info --non-interactive'] + a:argList, ' '), 'info', join(a:argList, ' '), {}) -endfunction - -" Function: s:svnFunctions.Lock(argList) {{{2 -function! s:svnFunctions.Lock(argList) - return s:DoCommand(join(['lock --non-interactive'] + a:argList, ' '), 'lock', join(a:argList, ' '), {}) -endfunction - -" Function: s:svnFunctions.Log(argList) {{{2 -function! s:svnFunctions.Log(argList) - if len(a:argList) == 0 - let options = [] - let caption = '' - elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 - let options = ['-r' . join(a:argList, ':')] - let caption = options[0] - else - " Pass-through - let options = a:argList - let caption = join(a:argList, ' ') - endif - - let resultBuffer = s:DoCommand(join(['log --non-interactive', '-v'] + options), 'log', caption, {}) - return resultBuffer -endfunction - -" Function: s:svnFunctions.Revert(argList) {{{2 -function! s:svnFunctions.Revert(argList) - return s:DoCommand('revert', 'revert', '', {}) -endfunction - -" Function: s:svnFunctions.Review(argList) {{{2 -function! s:svnFunctions.Review(argList) - if len(a:argList) == 0 - let versiontag = '(current)' - let versionOption = '' - else - let versiontag = a:argList[0] - let versionOption = ' -r ' . versiontag . ' ' - endif - - return s:DoCommand('cat --non-interactive' . versionOption, 'review', versiontag, {}) -endfunction - -" Function: s:svnFunctions.Status(argList) {{{2 -function! s:svnFunctions.Status(argList) - let options = ['-u', '-v'] - if len(a:argList) == 0 - let options = a:argList - endif - return s:DoCommand(join(['status --non-interactive'] + options, ' '), 'status', join(options, ' '), {}) -endfunction - -" Function: s:svnFunctions.Unlock(argList) {{{2 -function! s:svnFunctions.Unlock(argList) - return s:DoCommand(join(['unlock --non-interactive'] + a:argList, ' '), 'unlock', join(a:argList, ' '), {}) -endfunction - -" Function: s:svnFunctions.Update(argList) {{{2 -function! s:svnFunctions.Update(argList) - return s:DoCommand('update --non-interactive', 'update', '', {}) -endfunction - -" Annotate setting {{{2 -let s:svnFunctions.AnnotateSplitRegex = '\s\+\S\+\s\+\S\+ ' - -" Section: Plugin Registration {{{1 -let s:VCSCommandUtility = VCSCommandRegisterModule('SVN', expand('<sfile>'), s:svnFunctions, []) - -let &cpo = s:save_cpo diff --git a/.vim/plugin/vim-scmdiff/NEWS b/.vim/plugin/vim-scmdiff/NEWS deleted file mode 100644 index c8b2899..0000000 --- a/.vim/plugin/vim-scmdiff/NEWS +++ /dev/null @@ -1,24 +0,0 @@ -2008-09-20 -* Changed the default diff key from C-d to <Leader>d (default would be \d) - -2008-09-03 -* Add Enabled/Disabled messages when scmdiff is toggled -* Fix highlighting on error messages so subsequent messages aren't highlighted - -2008-08-25 -* Move Highlight colors out of code so they can be customized by user in .vimrc - -2008-08-18 -* Initial support for mercurial auto-detection - -2008-08-17 -* fix bug: Look for SCM directories based on path of file in current buffer, not on getcwd() - -2008-08-15 -* Add auto-detection of svn, git, and cvs SCMs - -2008-08-10 - -* Make C-d a toggle to turn the diff on/off -* Avoid deleting unrelated buffers when turning diff off -* Autorefresh now works properly diff --git a/.vim/plugin/vim-scmdiff/README b/.vim/plugin/vim-scmdiff/README deleted file mode 100644 index fa757e3..0000000 --- a/.vim/plugin/vim-scmdiff/README +++ /dev/null @@ -1,22 +0,0 @@ - -vim-scmdiff: A Vim script to show the differences from a base version in SCM. - -Supported SCMs: - * CVS - * SVN - * GIT - * Mercurial - * Bitkeeper - -Installation: - copy the scmdiff.vim script to your vim plugin path ie: "~/.vim/plugins". (system paths may vary) - -Default commands: - \d Toggle diff view on/off - :D rev Difference between current and rev - -This script is an evolution from the scripts posted at the following places: - http://tekrat.com/2008/02/21/vim-diff/ - http://www.vim.org/scripts/script.php?script_id=2201 - http://playground.audioscrobbler.com/jonty/scmdiff.vim - diff --git a/.vim/plugin/vim-scmdiff/TODO b/.vim/plugin/vim-scmdiff/TODO deleted file mode 100644 index e0c4fb5..0000000 --- a/.vim/plugin/vim-scmdiff/TODO +++ /dev/null @@ -1,11 +0,0 @@ -Bugs - -* After exiting (:q) a buffer that has diff enabled, subsequent diffs appear to fail. -* Should restore options like 'wrap' to their original state when turning diff off -* winsaveview() and winrestview() require Vim 7.x. Autodetect and degrade gracefully. - -Features - -* Option to show side-by-side diff (ie. don't hide original buffer) -* Make it easier to customize colors and commands -* Add a refresh or enable an auto-update feature so diff highlighting changes as changes are made. diff --git a/.vim/plugin/vim-scmdiff/scmdiff.vim b/.vim/plugin/vim-scmdiff/scmdiff.vim deleted file mode 100644 index ade4388..0000000 --- a/.vim/plugin/vim-scmdiff/scmdiff.vim +++ /dev/null @@ -1,160 +0,0 @@ -" Vim script to show file differences from a base version in SCM. -" Home: http://github.com/ghewgill/vim-scmdiff - -" Default commands: -" \d Toggle diff view on/off -" :D rev Difference between current and rev -" -" You can change the highlighting by adding the following to your -" .vimrc file and customizing as necessary. (or just uncomment them here): -" highlight DiffAdd ctermbg=DarkBlue ctermfg=white cterm=NONE -" highlight DiffChange ctermbg=DarkBlue ctermfg=white cterm=NONE -" highlight DiffText ctermbg=DarkBlue ctermfg=white cterm=underline -" highlight DiffDelete ctermbg=red ctermfg=white - -if exists("loadedScmDiff") || &cp - finish -endif - -let loadedScmDiff = 1 - -map <silent> <Leader>d :call <SID>scmToggle()<CR> -noremap <unique> <script> <plug>Dh :call <SID>scmDiff("h")<CR> -com! -bar -nargs=? D :call s:scmDiff(<f-args>) - -let g:scmDiffRev = '' - -function! s:scmToggle() - - if exists('b:scmDiffOn') && b:scmDiffOn == 1 - let b:scmDiffOn = 0 - set nodiff - exe 'bdelete ' . b:scmDiffTmpfile - echohl DiffDelete | echon "scmdiff Disabled" | echohl None - else - call s:scmDiff() - if exists('b:scmDiffOn') && b:scmDiffOn == 1 - echohl DiffAdd | echon "scmdiff Enabled" | echohl None - endif - endif - -endfunction - -function! s:scmRefresh() - - if exists('b:scmDiffOn') && b:scmDiffOn == 1 - call s:scmDiff() - endif - -endfunction - -function! s:detectSCM() - - " Cache the results we find here to save time - if exists("g:scmBufPath") && g:scmBufPath == expand("%:p:h") && exists("g:scmDiffCommand") - return - endif - let g:scmBufPath = expand("%:p:h") - - " Detect CVS, SCCS(bitkeeper) or .svn directories in current path - if !exists("g:scmDiffCommand") && isdirectory(g:scmBufPath."/.svn") - let g:scmDiffCommand = "svn diff" - return - endif - - if !exists("g:scmDiffCommand") && isdirectory(g:scmBufPath."/CVS") - let g:scmDiffCommand = "cvs diff" - return - endif - - if !exists("g:scmDiffCommand") && isdirectory(g:scmBufPath."/SCCS") - let g:scmDiffCommand = "bk diffs" - return - endif - - " Detect .git, SCCS(bitkeeper), .hg(mercurial) directories recursively in reverse - let my_path = g:scmBufPath - while my_path != "/" - if !exists("g:scmDiffCommand") && isdirectory(my_path."/.git") - let g:scmDiffCommand = "git diff" - return - endif - if !exists("g:scmDiffCommand") && isdirectory(my_path."/.hg") - let g:scmDiffCommand = "hg diff" - return - endif - let my_path = simplify(my_path."/../") - endwhile - -endfunction - -function! s:scmDiff(...) - - call s:detectSCM() - if (!exists("g:scmDiffCommand")) - echohl WarningMsg | echon "Could not find .git, .svn, .hg, SCCS, or CVS directories, are you under a supported SCM repository path?" | echohl None - return - endif - - if exists('b:scmDiffOn') && b:scmDiffOn == 1 - let b:scmDiffOn = 0 - set nodiff - exe 'bdelete ' . b:scmDiffTmpfile - endif - - let b:scmDiffOn = 1 - let view = winsaveview() - - if a:0 == 1 - if a:1 == 'none' - let g:scmDiffRev = '' - else - let g:scmDiffRev = a:1 - endif - endif - - let ftype = &filetype - let b:scmDiffTmpfile = tempname() - let cmd = 'cat ' . bufname('%') . ' > ' . b:scmDiffTmpfile - let cmdOutput = system(cmd) - let tmpdiff = tempname() - let cmd = 'cd ' . g:scmBufPath . ' && ' . g:scmDiffCommand . ' ' . g:scmDiffRev . ' ' . expand('%:p') . ' > ' . tmpdiff - let cmdOutput = system(cmd) - - if v:shell_error && cmdOutput != '' - echohl WarningMsg | echon cmdOutput | echohl None - return - endif - - let cmd = 'patch -R -p0 ' . b:scmDiffTmpfile . ' ' . tmpdiff - let cmdOutput = system(cmd) - - if v:shell_error && cmdOutput != '' - echohl WarningMsg | echon cmdOutput | echohl None - return - endif - - if a:0 > 0 && a:1 == 'h' - exe 'diffsplit' . b:scmDiffTmpfile - else - exe 'vert diffsplit' . b:scmDiffTmpfile - endif - - exe 'set filetype=' . ftype - - hide - - set foldcolumn=0 - set foldlevel=100 - set diffopt= " removed filler so we don't show deleted lines - set noscrollbind - - call winrestview(view) - -endfunction - -autocmd CursorHold * call s:scmRefresh() - - -" vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker -" vim<600: expandtab sw=4 ts=4 sts=4 diff --git a/.vim/skeletons/svelte.skel b/.vim/skeletons/svelte.skel deleted file mode 100644 index 4f2a325..0000000 --- a/.vim/skeletons/svelte.skel +++ /dev/null @@ -1,9 +0,0 @@ -<script lang="ts"> - import { onMount, onDestroy } from "svelte"; -</script> - -<div> -</div> - -<style> -</style> diff --git a/.vim/skeletons/vue.skel b/.vim/skeletons/vue.skel deleted file mode 100644 index 8310166..0000000 --- a/.vim/skeletons/vue.skel +++ /dev/null @@ -1,19 +0,0 @@ -<template> - -</template> - -<script> -//import header from './header.vue' - -export default { - name: 'components', - data () { - return { - msg: 'Hello World' - } - } -} -</script> - -<style> -</style> diff --git a/.vim/syntax/c.vim b/.vim/syntax/c.vim deleted file mode 100644 index 8381244..0000000 --- a/.vim/syntax/c.vim +++ /dev/null @@ -1,377 +0,0 @@ -" Vim syntax file -" Language: C -" Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2008 Mar 19 - -" Quit when a (custom) syntax file was already loaded -if exists("b:current_syntax") - finish -endif - -" A bunch of useful C keywords -syn keyword cStatement goto break return continue asm -syn keyword cLabel case default -syn keyword cConditional if else switch -syn keyword cRepeat while for do - -syn keyword cTodo contained TODO FIXME XXX - -" cCommentGroup allows adding matches for special things in comments -syn cluster cCommentGroup contains=cTodo - -" String and Character constants -" Highlight special characters (those which have a backslash) differently -syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)" -if !exists("c_no_utf") - syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)" -endif -if exists("c_no_cformat") - syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell - " cCppString: same as cString, but ends at end of line - syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,@Spell -else - if !exists("c_no_c99") " ISO C99 - syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained - else - syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained - endif - syn match cFormat display "%%" contained - syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell - " cCppString: same as cString, but ends at end of line - syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell -endif - -syn match cCharacter "L\='[^\\]'" -syn match cCharacter "L'[^']*'" contains=cSpecial -if exists("c_gnu") - syn match cSpecialError "L\='\\[^'\"?\\abefnrtv]'" - syn match cSpecialCharacter "L\='\\['\"?\\abefnrtv]'" -else - syn match cSpecialError "L\='\\[^'\"?\\abfnrtv]'" - syn match cSpecialCharacter "L\='\\['\"?\\abfnrtv]'" -endif -syn match cSpecialCharacter display "L\='\\\o\{1,3}'" -syn match cSpecialCharacter display "'\\x\x\{1,2}'" -syn match cSpecialCharacter display "L'\\x\x\+'" - -"when wanted, highlight trailing white space -if exists("c_space_errors") - if !exists("c_no_trail_space_error") - syn match cSpaceError display excludenl "\s\+$" - endif - if !exists("c_no_tab_space_error") - syn match cSpaceError display " \+\t"me=e-1 - endif -endif - -" This should be before cErrInParen to avoid problems with #define ({ xxx }) -if exists("c_curly_error") - syntax match cCurlyError "}" - syntax region cBlock start="{" end="}" contains=ALLBUT,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell fold -else - syntax region cBlock start="{" end="}" transparent fold -endif - -"catch errors caused by wrong parenthesis and brackets -" also accept <% for {, %> for }, <: for [ and :> for ] (C99) -" But avoid matching <::. -syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom -if exists("c_no_curly_error") - syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell - " cCppParen: same as cParen but ends at end-of-line; used in cDefine - syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell - syn match cParenError display ")" - syn match cErrInParen display contained "^[{}]\|^<%\|^%>" -elseif exists("c_no_bracket_error") - syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell - " cCppParen: same as cParen but ends at end-of-line; used in cDefine - syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell - syn match cParenError display ")" - syn match cErrInParen display contained "[{}]\|<%\|%>" -else - syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell - " cCppParen: same as cParen but ends at end-of-line; used in cDefine - syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell - syn match cParenError display "[\])]" - syn match cErrInParen display contained "[\]{}]\|<%\|%>" - syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell - " cCppBracket: same as cParen but ends at end-of-line; used in cDefine - syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell - syn match cErrInBracket display contained "[);{}]\|<%\|%>" -endif - -"integer number, or floating point number without a dot and with "f". -syn case ignore -syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal -" Same, but without octal error (for comments) -syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctal -syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>" -"hex number -syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" -" Flag the first zero of an octal number as something special -syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero -syn match cOctalZero display contained "\<0" -syn match cFloat display contained "\d\+f" -"floating point number, with dot, optional exponent -syn match cFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" -"floating point number, starting with a dot, optional exponent -syn match cFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" -"floating point number, without dot, with exponent -syn match cFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>" -if !exists("c_no_c99") - "hexadecimal floating point number, optional leading digits, with dot, with exponent - syn match cFloat display contained "0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>" - "hexadecimal floating point number, with leading digits, optional dot, with exponent - syn match cFloat display contained "0x\x\+\.\=p[-+]\=\d\+[fl]\=\>" -endif - -" flag an octal number with wrong digits -syn match cOctalError display contained "0\o*[89]\d*" -syn case match - -if exists("c_comment_strings") - " A comment can contain cString, cCharacter and cNumber. - " But a "*/" inside a cString in a cComment DOES end the comment! So we - " need to use a special type of cString: cCommentString, which also ends on - " "*/", and sees a "*" at the start of the line as comment again. - " Unfortunately this doesn't very well work for // type of comments :-( - syntax match cCommentSkip contained "^\s*\*\($\|\s\+\)" - syntax region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip - syntax region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial - syntax region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError,@Spell - if exists("c_no_comment_fold") - " Use "extend" here to have preprocessor lines not terminate halfway a - " comment. - syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell extend - else - syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell fold extend - endif -else - syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cSpaceError,@Spell - if exists("c_no_comment_fold") - syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell extend - else - syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell fold extend - endif -endif -" keep a // comment separately, it terminates a preproc. conditional -syntax match cCommentError display "\*/" -syntax match cCommentStartError display "/\*"me=e-1 contained - -syn keyword cOperator sizeof -if exists("c_gnu") - syn keyword cStatement __asm__ - syn keyword cOperator typeof __real__ __imag__ -endif -syn keyword cType int long short char void -syn keyword cType signed unsigned float double -if !exists("c_no_ansi") || exists("c_ansi_typedefs") - syn keyword cType size_t ssize_t off_t wchar_t ptrdiff_t sig_atomic_t fpos_t - syn keyword cType clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t - syn keyword cType mbstate_t wctrans_t wint_t wctype_t -endif -if !exists("c_no_c99") " ISO C99 - syn keyword cType bool complex - syn keyword cType int8_t int16_t int32_t int64_t - syn keyword cType uint8_t uint16_t uint32_t uint64_t - syn keyword cType int_least8_t int_least16_t int_least32_t int_least64_t - syn keyword cType uint_least8_t uint_least16_t uint_least32_t uint_least64_t - syn keyword cType int_fast8_t int_fast16_t int_fast32_t int_fast64_t - syn keyword cType uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t - syn keyword cType intptr_t uintptr_t - syn keyword cType intmax_t uintmax_t -endif -if exists("c_gnu") - syn keyword cType __label__ __complex__ __volatile__ -endif - -syn keyword cStructure struct union enum typedef -syn keyword cStorageClass static register auto volatile extern const -if exists("c_gnu") - syn keyword cStorageClass inline __attribute__ -endif -if !exists("c_no_c99") - syn keyword cStorageClass inline restrict -endif - -if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") - if exists("c_gnu") - syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__ __func__ - endif - syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__ - syn keyword cConstant __STDC_VERSION__ - syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX - syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX - syn keyword cConstant CHAR_MIN INT_MIN LONG_MIN SHRT_MIN - syn keyword cConstant CHAR_MAX INT_MAX LONG_MAX SHRT_MAX - syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN - syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX - if !exists("c_no_c99") - syn keyword cConstant __func__ - syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX - syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN - syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX - syn keyword cConstant UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX - syn keyword cConstant INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN - syn keyword cConstant INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX - syn keyword cConstant UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX - syn keyword cConstant INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN - syn keyword cConstant INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX - syn keyword cConstant UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX - syn keyword cConstant INTPTR_MIN INTPTR_MAX UINTPTR_MAX - syn keyword cConstant INTMAX_MIN INTMAX_MAX UINTMAX_MAX - syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX - syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX - endif - syn keyword cConstant FLT_RADIX FLT_ROUNDS - syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON - syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON - syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON - syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP - syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP - syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP - syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP - syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP - syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP - syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL - syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY - syn keyword cConstant LC_NUMERIC LC_TIME - syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN - syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM - " Add POSIX signals as well... - syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP - syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV - syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU - syn keyword cConstant SIGUSR1 SIGUSR2 - syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF - syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam - syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET - syn keyword cConstant TMP_MAX stderr stdin stdout - syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX - " Add POSIX errors as well - syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY - syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT - syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR - syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV - syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS - syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM - syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV - " math.h - syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4 - syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2 -endif -if !exists("c_no_c99") " ISO C99 - syn keyword cConstant true false -endif - -" Accept %: for # (C99) -syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError -syn match cPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>" -if !exists("c_no_if0") - if !exists("c_no_if0_fold") - syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2 fold - else - syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2 - endif - syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip - syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip -endif -syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ -syn match cIncluded display contained "<[^>]*>" -syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded -"syn match cLineSkip "\\$" -syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti -syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 keepend contains=ALLBUT,@cPreProcGroup,@Spell -syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell - -" Highlight User Labels -syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString -syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell -" Avoid matching foo::bar() in C++ by requiring that the next char is not ':' -syn cluster cLabelGroup contains=cUserLabel -syn match cUserCont display "^\s*\I\i*\s*:$" contains=@cLabelGroup -syn match cUserCont display ";\s*\I\i*\s*:$" contains=@cLabelGroup -syn match cUserCont display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup -syn match cUserCont display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup - -syn match cUserLabel display "\I\i*" contained - -" Avoid recognizing most bitfields as labels -syn match cBitField display "^\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType -syn match cBitField display ";\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType - -" Highlight Class and Function names -syn match cCustomParen "(" contains=cParen contains=cCppParen -syn match cCustomFunc "\w\+\s*(" contains=cCustomParen -syn match cCustomScope "::" -syn match cCustomClass "\w\+\s*::" contains=cCustomScope - -hi def link cCustomFunc Function -hi def link cCustomClass Function - -if exists("c_minlines") - let b:c_minlines = c_minlines -else - if !exists("c_no_if0") - let b:c_minlines = 50 " #if 0 constructs can be long - else - let b:c_minlines = 15 " mostly for () constructs - endif -endif -if exists("c_curly_error") - syn sync fromstart -else - exec "syn sync ccomment cComment minlines=" . b:c_minlines -endif - -" Define the default highlighting. -" Only used when an item doesn't have highlighting yet -hi def link cFormat cSpecial -hi def link cCppString cString -hi def link cCommentL cComment -hi def link cCommentStart cComment -hi def link cLabel Label -hi def link cUserLabel Label -hi def link cConditional Conditional -hi def link cRepeat Repeat -hi def link cCharacter Character -hi def link cSpecialCharacter cSpecial -hi def link cNumber Number -hi def link cOctal Number -hi def link cOctalZero PreProc " link this to Error if you want -hi def link cFloat Float -hi def link cOctalError cError -hi def link cParenError cError -hi def link cErrInParen cError -hi def link cErrInBracket cError -hi def link cCommentError cError -hi def link cCommentStartError cError -hi def link cSpaceError cError -hi def link cSpecialError cError -hi def link cCurlyError cError -hi def link cOperator Operator -hi def link cStructure Structure -hi def link cStorageClass StorageClass -hi def link cInclude Include -hi def link cPreProc PreProc -hi def link cDefine Macro -hi def link cIncluded cString -hi def link cError Error -hi def link cStatement Statement -hi def link cPreCondit PreCondit -hi def link cType Type -hi def link cConstant Constant -hi def link cCommentString cString -hi def link cComment2String cString -hi def link cCommentSkip cComment -hi def link cString String -hi def link cComment Comment -hi def link cSpecial SpecialChar -hi def link cTodo Todo -hi def link cCppSkip cCppOut -hi def link cCppOut2 cCppOut -hi def link cCppOut Comment - -let b:current_syntax = "c" - -" vim: ts=8 diff --git a/.vim/syntax/cvsannotate.vim b/.vim/syntax/cvsannotate.vim deleted file mode 100644 index 4af5809..0000000 --- a/.vim/syntax/cvsannotate.vim +++ /dev/null @@ -1,45 +0,0 @@ -" Vim syntax file -" Language: CVS annotate output -" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> -" Remark: Used by the cvscommand plugin. Originally written by Mathieu -" Clabaut -" License: -" Copyright (c) 2007 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. - -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -syn match cvsDate /\d\d-...-\d\d/ contained -syn match cvsName /(\S* /hs=s+1,he=e-1 contained nextgroup=cvsDate -syn match cvsVer /^\d\+\(\.\d\+\)\+/ contained nextgroup=cvsName -syn region cvsHead start="^\d\+\.\d\+" end="):" contains=cvsVer,cvsName,cvsDate - -if !exists("did_cvsannotate_syntax_inits") - let did_cvsannotate_syntax_inits = 1 - hi link cvsDate Comment - hi link cvsName Type - hi link cvsVer Statement -endif - -let b:current_syntax="CVSAnnotate" diff --git a/.vim/syntax/gitannotate.vim b/.vim/syntax/gitannotate.vim deleted file mode 100644 index 932342d..0000000 --- a/.vim/syntax/gitannotate.vim +++ /dev/null @@ -1,44 +0,0 @@ -" Vim syntax file -" Language: git annotate output -" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> -" Remark: Used by the vcscommand plugin. -" License: -" Copyright (c) 2009 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. - -if exists("b:current_syntax") - finish -endif - -syn region gitName start="(\@<=" end="\( \d\d\d\d-\)\@=" contained -syn match gitCommit /^\^\?\x\+/ contained -syn match gitDate /\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d [+-]\d\d\d\d/ contained -syn match gitLineNumber /\d\+)\@=/ contained -syn region gitAnnotation start="^" end=") " oneline keepend contains=gitCommit,gitLineNumber,gitDate,gitName - -if !exists("did_gitannotate_syntax_inits") - let did_gitannotate_syntax_inits = 1 - hi link gitName Type - hi link gitCommit Statement - hi link gitDate Comment - hi link gitLineNumber Label -endif - -let b:current_syntax="gitAnnotate" diff --git a/.vim/syntax/haskell.vim b/.vim/syntax/haskell.vim deleted file mode 100644 index 10bb221..0000000 --- a/.vim/syntax/haskell.vim +++ /dev/null @@ -1,355 +0,0 @@ -" Vim syntax file -" -" Modification of vims Haskell syntax file: -" - match types using regular expression -" - highlight toplevel functions -" - use "syntax keyword" instead of "syntax match" where appropriate -" - functions and types in import and module declarations are matched -" - removed hs_highlight_more_types (just not needed anymore) -" - enable spell checking in comments and strings only -" - FFI highlighting -" - QuasiQuotation -" - top level Template Haskell slices -" - PackageImport -" -" TODO: find out which vim versions are still supported -" -" From Original file: -" =================== -" -" Language: Haskell -" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org> -" Last Change: 2010 Feb 21 -" Original Author: John Williams <jrw@pobox.com> -" -" Thanks to Ryan Crumley for suggestions and John Meacham for -" pointing out bugs. Also thanks to Ian Lynagh and Donald Bruce Stewart -" for providing the inspiration for the inclusion of the handling -" of C preprocessor directives, and for pointing out a bug in the -" end-of-line comment handling. -" -" Options-assign a value to these variables to turn the option on: -" -" hs_highlight_delimiters - Highlight delimiter characters--users -" with a light-colored background will -" probably want to turn this on. -" hs_highlight_boolean - Treat True and False as keywords. -" hs_highlight_types - Treat names of primitive types as keywords. -" hs_highlight_debug - Highlight names of debugging functions. -" hs_allow_hash_operator - Don't highlight seemingly incorrect C -" preprocessor directives but assume them to be -" operators -" -" - -if version < 600 - syn clear -elseif exists("b:current_syntax") - finish -endif - -"syntax sync fromstart "mmhhhh.... is this really ok to do so? -syntax sync linebreaks=15 minlines=50 maxlines=500 - -syn match hsSpecialChar contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)" -syn match hsSpecialChar contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)" -syn match hsSpecialCharError contained "\\&\|'''\+" -sy region hsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=hsSpecialChar,@Spell -sy match hsCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=hsSpecialChar,hsSpecialCharError -sy match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hsSpecialCharError - -" (Qualified) identifiers (no default highlighting) -syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>" -syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>" - -" Infix operators--most punctuation characters and any (qualified) identifier -" enclosed in `backquotes`. An operator starting with : is a constructor, -" others are variables (e.g. functions). -syn match hsVarSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[-!#$%&\*\+/<=>\?@\\^|~.][-!#$%&\*\+/<=>\?@\\^|~:.]*" -syn match hsConSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=:[-!#$%&\*\+./<=>\?@\\^|~:]*" -syn match hsVarSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[a-z][a-zA-Z0-9_']*`" -syn match hsConSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[A-Z][a-zA-Z0-9_']*`" - -" Toplevel Template Haskell support -"sy match hsTHTopLevel "^[a-z]\(\(.\&[^=]\)\|\(\n[^a-zA-Z0-9]\)\)*" -sy match hsTHIDTopLevel "^[a-z]\S*" -sy match hsTHTopLevel "^\$(\?" nextgroup=hsTHTopLevelName -sy match hsTHTopLevelName "[a-z]\S*" contained - -" Reserved symbols--cannot be overloaded. -syn match hsDelimiter "(\|)\|\[\|\]\|,\|;\|_\|{\|}" - -sy region hsInnerParen start="(" end=")" contained contains=hsInnerParen,hsConSym,hsType,hsVarSym -sy region hs_InfixOpFunctionName start="^(" end=")\s*[^:`]\(\W\&\S\&[^'\"`()[\]{}@]\)\+"re=s - \ contained keepend contains=hsInnerParen,hs_HlInfixOp - -sy match hs_hlFunctionName "[a-z_]\(\S\&[^,\(\)\[\]]\)*" contained -sy match hs_FunctionName "^[a-z_]\(\S\&[^,\(\)\[\]]\)*" contained contains=hs_hlFunctionName -sy match hs_HighliteInfixFunctionName "`[a-z_][^`]*`" contained -sy match hs_InfixFunctionName "^\S[^=]*`[a-z_][^`]*`"me=e-1 contained contains=hs_HighliteInfixFunctionName,hsType,hsConSym,hsVarSym,hsString,hsCharacter -sy match hs_HlInfixOp "\(\W\&\S\&[^`(){}'[\]]\)\+" contained contains=hsString -sy match hs_InfixOpFunctionName "^\(\(\w\|[[\]{}]\)\+\|\(\".*\"\)\|\('.*'\)\)\s*[^:]=*\(\W\&\S\&[^='\"`()[\]{}@]\)\+" - \ contained contains=hs_HlInfixOp,hsCharacter - -sy match hs_OpFunctionName "(\(\W\&[^(),\"]\)\+)" contained -"sy region hs_Function start="^["'a-z_([{]" end="=\(\s\|\n\|\w\|[([]\)" keepend extend -sy region hs_Function start="^["'a-zA-Z_([{]\(\(.\&[^=]\)\|\(\n\s\)\)*=" end="\(\s\|\n\|\w\|[([]\)" - \ contains=hs_OpFunctionName,hs_InfixOpFunctionName,hs_InfixFunctionName,hs_FunctionName,hsType,hsConSym,hsVarSym,hsString,hsCharacter - -sy match hs_DeclareFunction "^[a-z_(]\S*\(\s\|\n\)*::" contains=hs_FunctionName,hs_OpFunctionName - -" hi hs_InfixOpFunctionName guibg=yellow -" hi hs_Function guibg=green -" hi hs_InfixFunctionName guibg=red -" hi hs_DeclareFunction guibg=red - -sy keyword hsStructure data family class where instance default deriving -sy keyword hsTypedef type newtype - -sy keyword hsInfix infix infixl infixr -sy keyword hsStatement do case of let in -sy keyword hsConditional if then else - -"if exists("hs_highlight_types") - " Primitive types from the standard prelude and libraries. - sy match hsType "\<[A-Z]\(\S\&[^,.]\)*\>" - sy match hsType "()" -"endif - -" Not real keywords, but close. -if exists("hs_highlight_boolean") - " Boolean constants from the standard prelude. - syn keyword hsBoolean True False -endif - -syn region hsPackageString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial contained -sy match hsModuleName excludenl "\([A-Z]\w*\.\?\)*" contained - -sy match hsImport "\<import\>\s\+\(qualified\s\+\)\?\(\<\(\w\|\.\)*\>\)" - \ contains=hsModuleName,hsImportLabel - \ nextgroup=hsImportParams,hsImportIllegal skipwhite -sy keyword hsImportLabel import qualified contained - -sy match hsImportIllegal "\w\+" contained - -sy keyword hsAsLabel as contained -sy keyword hsHidingLabel hiding contained - -sy match hsImportParams "as\s\+\(\w\+\)" contained - \ contains=hsModuleName,hsAsLabel - \ nextgroup=hsImportParams,hsImportIllegal skipwhite -sy match hsImportParams "hiding" contained - \ contains=hsHidingLabel - \ nextgroup=hsImportParams,hsImportIllegal skipwhite -sy region hsImportParams start="(" end=")" contained - \ contains=hsBlockComment,hsLineComment, hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName - \ nextgroup=hsImportIllegal skipwhite - -" hi hsImport guibg=red -"hi hsImportParams guibg=bg -"hi hsImportIllegal guibg=bg -"hi hsModuleName guibg=bg - -"sy match hsImport "\<import\>\(.\|[^(]\)*\((.*)\)\?" -" \ contains=hsPackageString,hsImportLabel,hsImportMod,hsModuleName,hsImportList -"sy keyword hsImportLabel import contained -"sy keyword hsImportMod as qualified hiding contained -"sy region hsImportListInner start="(" end=")" contained keepend extend contains=hs_OpFunctionName -"sy region hsImportList matchgroup=hsImportListParens start="("rs=s+1 end=")"re=e-1 -" \ contained -" \ keepend extend -" \ contains=hsType,hsLineComment,hsBlockComment,hs_hlFunctionName,hsImportListInner - - - -" new module highlighting -syn region hsDelimTypeExport start="\<[A-Z]\(\S\&[^,.]\)*\>(" end=")" contained - \ contains=hsType - -sy keyword hsExportModuleLabel module contained -sy match hsExportModule "\<module\>\(\s\|\t\|\n\)*\([A-Z]\w*\.\?\)*" contained contains=hsExportModuleLabel,hsModuleName - -sy keyword hsModuleStartLabel module contained -sy keyword hsModuleWhereLabel where contained - -syn match hsModuleStart "^module\(\s\|\n\)*\(\<\(\w\|\.\)*\>\)\(\s\|\n\)*" - \ contains=hsModuleStartLabel,hsModuleName - \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel - -syn region hsModuleCommentA start="{-" end="-}" - \ contains=hsModuleCommentA,hsCommentTodo,@Spell contained - \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel skipwhite skipnl - -syn match hsModuleCommentA "--.*\n" - \ contains=hsCommentTodo,@Spell contained - \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel skipwhite skipnl - -syn region hsModuleExports start="(" end=")" contained - \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl - \ contains=hsBlockComment,hsLineComment,hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName,hsExportModule - -syn match hsModuleCommentB "--.*\n" - \ contains=hsCommentTodo,@Spell contained - \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl - -syn region hsModuleCommentB start="{-" end="-}" - \ contains=hsModuleCommentB,hsCommentTodo,@Spell contained - \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl -" end module highlighting - -" FFI support -sy keyword hsFFIForeign foreign contained -"sy keyword hsFFIImportExport import export contained -sy keyword hsFFIImportExport export contained -sy keyword hsFFICallConvention ccall stdcall contained -sy keyword hsFFISafety safe unsafe contained -sy region hsFFIString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=hsSpecialChar -sy match hsFFI excludenl "\<foreign\>\(.\&[^\"]\)*\"\(.\)*\"\(\s\|\n\)*\(.\)*::" - \ keepend - \ contains=hsFFIForeign,hsFFIImportExport,hsFFICallConvention,hsFFISafety,hsFFIString,hs_OpFunctionName,hs_hlFunctionName - - -sy match hsNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>" -sy match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>" - -" Comments -sy keyword hsCommentTodo TODO FIXME XXX TBD contained -sy match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=hsCommentTodo,@Spell -sy region hsBlockComment start="{-" end="-}" contains=hsBlockComment,hsCommentTodo,@Spell -sy region hsPragma start="{-#" end="#-}" - -" QuasiQuotation -sy region hsQQ start="\[\$" end="|\]"me=e-2 keepend contains=hsQQVarID,hsQQContent nextgroup=hsQQEnd -sy region hsQQNew start="\[\(.\&[^|]\&\S\)*|" end="|\]"me=e-2 keepend contains=hsQQVarIDNew,hsQQContent nextgroup=hsQQEnd -sy match hsQQContent ".*" contained -sy match hsQQEnd "|\]" contained -sy match hsQQVarID "\[\$\(.\&[^|]\)*|" contained -sy match hsQQVarIDNew "\[\(.\&[^|]\)*|" contained - -if exists("hs_highlight_debug") - " Debugging functions from the standard prelude. - syn keyword hsDebug undefined error trace -endif - - -" C Preprocessor directives. Shamelessly ripped from c.vim and trimmed -" First, see whether to flag directive-like lines or not -if (!exists("hs_allow_hash_operator")) - syn match cError display "^\s*\(%:\|#\).*$" -endif -" Accept %: for # (C99) -syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCommentError -syn match cPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>" -syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2 -syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cCppSkip -syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cCppSkip -syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ -syn match cIncluded display contained "<[^>]*>" -syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded -syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cCppOut,cCppOut2,cCppSkip,cCommentStartError -syn region cDefine matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" -syn region cPreProc matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend - -syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=cCommentStartError,cSpaceError contained -syntax match cCommentError display "\*/" contained -syntax match cCommentStartError display "/\*"me=e-1 contained -syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial contained - - -if version >= 508 || !exists("did_hs_syntax_inits") - if version < 508 - let did_hs_syntax_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi def link <args> - endif - - HiLink hs_hlFunctionName Function - HiLink hs_HighliteInfixFunctionName Function - HiLink hs_HlInfixOp Function - HiLink hs_OpFunctionName Function - HiLink hsTypedef Typedef - HiLink hsVarSym hsOperator - HiLink hsConSym hsOperator - if exists("hs_highlight_delimiters") - " Some people find this highlighting distracting. - HiLink hsDelimiter Delimiter - endif - - HiLink hsModuleStartLabel Structure - HiLink hsExportModuleLabel Keyword - HiLink hsModuleWhereLabel Structure - HiLink hsModuleName Normal - - HiLink hsImportIllegal Error - HiLink hsAsLabel hsImportLabel - HiLink hsHidingLabel hsImportLabel - HiLink hsImportLabel Include - HiLink hsImportMod Include - HiLink hsPackageString hsString - - HiLink hsOperator Operator - - HiLink hsInfix Keyword - HiLink hsStructure Structure - HiLink hsStatement Statement - HiLink hsConditional Conditional - - HiLink hsSpecialCharError Error - HiLink hsSpecialChar SpecialChar - HiLink hsString String - HiLink hsFFIString String - HiLink hsCharacter Character - HiLink hsNumber Number - HiLink hsFloat Float - - HiLink hsLiterateComment hsComment - HiLink hsBlockComment hsComment - HiLink hsLineComment hsComment - HiLink hsModuleCommentA hsComment - HiLink hsModuleCommentB hsComment - HiLink hsComment Comment - HiLink hsCommentTodo Todo - HiLink hsPragma SpecialComment - HiLink hsBoolean Boolean - - if exists("hs_highlight_types") - HiLink hsDelimTypeExport hsType - HiLink hsType Type - endif - - HiLink hsDebug Debug - - HiLink cCppString hsString - HiLink cCommentStart hsComment - HiLink cCommentError hsError - HiLink cCommentStartError hsError - HiLink cInclude Include - HiLink cPreProc PreProc - HiLink cDefine Macro - HiLink cIncluded hsString - HiLink cError Error - HiLink cPreCondit PreCondit - HiLink cComment Comment - HiLink cCppSkip cCppOut - HiLink cCppOut2 cCppOut - HiLink cCppOut Comment - - HiLink hsFFIForeign Keyword - HiLink hsFFIImportExport Structure - HiLink hsFFICallConvention Keyword - HiLink hsFFISafety Keyword - - HiLink hsTHIDTopLevel Macro - HiLink hsTHTopLevelName Macro - - HiLink hsQQVarID Keyword - HiLink hsQQVarIDNew Keyword - HiLink hsQQEnd Keyword - HiLink hsQQContent String - - delcommand HiLink -endif - -let b:current_syntax = "haskell" - diff --git a/.vim/syntax/hgannotate.vim b/.vim/syntax/hgannotate.vim deleted file mode 100755 index cee9a23..0000000 --- a/.vim/syntax/hgannotate.vim +++ /dev/null @@ -1,40 +0,0 @@ -" Vim syntax file -" Language: HG annotate output -" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> -" Remark: Used by the vcscommand plugin. -" License: -" Copyright (c) 2010 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. - -if exists("b:current_syntax") - finish -endif - -syn match hgVer /\d\+/ contained -syn match hgName /^\s*\S\+/ contained -syn match hgHead /^\s*\S\+\s\+\d\+:/ contains=hgVer,hgName - -if !exists("did_hgannotate_syntax_inits") - let did_hgannotate_syntax_inits = 1 - hi link hgName Type - hi link hgVer Statement -endif - -let b:current_syntax="hgAnnotate" diff --git a/.vim/syntax/java.vim b/.vim/syntax/java.vim deleted file mode 100644 index 8c33b12..0000000 --- a/.vim/syntax/java.vim +++ /dev/null @@ -1,9 +0,0 @@ -" Highlight Class and Function names -syn match javaCustomParen "(" contains=javaParenT -syn match javaCustomFunc "\w\+\s*(" contains=javaCustomParen -syn match javaCustomScope "::" -syn match javaCustomClass "\w\+\s*::" contains=cCustomScope - -hi def link javaCustomFunc Function -hi def link javaCustomClass Function - diff --git a/.vim/syntax/javascript.vim b/.vim/syntax/javascript.vim deleted file mode 100644 index 53b684e..0000000 --- a/.vim/syntax/javascript.vim +++ /dev/null @@ -1,247 +0,0 @@ -" Vim syntax file -" Language: JavaScript -" Maintainer: Yi Zhao (ZHAOYI) <zzlinux AT hotmail DOT com> -" Last Change: June 4, 2009 -" Version: 0.7.7 -" Changes: Add "undefined" as a type keyword -" -" TODO: -" - Add the HTML syntax inside the JSDoc - -if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish - endif - let main_syntax = 'javascript' -endif - -"" Drop fold if it set but VIM doesn't support it. -let b:javascript_fold='true' -if version < 600 " Don't support the old version - unlet! b:javascript_fold -endif - -"" dollar sigh is permittd anywhere in an identifier -setlocal iskeyword+=$ - -syntax sync fromstart - -"" JavaScript comments -syntax keyword javaScriptCommentTodo TODO FIXME XXX TBD contained -syntax region javaScriptLineComment start=+\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell -syntax region javaScriptLineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell fold -syntax region javaScriptCvsTag start="\$\cid:" end="\$" oneline contained -syntax region javaScriptComment start="/\*" end="\*/" contains=javaScriptCommentTodo,javaScriptCvsTag,@Spell fold - -"" JSDoc support start -if !exists("javascript_ignore_javaScriptdoc") - syntax case ignore - - "" syntax coloring for javadoc comments (HTML) - "syntax include @javaHtml <sfile>:p:h/html.vim - "unlet b:current_syntax - - syntax region javaScriptDocComment matchgroup=javaScriptComment start="/\*\*\s*$" end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,javaScriptCvsTag,@javaScriptHtml,@Spell fold - syntax match javaScriptDocTags contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\)\>" nextgroup=javaScriptDocParam,javaScriptDocSeeTag skipwhite - syntax match javaScriptDocTags contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|returns\=\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>" - syntax match javaScriptDocParam contained "\%(#\|\w\|\.\|:\|\/\)\+" - syntax region javaScriptDocSeeTag contained matchgroup=javaScriptDocSeeTag start="{" end="}" contains=javaScriptDocTags - - syntax case match -endif "" JSDoc end - -syntax case match - -"" Syntax in the JavaScript code -syntax match javaScriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\." -syntax region javaScriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=javaScriptSpecial,@htmlPreproc -syntax region javaScriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc -syntax region javaScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,@htmlPreproc oneline -syntax match javaScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/ -syntax match javaScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/ -syntax match javaScriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/ - -"" JavaScript Prototype -syntax keyword javaScriptPrototype prototype - -"" Programm Keywords -syntax keyword javaScriptSource import export -syntax keyword javaScriptType const this undefined var void yield -syntax keyword javaScriptOperator delete new in instanceof let typeof -syntax keyword javaScriptBoolean true false -syntax keyword javaScriptNull null - -"" Statement Keywords -syntax keyword javaScriptConditional if else -syntax keyword javaScriptRepeat do while for -syntax keyword javaScriptBranch break continue switch case default return -syntax keyword javaScriptStatement try catch throw with finally - -syntax keyword javaScriptGlobalObjects Array Boolean Date Function Infinity JavaArray JavaClass JavaObject JavaPackage Math Number NaN Object Packages RegExp String Undefined java netscape sun - -syntax keyword javaScriptExceptions Error EvalError RangeError ReferenceError SyntaxError TypeError URIError - -syntax keyword javaScriptFutureKeys abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public - -"" DOM/HTML/CSS specified things - - " DOM2 Objects - syntax keyword javaScriptGlobalObjects DOMImplementation DocumentFragment Document Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction - syntax keyword javaScriptExceptions DOMException - - " DOM2 CONSTANT - syntax keyword javaScriptDomErrNo INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR - syntax keyword javaScriptDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE - - " HTML events and internal variables - syntax case ignore - syntax keyword javaScriptHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize - syntax case match - -" Follow stuff should be highligh within a special context -" While it can't be handled with context depended with Regex based highlight -" So, turn it off by default -if exists("javascript_enable_domhtmlcss") - - " DOM2 things - syntax match javaScriptDomElemAttrs contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/ - syntax match javaScriptDomElemFuncs contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=javaScriptParen skipwhite - " HTML things - syntax match javaScriptHtmlElemAttrs contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/ - syntax match javaScriptHtmlElemFuncs contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=javaScriptParen skipwhite - - " CSS Styles in JavaScript - syntax keyword javaScriptCssStyles contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition - syntax keyword javaScriptCssStyles contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition - syntax keyword javaScriptCssStyles contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode - syntax keyword javaScriptCssStyles contained bottom height left position right top width zIndex - syntax keyword javaScriptCssStyles contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout - syntax keyword javaScriptCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop - syntax keyword javaScriptCssStyles contained listStyle listStyleImage listStylePosition listStyleType - syntax keyword javaScriptCssStyles contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat - syntax keyword javaScriptCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType - syntax keyword javaScriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText - syntax keyword javaScriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor - - " Highlight ways - syntax match javaScriptDotNotation "\." nextgroup=javaScriptPrototype,javaScriptDomElemAttrs,javaScriptDomElemFuncs,javaScriptHtmlElemAttrs,javaScriptHtmlElemFuncs - syntax match javaScriptDotNotation "\.style\." nextgroup=javaScriptCssStyles - -endif "DOM/HTML/CSS - -"" end DOM/HTML/CSS specified things - - -"" Code blocks -syntax cluster javaScriptAll contains=javaScriptComment,javaScriptLineComment,javaScriptDocComment,javaScriptStringD,javaScriptStringS,javaScriptRegexpString,javaScriptNumber,javaScriptFloat,javaScriptLabel,javaScriptSource,javaScriptType,javaScriptOperator,javaScriptBoolean,javaScriptNull,javaScriptFunction,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptStatement,javaScriptGlobalObjects,javaScriptExceptions,javaScriptFutureKeys,javaScriptDomErrNo,javaScriptDomNodeConsts,javaScriptHtmlEvents,javaScriptDotNotation -syntax region javaScriptBracket matchgroup=javaScriptBracket transparent start="\[" end="\]" contains=@javaScriptAll,javaScriptParensErrB,javaScriptParensErrC,javaScriptBracket,javaScriptParen,javaScriptBlock,@htmlPreproc -syntax region javaScriptParen matchgroup=javaScriptParen transparent start="(" end=")" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrC,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc -syntax region javaScriptBlock matchgroup=javaScriptBlock transparent start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc - -"" catch errors caused by wrong parenthesis -syntax match javaScriptParensError ")\|}\|\]" -syntax match javaScriptParensErrA contained "\]" -syntax match javaScriptParensErrB contained ")" -syntax match javaScriptParensErrC contained "}" - -if main_syntax == "javascript" - syntax sync clear - syntax sync ccomment javaScriptComment minlines=200 - syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/ -endif - -"" Fold control -if exists("b:javascript_fold") - syntax match javaScriptFunction /\<function\>/ nextgroup=javaScriptFuncName skipwhite - syntax match javaScriptOpAssign /=\@<!=/ nextgroup=javaScriptFuncBlock skipwhite skipempty - syntax region javaScriptFuncName contained matchgroup=javaScriptFuncName start=/\%(\$\|\w\)*\s*(/ end=/)/ contains=javaScriptLineComment,javaScriptComment nextgroup=javaScriptFuncBlock skipwhite skipempty - syntax region javaScriptFuncBlock contained matchgroup=javaScriptFuncBlock start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock fold - - if &l:filetype=='javascript' && !&diff - " Fold setting - " Redefine the foldtext (to show a JS function outline) and foldlevel - " only if the entire buffer is JavaScript, but not if JavaScript syntax - " is embedded in another syntax (e.g. HTML). - setlocal foldmethod=syntax - setlocal foldlevel=4 - endif -else - syntax keyword javaScriptFunction function - setlocal foldmethod< - setlocal foldlevel< -endif - -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_javascript_syn_inits") - if version < 508 - let did_javascript_syn_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi def link <args> - endif - HiLink javaScriptComment Comment - HiLink javaScriptLineComment Comment - HiLink javaScriptDocComment Comment - HiLink javaScriptCommentTodo Todo - HiLink javaScriptCvsTag Function - HiLink javaScriptDocTags Special - HiLink javaScriptDocSeeTag Function - HiLink javaScriptDocParam Function - HiLink javaScriptStringS String - HiLink javaScriptStringD String - HiLink javaScriptRegexpString String - HiLink javaScriptCharacter Character - HiLink javaScriptPrototype Type - HiLink javaScriptConditional Conditional - HiLink javaScriptBranch Conditional - HiLink javaScriptRepeat Repeat - HiLink javaScriptStatement Statement -" HiLink javaScriptFunction Function - HiLink javaScriptFunction Keyword - HiLink javaScriptError Error - HiLink javaScriptParensError Error - HiLink javaScriptParensErrA Error - HiLink javaScriptParensErrB Error - HiLink javaScriptParensErrC Error - HiLink javaScriptOperator Operator - HiLink javaScriptType Type - HiLink javaScriptNull Type - HiLink javaScriptNumber Number - HiLink javaScriptFloat Number - HiLink javaScriptBoolean Boolean - HiLink javaScriptLabel Label - HiLink javaScriptSpecial Special - HiLink javaScriptSource Special - HiLink javaScriptGlobalObjects Special - HiLink javaScriptExceptions Special - - HiLink javaScriptDomErrNo Constant - HiLink javaScriptDomNodeConsts Constant - HiLink javaScriptDomElemAttrs Label - HiLink javaScriptDomElemFuncs PreProc - - HiLink javaScriptHtmlEvents Special - HiLink javaScriptHtmlElemAttrs Label - HiLink javaScriptHtmlElemFuncs PreProc - - HiLink javaScriptCssStyles Label - - delcommand HiLink -endif - -" Define the htmlJavaScript for HTML syntax html.vim -"syntax clear htmlJavaScript -"syntax clear javaScriptExpression -syntax cluster htmlJavaScript contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError -syntax cluster javaScriptExpression contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError,@htmlPreproc - -let b:current_syntax = "javascript" -if main_syntax == 'javascript' - unlet main_syntax -endif - -" vim: ts=4 diff --git a/.vim/syntax/lilypond-words b/.vim/syntax/lilypond-words deleted file mode 100644 index 612d59b..0000000 --- a/.vim/syntax/lilypond-words +++ /dev/null @@ -1,1040 +0,0 @@ -\\withMusicProperty -\\with -\\whiteTriangleMarkup -\\voiceTwoStyle -\\voiceTwo -\\voiceThreeStyle -\\voiceThree -\\voiceOneStyle -\\voiceOne -\\voiceNeutralStyle -\\voiceFourStyle -\\voiceFour -\\vocalName -\\virgula -\\virga -\\verylongfermata -\\verticallySpacedContexts -\\versus -\\version -\\varcoda -\\upprall -\\upmordent -\\upbow -\\up -\\unset -\\unit -\\unfoldRepeats -\\unaCorda -\\unHideNotes -\\type -\\tweak -\\turn -\\tupletUp -\\tupletNeutral -\\tupletDown -\\trill -\\treCorde -\\transposition -\\transposedCueDuring -\\transpose -\\tiny -\\timing -\\times -\\time -\\tildeSymbol -\\tieWaitForNote -\\tieUp -\\tieSolid -\\tieNeutral -\\tieDown -\\tieDotted -\\tieDashed -\\thumb -\\textSpannerUp -\\textSpannerNeutral -\\textSpannerDown -\\textLengthOn -\\textLengthOff -\\tenuto -\\tempoWholesPerMinute -\\tempo -\\teeny -\\tag -\\tablatureFormat -\\systemStartDelimiter -\\sustainOn -\\sustainOff -\\subdivideBeams -\\stropha -\\strokeFingerOrientations -\\stringTunings -\\stringOneTopmost -\\stringNumberOrientations -\\stopped -\\stopTrillSpan -\\stopTextSpan -\\stopStaff -\\stopGroup -\\stopGraceMusic -\\stopAppoggiaturaMusic -\\stopAcciaccaturaMusic -\\stop -\\stemUp -\\stemNeutral -\\stemDown -\\startTrillSpan -\\startTextSpan -\\startStaff -\\startGroup -\\startGraceMusic -\\startAppoggiaturaMusic -\\startAcciaccaturaMusic -\\start -\\staccato -\\staccatissimo -\\squashedPosition -\\spp -\\spacingTweaks -\\sp -\\sostenutoOn -\\sostenutoOff -\\soloText -\\soloIIText -\\smaller -\\small -\\slurUp -\\slurSolid -\\slurNeutral -\\slurDown -\\slurDotted -\\slurDashed -\\skipTypesetting -\\skip -\\simultaneous -\\signumcongruentiae -\\showStaffSwitch -\\shortfermata -\\shortVocalName -\\shortInstrumentName -\\shiftOnnn -\\shiftOnn -\\shiftOn -\\shiftOff -\\shiftDurations -\\sfz -\\sfp -\\sff -\\sf -\\setDefaultDurationToQuarter -\\set -\\sequential -\\semicirculus -\\semiGermanChords -\\segno -\\scriptDefinitions -\\scoreTweak -\\score -\\scaleDurations -\\sacredHarpHeads -\\rtoe -\\rightHandFinger -\\right -\\rheel -\\rfz -\\revert -\\reverseturn -\\rest -\\responsum -\\resetRelativeOctave -\\repeatTie -\\repeatCountVisibility -\\repeat -\\removeWithTag -\\remove -\\relative -\\rehearsalMark -\\quotedEventTypes -\\quoteDuring -\\quilisma -\\pt -\\printPartCombineTexts -\\printKeyCancellation -\\predefinedFretboardsOn -\\predefinedFretboardsOff -\\predefinedDiagramTable -\\prallup -\\prallprall -\\prallmordent -\\pralldown -\\prall -\\ppppp -\\pppp -\\ppp -\\pp -\\portato -\\pointAndClickOn -\\pointAndClickOff -\\pitchedTrill -\\pipeSymbol -\\phrygian -\\phrasingSlurUp -\\phrasingSlurSolid -\\phrasingSlurNeutral -\\phrasingSlurDown -\\phrasingSlurDotted -\\phrasingSlurDashed -\\pes -\\pedalUnaCordaStyle -\\pedalUnaCordaStrings -\\pedalSustainStyle -\\pedalSustainStrings -\\pedalSostenutoStyle -\\pedalSostenutoStrings -\\partialJazzMusic -\\partialJazzExceptions -\\partial -\\partcombine -\\partCombineListener -\\parenthesize -\\parenthesisOpenSymbol -\\parenthesisCloseSymbol -\\parallelMusic -\\paper -\\pageTurn -\\pageBreak -\\p -\\overrideProperty -\\override -\\ottava -\\oriscus -\\open -\\oneVoice -\\once -\\octaveCheck -\\objectid -\\numericTimeSignature -\\notemode -\\noteToFretFunction -\\normalsize -\\noPageTurn -\\noPageBreak -\\noBreak -\\noBeam -\\newSpacingSection -\\new -\\neumeDemoLayout -\\name -\\musicMap -\\mp -\\mordent -\\mm -\\mixolydian -\\minor -\\midiInstrument -\\midi -\\middleCPosition -\\middleCClefPosition -\\mf -\\metronomeMarkFormatter -\\mergeDifferentlyHeadedOn -\\mergeDifferentlyHeadedOff -\\mergeDifferentlyDottedOn -\\mergeDifferentlyDottedOff -\\melismaEnd -\\melismaBusyProperties -\\melisma -\\maxima -\\markuplines -\\markup -\\markFormatter -\\mark -\\marcato -\\makeClusters -\\majorSevenSymbol -\\major -\\maininput -\\lyricsto -\\lyrics -\\lyricmode -\\lyricMelismaAlignment -\\lydian -\\ltoe -\\longfermata -\\longa -\\locrian -\\localKeySignature -\\lineprall -\\linea -\\ligature -\\lheel -\\left -\\layout -\\large -\\laissezVibrer -\\label -\\killCues -\\keyAlterationOrder -\\key -\\keepWithTag -\\keepAliveInterfaces -\\italianChords -\\ionian -\\interscoreline -\\instrumentTransposition -\\instrumentSwitch -\\instrumentName -\\instrumentEqualizer -\\indent -\\includePageLayoutFile -\\include -\\inclinatum -\\in -\\improvisationOn -\\improvisationOff -\\implicitTimeSignatureVisibility -\\ij -\\iij -\\ignoreFiguredBassRest -\\ignoreBarChecks -\\ignatzekExceptions -\\ignatzekExceptionMusic -\\ictus -\\huge -\\highStringOne -\\hideStaffSwitch -\\hideNotes -\\header -\\harmonicAccidentals -\\harmonic -\\grobdescriptions -\\graceSettings -\\grace -\\glissando -\\germanChords -\\fz -\\fullJazzExceptions -\\frenchChords -\\fp -\\fontSize -\\flexa -\\flageolet -\\firstClef -\\fingeringOrientations -\\finalis -\\figures -\\figuremode -\\figuredBassFormatter -\\ffff -\\fff -\\ff -\\fermataMarkup -\\fermata -\\featherDurations -\\f -\\extraNatural -\\explicitKeySignatureVisibility -\\explicitClefVisibility -\\expandFullBarRests -\\espressivo -\\escapedSmallerSymbol -\\escapedParenthesisOpenSymbol -\\escapedParenthesisCloseSymbol -\\escapedExclamationSymbol -\\escapedBiggerSymbol -\\episemInitium -\\episemFinis -\\endincipit -\\enddim -\\enddecr -\\endcresc -\\endcr -\\endSpanners -\\easyHeadsOn -\\easyHeadsOff -\\dynamicUp -\\dynamicNeutral -\\dynamicDown -\\dynamicAbsoluteVolumeFunction -\\drums -\\drummode -\\drumStyleTable -\\drumPitchTable -\\downprall -\\downmordent -\\downbow -\\down -\\doubleRepeatType -\\dotsUp -\\dotsNeutral -\\dotsDown -\\dorian -\\divisioMinima -\\divisioMaxima -\\divisioMaior -\\displayMusic -\\displayLilyMusic -\\dimTextDim -\\dimTextDecresc -\\dimTextDecr -\\dimHairpin -\\dim -\\description -\\descendens -\\denies -\\deminutum -\\defaultchild -\\defaultTimeSignature -\\defaultBarType -\\default -\\decrescendoSpanner -\\decr -\\dashUnderscore -\\dashPlus -\\dashLarger -\\dashHat -\\dashDot -\\dashDash -\\dashBar -\\cueDuring -\\crescendoSpanner -\\crescTextCresc -\\crescHairpin -\\cresc -\\createSpacing -\\cr -\\context -\\consists -\\compressFullBarRests -\\coda -\\cm -\\clefPosition -\\clefOctavation -\\clefGlyph -\\clef -\\circulus -\\chords -\\chordmodifiers -\\chordmode -\\chordRootNamer -\\chordPrefixSpacer -\\chordNoteNamer -\\chordNameSeparator -\\chordNameFunction -\\chordNameExceptionsPartial -\\chordNameExceptionsFull -\\chordNameExceptions -\\change -\\center -\\cavum -\\caesura -\\cadenzaOn -\\cadenzaOff -\\breve -\\breathe -\\break -\\bracketOpenSymbol -\\bracketCloseSymbol -\\bookpart -\\book -\\blackTriangleMarkup -\\bigger -\\bendAfter -\\bassStaffProperties -\\bassFigureStaffAlignmentUp -\\bassFigureStaffAlignmentNeutral -\\bassFigureStaffAlignmentDown -\\bassFigureExtendersOn -\\bassFigureExtendersOff -\\barNumberVisibility -\\barNumberCheck -\\barCheckSynchronize -\\barAlways -\\bar -\\balloonText -\\balloonLengthOn -\\balloonLengthOff -\\balloonGrobText -\\automaticBars -\\autochange -\\autoCautionaries -\\autoBeaming -\\autoBeamSettings -\\autoBeamOn -\\autoBeamOff -\\autoBeamCheck -\\autoAccidentals -\\augmentum -\\auctum -\\assertBeamSlope -\\assertBeamQuant -\\ascendens -\\arpeggioParenthesis -\\arpeggioNormal -\\arpeggioBracket -\\arpeggioArrowUp -\\arpeggioArrowDown -\\arpeggio -\\appoggiatura -\\applyOutput -\\applyMusic -\\applyContext -\\alternative -\\allowPageTurn -\\alias -\\aikenHeads -\\afterGraceFraction -\\afterGrace -\\aeolian -\\addlyrics -\\addQuote -\\addInstrumentDefinition -\\acciaccatura -\\accepts -\\accentus -\\accent -\\aDueText -\\RemoveEmptyStaffContext -\\RemoveEmptyRhythmicStaffContext -\\IJ -\\IIJ -\\C -\\B -\\AncientRemoveEmptyStaffContext -\\A -strings -Volta_engraver -Voice -Vertically_spaced_contexts_engraver -Vertical_align_engraver -Vaticana_ligature_engraver -VaticanaVoice -VaticanaStaff -Tweak_engraver -Tuplet_engraver -Trill_spanner_engraver -Timing_translator -Time_signature_performer -Time_signature_engraver -Tie_performer -Tie_engraver -Text_spanner_engraver -Text_engraver -Tempo_performer -Tab_staff_symbol_engraver -Tab_note_heads_engraver -Tab_harmonic_engraver -TabVoice -TabStaff -System_start_delimiter_engraver -Swallow_performer -Swallow_engraver -String_number_engraver -Stem_engraver -Stanza_number_engraver -Stanza_number_align_engraver -Staff_symbol_engraver -Staff_performer -Staff_collecting_engraver -StaffGroup -Staff -Spanner_break_forbid_engraver -Span_bar_engraver -Span_arpeggio_engraver -Spacing_engraver -Slur_performer -Slur_engraver -Slash_repeat_engraver -Skip_event_swallow_translator -Separating_line_group_engraver -Script_row_engraver -Script_engraver -Script_column_engraver -Score -Rhythmic_column_engraver -RhythmicStaff -Rest_swallow_translator -Rest_engraver -Rest_collision_engraver -Repeat_tie_engraver -Repeat_acknowledge_engraver -Pitched_trill_engraver -Pitch_squash_engraver -Piano_pedal_performer -Piano_pedal_engraver -Piano_pedal_align_engraver -PianoStaff -Phrasing_slur_engraver -Percent_repeat_engraver -Part_combine_engraver -Parenthesis_engraver -Paper_column_engraver -Output_property_engraver -Ottava_spanner_engraver -Note_swallow_translator -Note_spacing_engraver -Note_performer -Note_name_engraver -Note_heads_engraver -Note_head_line_engraver -NoteNames -New_fingering_engraver -New_dynamic_engraver -Multi_measure_rest_engraver -Metronome_mark_engraver -Mensural_ligature_engraver -MensuralVoice -MensuralStaff -Mark_engraver -Lyrics -Lyric_performer -Lyric_engraver -Ligature_bracket_engraver -Ledger_line_engraver -Laissez_vibrer_engraver -Key_performer -Key_engraver -Instrument_switch_engraver -Instrument_name_engraver -Hyphen_engraver -Hara_kiri_engraver -Grob_pq_engraver -GregorianTranscriptionVoice -GregorianTranscriptionStaff -GrandStaff -Grace_spacing_engraver -Grace_engraver -Grace_beam_engraver -Global -Glissando_engraver -Fretboard_engraver -FretBoards -Forbid_line_break_engraver -Font_size_engraver -Fingering_engraver -Figured_bass_position_engraver -Figured_bass_engraver -FiguredBass -Extender_engraver -Dynamic_performer -Dynamic_align_engraver -Drum_notes_engraver -Drum_note_performer -DrumVoice -DrumStaff -Dots_engraver -Dot_column_engraver -Devnull -Default_bar_line_engraver -Custos_engraver -CueVoice -Control_track_performer -Collision_engraver -Cluster_spanner_engraver -Clef_engraver -Chord_tremolo_engraver -Chord_name_engraver -ChordNames -ChordNameVoice -ChoirStaff -Breathing_sign_engraver -Break_align_engraver -Bend_engraver -Beam_performer -Beam_engraver -Bar_number_engraver -Bar_engraver -Axis_group_engraver -Auto_beam_engraver -Arpeggio_engraver -Accidental_engraver -vibraslap -twoup -twodown -tt -triangle -threeup -threedown -tambourine -splashcymbal -solstqt -solss -solsqt -solsd -solsb -sols -solkk -solk -soldsd -soldd -sold -solbtqt -solbsb -solbqt -solbb -solb -sol -snare -sistqt -siss -sisqt -sisd -sisb -sis -sikk -sik -sidsd -sidestick -sidd -sid -sibtqt -sibsb -sibqt -sibb -sib -si -shortwhistle -shortguiro -ridecymbalb -ridecymbala -ridecymbal -ridebell -restqt -ress -resqt -resd -resb -res -rekk -rek -redsd -redd -red -rebtqt -rebsb -rebqt -rebb -reb -re -pedalhihat -opentriangle -openloconga -openlobongo -openhihat -openhiconga -openhibongo -opencuica -oneup -onedown -mutetriangle -muteloconga -mutelobongo -mutehiconga -mutehibongo -mutecuica -mistqt -miss -misqt -misd -misb -mis -mikk -mik -midsd -midd -mid -mibtqt -mibsb -mibqt -mibb -mib -mi -maracas -lowtom -lowoodblock -lowmidtom -lowfloortom -lotimbale -losidestick -longwhistle -longguiro -loconga -lobongo -loagogo -lastqt -lass -lasqt -lasd -lasb -las -lakk -lak -ladsd -ladd -lad -labtqt -labsb -labqt -labb -lab -la -hiwoodblock -hitimbale -hississ -hiss -hisis -hisih -hisidestick -his -himidtom -hihat -hih -hightom -highfloortom -hiconga -hibongo -hiagogo -hessess -heses -heseh -handclap -halfopenhihat -h -gx -guiro -gtqs -gtqf -gss -gsharpsharp -gsharp -gs -gqs -gqf -gississ -giss -gisis -gisih -gis -gih -gflatflat -gflat -gff -gf -gessess -gess -geses -geseh -ges -geh -g -fx -ftqs -ftqf -fss -fsharpsharp -fsharp -fs -fqs -fqf -fourup -fourdown -fiveup -fivedown -fississ -fiss -fisis -fisih -fis -fih -fflatflat -fflat -fff -ff -fessess -fess -feses -feseh -fes -feh -fastqt -fass -fasqt -fasd -fasb -fas -fakk -fak -fadsd -fadd -fad -fabtqt -fabsb -fabqt -fabb -fab -fa -f -ex -etqs -etqf -essess -ess -esharpsharp -esharp -eses -eseh -es -eqs -eqf -electricsnare -eississ -eiss -eisis -eisih -eis -eih -eflatflat -eflat -eff -ef -eessess -eess -eeses -eeseh -ees -eeh -e -dx -dtqs -dtqf -dss -dsharpsharp -dsharp -ds -dqs -dqf -dostqt -doss -dosqt -dosd -dosb -dos -dokk -dok -dodsd -dodd -dod -dobtqt -dobsb -dobqt -dobb -dob -do -dississ -diss -disis -disih -dis -dih -dflatflat -dflat -dff -df -dessess -dess -deses -deseh -des -deh -d -cx -ctqs -ctqf -css -csharpsharp -csharp -cs -crashcymbalb -crashcymbala -crashcymbal -cqs -cqf -cowbell -closedhihat -claves -cississ -ciss -cisis -cisih -cis -cih -chinesecymbal -cflatflat -cflat -cff -cf -cessess -cess -ceses -ceseh -ces -ceh -cabasa -c -bx -btqs -btqf -bss -bsharpsharp -bsharp -bs -bqs -bqf -bisis -bisih -bis -bih -bflatflat -bflat -bff -bf -bess -beses -beseh -bes -beh -bb -bassdrum -b -ax -atqs -atqf -assess -ass -asharpsharp -asharp -ases -aseh -asas -asah -as -aqs -aqf -aississ -aiss -aisis -aisih -ais -aih -aflatflat -aflat -aff -af -aessess -aess -aeses -aeseh -aes -aeh -acousticsnare -a diff --git a/.vim/syntax/lilypond-words.vim b/.vim/syntax/lilypond-words.vim deleted file mode 100644 index cd4eb57..0000000 --- a/.vim/syntax/lilypond-words.vim +++ /dev/null @@ -1,3 +0,0 @@ -syn match lilyKeyword "[-_^]\?\\\(withMusicProperty\|with\|whiteTriangleMarkup\|voiceTwoStyle\|voiceTwo\|voiceThreeStyle\|voiceThree\|voiceOneStyle\|voiceOne\|voiceNeutralStyle\|voiceFourStyle\|voiceFour\|vocalName\|virgula\|virga\|verylongfermata\|verticallySpacedContexts\|versus\|version\|varcoda\|upprall\|upmordent\|upbow\|up\|unset\|unit\|unfoldRepeats\|unaCorda\|unHideNotes\|type\|tweak\|turn\|tupletUp\|tupletNeutral\|tupletDown\|trill\|treCorde\|transposition\|transposedCueDuring\|transpose\|tiny\|timing\|times\|time\|tildeSymbol\|tieWaitForNote\|tieUp\|tieSolid\|tieNeutral\|tieDown\|tieDotted\|tieDashed\|thumb\|textSpannerUp\|textSpannerNeutral\|textSpannerDown\|textLengthOn\|textLengthOff\|tenuto\|tempoWholesPerMinute\|tempo\|teeny\|tag\|tablatureFormat\|systemStartDelimiter\|sustainOn\|sustainOff\|subdivideBeams\|stropha\|strokeFingerOrientations\|stringTunings\|stringOneTopmost\|stringNumberOrientations\|stopped\|stopTrillSpan\|stopTextSpan\|stopStaff\|stopGroup\|stopGraceMusic\|stopAppoggiaturaMusic\|stopAcciaccaturaMusic\|stop\|stemUp\|stemNeutral\|stemDown\|startTrillSpan\|startTextSpan\|startStaff\|startGroup\|startGraceMusic\|startAppoggiaturaMusic\|startAcciaccaturaMusic\|start\|staccato\|staccatissimo\|squashedPosition\|spp\|spacingTweaks\|sp\|sostenutoOn\|sostenutoOff\|soloText\|soloIIText\|smaller\|small\|slurUp\|slurSolid\|slurNeutral\|slurDown\|slurDotted\|slurDashed\|skipTypesetting\|skip\|simultaneous\|signumcongruentiae\|showStaffSwitch\|shortfermata\|shortVocalName\|shortInstrumentName\|shiftOnnn\|shiftOnn\|shiftOn\|shiftOff\|shiftDurations\|sfz\|sfp\|sff\|sf\|setDefaultDurationToQuarter\|set\|sequential\|semicirculus\|semiGermanChords\|segno\|scriptDefinitions\|scoreTweak\|score\|scaleDurations\|sacredHarpHeads\|rtoe\|rightHandFinger\|right\|rheel\|rfz\|revert\|reverseturn\|rest\|responsum\|resetRelativeOctave\|repeatTie\|repeatCountVisibility\|repeat\|removeWithTag\|remove\|relative\|rehearsalMark\|quotedEventTypes\|quoteDuring\|quilisma\|pt\|printPartCombineTexts\|printKeyCancellation\|predefinedFretboardsOn\|predefinedFretboardsOff\|predefinedDiagramTable\|prallup\|prallprall\|prallmordent\|pralldown\|prall\|ppppp\|pppp\|ppp\|pp\|portato\|pointAndClickOn\|pointAndClickOff\|pitchedTrill\|pipeSymbol\|phrygian\|phrasingSlurUp\|phrasingSlurSolid\|phrasingSlurNeutral\|phrasingSlurDown\|phrasingSlurDotted\|phrasingSlurDashed\|pes\|pedalUnaCordaStyle\|pedalUnaCordaStrings\|pedalSustainStyle\|pedalSustainStrings\|pedalSostenutoStyle\|pedalSostenutoStrings\|partialJazzMusic\|partialJazzExceptions\|partial\|partcombine\|partCombineListener\|parenthesize\|parenthesisOpenSymbol\|parenthesisCloseSymbol\|parallelMusic\|paper\|pageTurn\|pageBreak\|p\|overrideProperty\|override\|ottava\|oriscus\|open\|oneVoice\|once\|octaveCheck\|objectid\|numericTimeSignature\|notemode\|noteToFretFunction\|normalsize\|noPageTurn\|noPageBreak\|noBreak\|noBeam\|newSpacingSection\|new\|neumeDemoLayout\|name\|musicMap\|mp\|mordent\|mm\|mixolydian\|minor\|midiInstrument\|midi\|middleCPosition\|middleCClefPosition\|mf\|metronomeMarkFormatter\|mergeDifferentlyHeadedOn\|mergeDifferentlyHeadedOff\|mergeDifferentlyDottedOn\|mergeDifferentlyDottedOff\|melismaEnd\|melismaBusyProperties\|melisma\|maxima\|markuplines\|markup\|markFormatter\|mark\|marcato\|makeClusters\|majorSevenSymbol\|major\|maininput\|lyricsto\|lyrics\|lyricmode\|lyricMelismaAlignment\|lydian\|ltoe\|longfermata\|longa\|locrian\|localKeySignature\|lineprall\|linea\|ligature\|lheel\|left\|layout\|large\|laissezVibrer\|label\|killCues\|keyAlterationOrder\|key\|keepWithTag\|keepAliveInterfaces\|italianChords\|ionian\|interscoreline\|instrumentTransposition\|instrumentSwitch\|instrumentName\|instrumentEqualizer\|indent\|includePageLayoutFile\|include\|inclinatum\|in\|improvisationOn\|improvisationOff\|implicitTimeSignatureVisibility\|ij\|iij\|ignoreFiguredBassRest\|ignoreBarChecks\|ignatzekExceptions\|ignatzekExceptionMusic\|ictus\|huge\|highStringOne\|hideStaffSwitch\|hideNotes\|header\|harmonicAccidentals\|harmonic\|grobdescriptions\|graceSettings\|grace\|glissando\|germanChords\|fz\|fullJazzExceptions\|frenchChords\|fp\|fontSize\|flexa\|flageolet\|firstClef\|fingeringOrientations\|finalis\|figures\|figuremode\|figuredBassFormatter\|ffff\|fff\|ff\|fermataMarkup\|fermata\|featherDurations\|f\|extraNatural\|explicitKeySignatureVisibility\|explicitClefVisibility\|expandFullBarRests\|espressivo\|escapedSmallerSymbol\|escapedParenthesisOpenSymbol\|escapedParenthesisCloseSymbol\|escapedExclamationSymbol\|escapedBiggerSymbol\|episemInitium\|episemFinis\|endincipit\|enddim\|enddecr\|endcresc\|endcr\|endSpanners\|easyHeadsOn\|easyHeadsOff\|dynamicUp\|dynamicNeutral\|dynamicDown\|dynamicAbsoluteVolumeFunction\|drums\|drummode\|drumStyleTable\|drumPitchTable\|downprall\|downmordent\|downbow\|down\|doubleRepeatType\|dotsUp\|dotsNeutral\|dotsDown\|dorian\|divisioMinima\|divisioMaxima\|divisioMaior\|displayMusic\|displayLilyMusic\|dimTextDim\|dimTextDecresc\|dimTextDecr\|dimHairpin\|dim\|description\|descendens\|denies\|deminutum\|defaultchild\|defaultTimeSignature\|defaultBarType\|default\|decrescendoSpanner\|decr\|dashUnderscore\|dashPlus\|dashLarger\|dashHat\|dashDot\|dashDash\|dashBar\|cueDuring\|crescendoSpanner\|crescTextCresc\|crescHairpin\|cresc\|createSpacing\|cr\|context\|consists\|compressFullBarRests\|coda\|cm\|clefPosition\|clefOctavation\|clefGlyph\|clef\|circulus\|chords\|chordmodifiers\|chordmode\|chordRootNamer\|chordPrefixSpacer\|chordNoteNamer\|chordNameSeparator\|chordNameFunction\|chordNameExceptionsPartial\|chordNameExceptionsFull\|chordNameExceptions\|change\|center\|cavum\|caesura\|cadenzaOn\|cadenzaOff\|breve\|breathe\|break\|bracketOpenSymbol\|bracketCloseSymbol\|bookpart\|book\|blackTriangleMarkup\|bigger\|bendAfter\|bassStaffProperties\|bassFigureStaffAlignmentUp\|bassFigureStaffAlignmentNeutral\|bassFigureStaffAlignmentDown\|bassFigureExtendersOn\|bassFigureExtendersOff\|barNumberVisibility\|barNumberCheck\|barCheckSynchronize\|barAlways\|bar\|balloonText\|balloonLengthOn\|balloonLengthOff\|balloonGrobText\|automaticBars\|autochange\|autoCautionaries\|autoBeaming\|autoBeamSettings\|autoBeamOn\|autoBeamOff\|autoBeamCheck\|autoAccidentals\|augmentum\|auctum\|assertBeamSlope\|assertBeamQuant\|ascendens\|arpeggioParenthesis\|arpeggioNormal\|arpeggioBracket\|arpeggioArrowUp\|arpeggioArrowDown\|arpeggio\|appoggiatura\|applyOutput\|applyMusic\|applyContext\|alternative\|allowPageTurn\|alias\|aikenHeads\|afterGraceFraction\|afterGrace\|aeolian\|addlyrics\|addQuote\|addInstrumentDefinition\|acciaccatura\|accepts\|accentus\|accent\|aDueText\|RemoveEmptyStaffContext\|RemoveEmptyRhythmicStaffContext\|IJ\|IIJ\|C\|B\|AncientRemoveEmptyStaffContext\|A\|n\)\(\A\|\n\)"me=e-1 -syn match lilyReservedWord "\(\A\|\n\)\(strings\|Volta_engraver\|Voice\|Vertically_spaced_contexts_engraver\|Vertical_align_engraver\|Vaticana_ligature_engraver\|VaticanaVoice\|VaticanaStaff\|Tweak_engraver\|Tuplet_engraver\|Trill_spanner_engraver\|Timing_translator\|Time_signature_performer\|Time_signature_engraver\|Tie_performer\|Tie_engraver\|Text_spanner_engraver\|Text_engraver\|Tempo_performer\|Tab_staff_symbol_engraver\|Tab_note_heads_engraver\|Tab_harmonic_engraver\|TabVoice\|TabStaff\|System_start_delimiter_engraver\|Swallow_performer\|Swallow_engraver\|String_number_engraver\|Stem_engraver\|Stanza_number_engraver\|Stanza_number_align_engraver\|Staff_symbol_engraver\|Staff_performer\|Staff_collecting_engraver\|StaffGroup\|Staff\|Spanner_break_forbid_engraver\|Span_bar_engraver\|Span_arpeggio_engraver\|Spacing_engraver\|Slur_performer\|Slur_engraver\|Slash_repeat_engraver\|Skip_event_swallow_translator\|Separating_line_group_engraver\|Script_row_engraver\|Script_engraver\|Script_column_engraver\|Score\|Rhythmic_column_engraver\|RhythmicStaff\|Rest_swallow_translator\|Rest_engraver\|Rest_collision_engraver\|Repeat_tie_engraver\|Repeat_acknowledge_engraver\|Pitched_trill_engraver\|Pitch_squash_engraver\|Piano_pedal_performer\|Piano_pedal_engraver\|Piano_pedal_align_engraver\|PianoStaff\|Phrasing_slur_engraver\|Percent_repeat_engraver\|Part_combine_engraver\|Parenthesis_engraver\|Paper_column_engraver\|Output_property_engraver\|Ottava_spanner_engraver\|Note_swallow_translator\|Note_spacing_engraver\|Note_performer\|Note_name_engraver\|Note_heads_engraver\|Note_head_line_engraver\|NoteNames\|New_fingering_engraver\|New_dynamic_engraver\|Multi_measure_rest_engraver\|Metronome_mark_engraver\|Mensural_ligature_engraver\|MensuralVoice\|MensuralStaff\|Mark_engraver\|Lyrics\|Lyric_performer\|Lyric_engraver\|Ligature_bracket_engraver\|Ledger_line_engraver\|Laissez_vibrer_engraver\|Key_performer\|Key_engraver\|Instrument_switch_engraver\|Instrument_name_engraver\|Hyphen_engraver\|Hara_kiri_engraver\|Grob_pq_engraver\|GregorianTranscriptionVoice\|GregorianTranscriptionStaff\|GrandStaff\|Grace_spacing_engraver\|Grace_engraver\|Grace_beam_engraver\|Global\|Glissando_engraver\|Fretboard_engraver\|FretBoards\|Forbid_line_break_engraver\|Font_size_engraver\|Fingering_engraver\|Figured_bass_position_engraver\|Figured_bass_engraver\|FiguredBass\|Extender_engraver\|Dynamic_performer\|Dynamic_align_engraver\|Drum_notes_engraver\|Drum_note_performer\|DrumVoice\|DrumStaff\|Dots_engraver\|Dot_column_engraver\|Devnull\|Default_bar_line_engraver\|Custos_engraver\|CueVoice\|Control_track_performer\|Collision_engraver\|Cluster_spanner_engraver\|Clef_engraver\|Chord_tremolo_engraver\|Chord_name_engraver\|ChordNames\|ChordNameVoice\|ChoirStaff\|Breathing_sign_engraver\|Break_align_engraver\|Bend_engraver\|Beam_performer\|Beam_engraver\|Bar_number_engraver\|Bar_engraver\|Axis_group_engraver\|Auto_beam_engraver\|Arpeggio_engraver\|Accidental_engraver\|Score\)\(\A\|\n\)"ms=s+1,me=e-1 -syn match lilyNote "\<\(\(\(vibraslap\|twoup\|twodown\|tt\|triangle\|threeup\|threedown\|tambourine\|splashcymbal\|solstqt\|solss\|solsqt\|solsd\|solsb\|sols\|solkk\|solk\|soldsd\|soldd\|sold\|solbtqt\|solbsb\|solbqt\|solbb\|solb\|sol\|snare\|sistqt\|siss\|sisqt\|sisd\|sisb\|sis\|sikk\|sik\|sidsd\|sidestick\|sidd\|sid\|sibtqt\|sibsb\|sibqt\|sibb\|sib\|si\|shortwhistle\|shortguiro\|ridecymbalb\|ridecymbala\|ridecymbal\|ridebell\|restqt\|ress\|resqt\|resd\|resb\|res\|rekk\|rek\|redsd\|redd\|red\|rebtqt\|rebsb\|rebqt\|rebb\|reb\|re\|pedalhihat\|opentriangle\|openloconga\|openlobongo\|openhihat\|openhiconga\|openhibongo\|opencuica\|oneup\|onedown\|mutetriangle\|muteloconga\|mutelobongo\|mutehiconga\|mutehibongo\|mutecuica\|mistqt\|miss\|misqt\|misd\|misb\|mis\|mikk\|mik\|midsd\|midd\|mid\|mibtqt\|mibsb\|mibqt\|mibb\|mib\|mi\|maracas\|lowtom\|lowoodblock\|lowmidtom\|lowfloortom\|lotimbale\|losidestick\|longwhistle\|longguiro\|loconga\|lobongo\|loagogo\|lastqt\|lass\|lasqt\|lasd\|lasb\|las\|lakk\|lak\|ladsd\|ladd\|lad\|labtqt\|labsb\|labqt\|labb\|lab\|la\|hiwoodblock\|hitimbale\|hississ\|hiss\|hisis\|hisih\|hisidestick\|his\|himidtom\|hihat\|hih\|hightom\|highfloortom\|hiconga\|hibongo\|hiagogo\|hessess\|heses\|heseh\|handclap\|halfopenhihat\|h\|gx\|guiro\|gtqs\|gtqf\|gss\|gsharpsharp\|gsharp\|gs\|gqs\|gqf\|gississ\|giss\|gisis\|gisih\|gis\|gih\|gflatflat\|gflat\|gff\|gf\|gessess\|gess\|geses\|geseh\|ges\|geh\|g\|fx\|ftqs\|ftqf\|fss\|fsharpsharp\|fsharp\|fs\|fqs\|fqf\|fourup\|fourdown\|fiveup\|fivedown\|fississ\|fiss\|fisis\|fisih\|fis\|fih\|fflatflat\|fflat\|fff\|ff\|fessess\|fess\|feses\|feseh\|fes\|feh\|fastqt\|fass\|fasqt\|fasd\|fasb\|fas\|fakk\|fak\|fadsd\|fadd\|fad\|fabtqt\|fabsb\|fabqt\|fabb\|fab\|fa\|f\|ex\|etqs\|etqf\|essess\|ess\|esharpsharp\|esharp\|eses\|eseh\|es\|eqs\|eqf\|electricsnare\|eississ\|eiss\|eisis\|eisih\|eis\|eih\|eflatflat\|eflat\|eff\|ef\|eessess\|eess\|eeses\|eeseh\|ees\|eeh\|e\|dx\|dtqs\|dtqf\|dss\|dsharpsharp\|dsharp\|ds\|dqs\|dqf\|dostqt\|doss\|dosqt\|dosd\|dosb\|dos\|dokk\|dok\|dodsd\|dodd\|dod\|dobtqt\|dobsb\|dobqt\|dobb\|dob\|do\|dississ\|diss\|disis\|disih\|dis\|dih\|dflatflat\|dflat\|dff\|df\|dessess\|dess\|deses\|deseh\|des\|deh\|d\|cx\|ctqs\|ctqf\|css\|csharpsharp\|csharp\|cs\|crashcymbalb\|crashcymbala\|crashcymbal\|cqs\|cqf\|cowbell\|closedhihat\|claves\|cississ\|ciss\|cisis\|cisih\|cis\|cih\|chinesecymbal\|cflatflat\|cflat\|cff\|cf\|cessess\|cess\|ceses\|ceseh\|ces\|ceh\|cabasa\|c\|bx\|btqs\|btqf\|bss\|bsharpsharp\|bsharp\|bs\|bqs\|bqf\|bisis\|bisih\|bis\|bih\|bflatflat\|bflat\|bff\|bf\|bess\|beses\|beseh\|bes\|beh\|bb\|bassdrum\|b\|ax\|atqs\|atqf\|assess\|ass\|asharpsharp\|asharp\|ases\|aseh\|asas\|asah\|as\|aqs\|aqf\|aississ\|aiss\|aisis\|aisih\|ais\|aih\|aflatflat\|aflat\|aff\|af\|aessess\|aess\|aeses\|aeseh\|aes\|aeh\|acousticsnare\|a\|a\)\([,']\)\{,4}\([?!]\)\?\)\|s\|r\)\(\(128\|64\|32\|16\|8\|4\|2\|1\|\\breve\|\\longa\|\\maxima\)[.]\{,8}\)\?\(\A\|\n\)"me=e-1 diff --git a/.vim/syntax/lilypond.vim b/.vim/syntax/lilypond.vim deleted file mode 100644 index 7d0a6d8..0000000 --- a/.vim/syntax/lilypond.vim +++ /dev/null @@ -1,83 +0,0 @@ -" LilyPond syntax file -" Language: LilyPond -" Maintainer: Heikki Junes <hjunes@cc.hut.fi> -" Created: Oct 17, 2002 -" Last Change: Sep 23, 2003 -" Version: 6.1-1 -" -" Installed As: vim/syntax/lilypond.vim -" Uses Generated File: vim/syntax/lilypond-words.vim -" -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -" Read the LilyPond syntax match groups: -" lilyKeyword, lilyReservedWord, lilyNote -if version < 600 - so <sfile>:p:h/lilypond-words.vim -else - runtime! syntax/lilypond-words.vim - if exists("b:current_syntax") - unlet b:current_syntax - endif -endif - -" Match also parethesis of angle type -setlocal mps+=<:> - -" Case matters -syn case match - -syn cluster lilyMatchGroup contains=lilyMatcher,lilyString,lilyComment,lilyStatement,lilyNumber,lilyEquation,lilySlur,lilySpecial,lilyNote,lilyKeyword,lilyArticulation,lilyReservedWord - -syn region lilyMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[<>]" end="}" contains=@lilyMatchGroup fold -syn region lilyMatcher matchgroup=Delimiter start="\[" end="]" contains=@lilyMatchGroup fold -syn region lilyMatcher matchgroup=Delimiter start="<" skip="\\\\\|\\[{<>}]" end=">" contains=@lilyMatchGroup fold - -syn region lilyString start=/"/ end=/"/ skip=/\\"/ -syn region lilyComment start="%{" skip="%$" end="%}" -syn region lilyComment start="%\([^{]\|$\)" end="$" - -syn match lilyNumber "[-_^.]\?\d\+[.]\?" -syn match lilyEquation "\(#['`]\)\?\(\a*[-]\)*\a*\s*=\s*\(#[#'`]\?\)\?\a*" -syn match lilySlur "[(~)]" -syn match lilySlur "\\[()]" -syn match lilySpecial "\\[<!>\\]" -" avoid highlighting the extra character in situations like -" c--\mf c^^\mf c__\mf -syn match lilyArticulation "[-_^][-_^+|>.]" - -" Rest of syntax highlighting rules start here -" -" " Define the default highlighting. -" " For version 5.7 and earlier: only when not done already -" " For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_lily_syn_inits") - if version < 508 - let did_lily_syn_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi def link <args> - endif - - HiLink Delimiter Identifier - - HiLink lilyString String - HiLink lilyComment Comment - - HiLink lilyNote Identifier - HiLink lilyArticulation PreProc - HiLink lilyKeyword Keyword - HiLink lilyReservedWord Type - - HiLink lilyNumber Constant - HiLink lilySpecial Special - HiLink lilySlur ModeMsg - - delcommand HiLink -endif diff --git a/.vim/syntax/mako.vim b/.vim/syntax/mako.vim deleted file mode 100644 index a9244a2..0000000 --- a/.vim/syntax/mako.vim +++ /dev/null @@ -1,83 +0,0 @@ -" Vim syntax file -" Language: Mako -" Maintainer: Armin Ronacher <armin.ronacher@active-4.com> -" URL: http://lucumr.pocoo.org/ -" Last Change: 2007 April 8 -" Version: 0.6 -" -" Known Limitations -" the <%text> block does not have correct attributes - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -if !exists("main_syntax") - let main_syntax = "html" -endif - -"Source the html syntax file -ru! syntax/html.vim -unlet b:current_syntax - -"Put the python syntax file in @pythonTop -syn include @pythonTop syntax/python.vim - -" End keywords -syn keyword makoEnd contained endfor endwhile endif endtry enddef - -" Block rules -syn region makoLine matchgroup=makoDelim start=#%\s*# end=#$# keepend contains=@pythonTop,makoEnd -syn region makoBlock matchgroup=makoDelim start=#<%!\?# end=#%># keepend contains=@pythonTop,makoEnd - -" Variables -syn region makoNested start="{" end="}" transparent display contained contains=makoNested,@pythonTop -syn region makoVariable matchgroup=makoDelim start=#\${# end=#}# contains=makoNested,@pythonTop - -" Comments -syn region makoComment start="##" end="$" -syn region makoDocComment matchgroup=makoDelim start="<%doc>" end="</%doc>" keepend - -" Literal Blocks -syn region makoText matchgroup=makoDelim start="<%text[^>]*>" end="</%text>" - -" Attribute Sublexing -syn match makoAttributeKey containedin=makoTag contained "[a-zA-Z_][a-zA-Z0-9_]*=" -syn region makoAttributeValue containedin=makoTag contained start=/"/ skip=/\\"/ end=/"/ -syn region makoAttributeValue containedin=MakoTag contained start=/'/ skip=/\\'/ end=/'/ - -" Tags -syn region makoTag matchgroup=makoDelim start="<%\(def\|call\|page\|include\|namespace\|inherit\)\>\s*" end="/\?>" -syn match makoDelim "</%\(def\|call\)>" - -" Newline Escapes -syn match makoEscape /\\$/ - -" Default highlighting links -if version >= 508 || !exists("did_mako_syn_inits") - if version < 508 - let did_mako_syn_inits = 1 - com -nargs=+ HiLink hi link <args> - else - com -nargs=+ HiLink hi def link <args> - endif - - HiLink makoDocComment makoComment - HiLink makoDefEnd makoDelim - - HiLink makoAttributeKey Type - HiLink makoAttributeValue String - HiLink makoText Normal - HiLink makoDelim Preproc - HiLink makoEnd Keyword - HiLink makoComment Comment - HiLink makoEscape Special - - delc HiLink -endif - -let b:current_syntax = "mako" diff --git a/.vim/syntax/mediawiki.vim b/.vim/syntax/mediawiki.vim deleted file mode 100644 index 339993e..0000000 --- a/.vim/syntax/mediawiki.vim +++ /dev/null @@ -1,304 +0,0 @@ -" Taken from http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#Vim - -" Wikipedia syntax file for Vim -" Published on Wikipedia in 2003-04 and declared authorless. -" -" Based on the HTML syntax file. Probably too closely based, in fact. There -" may well be name collisions everywhere, but ignorance is bliss, so they say. -" -" To do: plug-in support for downloading and uploading to the server. - -if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish -endif - let main_syntax = 'html' -endif - -if version < 508 - command! -nargs=+ HtmlHiLink hi link <args> -else - command! -nargs=+ HtmlHiLink hi def link <args> -endif - -syn case ignore -if v:version >= 700 - syn spell toplevel -endif - -" tags -syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar -syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar -syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 -syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN - -syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlBadArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster - -syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,htmlBadTag,@htmlTagNameCluster -syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,htmlBadTag,@htmlTagNameCluster -syn match htmlTagError contained "[^>]<"ms=s+1 -" This would highlight all tags and <whatevertext> fragments that are not allowed. -"syn match htmlBadTag contained +<\s*[-a-zA-Z0-9]\++ms=s+1 -" Highlight only known disallowed HTML tags, so that not every "<whatevertext>" -" fragment is flagged. -syn keyword htmlBadTag contained a acronym address applet area base basefont bdo body button col colgroup dfn dir fieldset form frame frameset head html iframe img input isindex kbd label legend link map menu meta noframes noscript object optgroup option param q script select style tbody textarea tfoot thead title -syn match htmlBadArg contained "\s\+[-a-zA-Z0-9]\+\s*="ms=s+1,me=e-1 - -" allowed HTML tag names -syn keyword htmlTagName contained b big blockquote br caption center cite code dd del div dl dt em font h1 h2 h3 h4 h5 h6 hr i ins li ol p pre rb rp rt ruby s small span strike strong sub sup table td th tr tt u ul var -" allowed Wiki tag names -syn keyword htmlTagName contained nowiki math references - -" allowed arg names -syn keyword htmlArg contained title align lang dir width height nowrap -syn keyword htmlArg contained bgcolor clear noshade -syn keyword htmlArg contained cite datetime size face color -syn keyword htmlArg contained type start value compact -syn keyword htmlArg contained summary border frame rules -syn keyword htmlArg contained cellspacing cellpadding valign char -syn keyword htmlArg contained charoff colgroup col span abbr axis -syn keyword htmlArg contained headers scope rowspan colspan -syn keyword htmlArg contained id class name style - -" special characters -syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" - -" comments -syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError -syn match htmlCommentError contained "[^><!]" -syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc -syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+ - -" HTML formatting -syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlComment,htmlLink - -syn region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic -syn region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic -syn region htmlBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic -syn region htmlBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlBoldItalicUnderline -syn region htmlBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlBoldItalicUnderline -syn region htmlBoldUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop -syn region htmlBoldUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop -syn region htmlBoldItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic - -syn region htmlUnderline start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic -syn region htmlUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlUnderlineBoldItalic -syn region htmlUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlUnderlineBoldItalic -syn region htmlUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmUnderlineItalicBold -syn region htmlUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmUnderlineItalicBold -syn region htmlUnderlineItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop -syn region htmlUnderlineItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop -syn region htmlUnderlineBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop -syn region htmlUnderlineBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop - -syn region htmlItalic start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline -syn region htmlItalic start="<em\>" end="</em>"me=e-5 contains=@htmlTop -syn region htmlItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlItalicBoldUnderline -syn region htmlItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlItalicBoldUnderline -syn region htmlItalicBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop -syn region htmlItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlItalicUnderlineBold -syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop -syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop - -syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop -syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop -syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop -syn region htmlH4 start="<h4\>" end="</h4>"me=e-5 contains=@htmlTop -syn region htmlH5 start="<h5\>" end="</h5>"me=e-5 contains=@htmlTop -syn region htmlH6 start="<h6\>" end="</h6>"me=e-5 contains=@htmlTop -syn region htmlHead start="<head\>" end="</head>"me=e-7 end="<body\>"me=e-5 end="<h[1-6]\>"me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,cssStyle -syn region htmlTitle start="<title\>" end=""me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment - -" No htmlTop and wikiPre inside HTML preformatted areas, because Wikipedia -" renders everything in there literally (HTML tags and entities, too): -"
 tags work as the combination of  and the standard HTML 
-"   tag: the content will preformatted, and it will not be parsed, but shown as
-"   in the wikitext source.
-" With wikiPre, indented lines would be rendered differently from unindented
-" lines.
-syn match htmlPreTag /
/ contains=htmlTag
-syn match wikiNowikiTag // contains=htmlTag
-syn match wikiNowikiEndTag /<\/nowiki>/ contains=htmlEndTag
-" Note: Cannot use 'start="
"rs=e', so still have the 
 tag highlighted
-" correctly via separate syn-match. Unfortunately, this will also highlight
-" 
 tags inside the preformatted region. 
-syn region htmlPre start="
" end="
"me=e-6 contains=htmlPreTag -syn region wikiNowiki start="" end=""me=e-9 contains=wikiNowikiTag - -" wiki formatting -syn region wikiItalic start=+'\@.*" contains=@Spell,wikiLink,wikiItalicBold,wikiNowiki,wikiNowikiEndTag -syn region wikiBold start=+'''+ end=+'''+ skip=".*" contains=@Spell,wikiLink,wikiBoldItalic,wikiNowiki,wikiNowikiEndTag -syn region wikiBoldAndItalic start=+'''''+ end=+'''''+ skip=".*" contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag - -syn region wikiBoldItalic contained start=+'\@.*" contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag -syn region wikiItalicBold contained start=+'''+ end=+'''+ skip=".*" contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag - -syn region wikiH1 start="^=" end="=" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag -syn region wikiH2 start="^==" end="==" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag -syn region wikiH3 start="^===" end="===" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag -syn region wikiH4 start="^====" end="====" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag -syn region wikiH5 start="^=====" end="=====" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag -syn region wikiH6 start="^======" end="======" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag -syn region wikiLink start="\[\[" end="\]\]\(s\|'s\|es\|ing\|\)" skip=".*" oneline contains=wikiLink,wikiNowiki,wikiNowikiEndTag -syn region wikiLink start="\[http:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag -syn region wikiLink start="\[https:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag -syn region wikiLink start="\[ftp:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag -syn region wikiLink start="\[gopher:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag -syn region wikiLink start="\[news:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag -syn region wikiLink start="\[mailto:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag -syn region wikiTemplate start="{{" end="}}" skip=".*" contains=wikiNowiki,wikiNowikiEndTag - -syn match wikiParaFormatChar /^[\:|\*|;|#]\+/ -syn match wikiParaFormatChar /^-----*/ -syn match wikiPre /^\ .*$/ contains=wikiNowiki,wikiNowikiEndTag - -syn include @TeX syntax/tex.vim -syntax region wikiTeX matchgroup=htmlTag start="" end="" skip=".*" contains=@TeX,wikiNowiki,wikiNowikiEndTag -syntax region wikiRef matchgroup=htmlTag start="" end="" skip=".*" contains=wikiNowiki,wikiNowikiEndTag - - -" HTML highlighting - -HtmlHiLink htmlTag Function -HtmlHiLink htmlEndTag Identifier -HtmlHiLink htmlArg Type -HtmlHiLink htmlTagName htmlStatement -HtmlHiLink htmlSpecialTagName Exception -HtmlHiLink htmlValue String -HtmlHiLink htmlSpecialChar Special - -HtmlHiLink htmlH1 Title -HtmlHiLink htmlH2 htmlH1 -HtmlHiLink htmlH3 htmlH2 -HtmlHiLink htmlH4 htmlH3 -HtmlHiLink htmlH5 htmlH4 -HtmlHiLink htmlH6 htmlH5 -HtmlHiLink htmlHead PreProc -HtmlHiLink htmlTitle Title -HtmlHiLink htmlBoldItalicUnderline htmlBoldUnderlineItalic -HtmlHiLink htmlUnderlineBold htmlBoldUnderline -HtmlHiLink htmlUnderlineItalicBold htmlBoldUnderlineItalic -HtmlHiLink htmlUnderlineBoldItalic htmlBoldUnderlineItalic -HtmlHiLink htmlItalicUnderline htmlUnderlineItalic -HtmlHiLink htmlItalicBold htmlBoldItalic -HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic -HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic - -HtmlHiLink htmlSpecial Special -HtmlHiLink htmlSpecialChar Special -HtmlHiLink htmlString String -HtmlHiLink htmlStatement Statement -HtmlHiLink htmlComment Comment -HtmlHiLink htmlCommentPart Comment -HtmlHiLink htmlValue String -HtmlHiLink htmlCommentError htmlError -HtmlHiLink htmlTagError htmlError -HtmlHiLink htmlBadTag htmlError -HtmlHiLink htmlBadArg htmlError -HtmlHiLink htmlEvent javaScript -HtmlHiLink htmlError Error - -HtmlHiLink htmlCssStyleComment Comment -HtmlHiLink htmlCssDefinition Special - -" The default highlighting. -if version >= 508 || !exists("did_html_syn_inits") - if version < 508 - let did_html_syn_inits = 1 - endif - HtmlHiLink htmlTag Function - HtmlHiLink htmlEndTag Identifier - HtmlHiLink htmlArg Type - HtmlHiLink htmlTagName htmlStatement - HtmlHiLink htmlSpecialTagName Exception - HtmlHiLink htmlValue String - HtmlHiLink htmlSpecialChar Special - -if !exists("html_no_rendering") - HtmlHiLink htmlH1 Title - HtmlHiLink htmlH2 htmlH1 - HtmlHiLink htmlH3 htmlH2 - HtmlHiLink htmlH4 htmlH3 - HtmlHiLink htmlH5 htmlH4 - HtmlHiLink htmlH6 htmlH5 - HtmlHiLink htmlHead PreProc - HtmlHiLink htmlTitle Title - HtmlHiLink htmlBoldItalicUnderline htmlBoldUnderlineItalic - HtmlHiLink htmlUnderlineBold htmlBoldUnderline - HtmlHiLink htmlUnderlineItalicBold htmlBoldUnderlineItalic - HtmlHiLink htmlUnderlineBoldItalic htmlBoldUnderlineItalic - HtmlHiLink htmlItalicUnderline htmlUnderlineItalic - HtmlHiLink htmlItalicBold htmlBoldItalic - HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic - HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic - HtmlHiLink htmlLink Underlined - if !exists("html_my_rendering") - hi def htmlBold term=bold cterm=bold gui=bold - hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline - hi def htmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic - hi def htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline - hi def htmlUnderline term=underline cterm=underline gui=underline - hi def htmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline - hi def htmlItalic term=italic cterm=italic gui=italic - endif -endif - - HtmlHiLink htmlPreStmt PreProc - HtmlHiLink htmlPreError Error - HtmlHiLink htmlPreProc PreProc - HtmlHiLink htmlPreAttr String - HtmlHiLink htmlPreProcAttrName PreProc - HtmlHiLink htmlPreProcAttrError Error - HtmlHiLink htmlSpecial Special - HtmlHiLink htmlSpecialChar Special - HtmlHiLink htmlString String - HtmlHiLink htmlStatement Statement - HtmlHiLink htmlComment Comment - HtmlHiLink htmlCommentPart Comment - HtmlHiLink htmlValue String - HtmlHiLink htmlCommentError htmlError - HtmlHiLink htmlTagError htmlError - HtmlHiLink htmlBadTag htmlError - HtmlHiLink htmlBadArg htmlError - HtmlHiLink htmlEvent javaScript - HtmlHiLink htmlError Error - - HtmlHiLink javaScript Special - HtmlHiLink javaScriptExpression javaScript - HtmlHiLink htmlCssStyleComment Comment - HtmlHiLink htmlCssDefinition Special -endif - -" wiki highlighting - -HtmlHiLink wikiItalic htmlItalic -HtmlHiLink wikiBold htmlBold - -HtmlHiLink wikiBoldItalic htmlBoldItalic -HtmlHiLink wikiItalicBold htmlBoldItalic - -HtmlHiLink wikiBoldAndItalic htmlBoldItalic - -HtmlHiLink wikiH1 htmlH1 -HtmlHiLink wikiH2 htmlH2 -HtmlHiLink wikiH3 htmlH3 -HtmlHiLink wikiH4 htmlH4 -HtmlHiLink wikiH5 htmlH5 -HtmlHiLink wikiH6 htmlH6 -HtmlHiLink wikiLink Underlined -HtmlHiLink wikiTemplate Special -HtmlHiLink wikiParaFormatChar Special -HtmlHiLink wikiPre Constant -HtmlHiLink wikiRef Comment - - -let b:current_syntax = "html" - -delcommand HtmlHiLink - -if main_syntax == 'html' - unlet main_syntax -endif - diff --git a/.vim/syntax/mkd.vim b/.vim/syntax/mkd.vim deleted file mode 100644 index ee22365..0000000 --- a/.vim/syntax/mkd.vim +++ /dev/null @@ -1,104 +0,0 @@ -" Vim syntax file -" Language: Markdown -" Maintainer: Ben Williams -" URL: http://plasticboy.com/markdown-vim-mode/ -" Version: 9 -" Last Change: 2009 May 18 -" Remark: Uses HTML syntax file -" Remark: I don't do anything with angle brackets (<>) because that would too easily -" easily conflict with HTML syntax -" TODO: Handle stuff contained within stuff (e.g. headings within blockquotes) - - -" Read the HTML syntax to start with -if version < 600 - so :p:h/html.vim -else - runtime! syntax/html.vim - unlet b:current_syntax -endif - -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -" don't use standard HiLink, it will not work with included syntax files -if version < 508 - command! -nargs=+ HtmlHiLink hi link -else - command! -nargs=+ HtmlHiLink hi def link -endif - -syn spell toplevel -syn case ignore -syn sync linebreaks=1 - -"additions to HTML groups -syn region htmlBold start=/\\\@) -syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite -syn region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]" contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline -syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+ end=+"+ contained -syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained -syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained - -"define Markdown groups -syn match mkdLineContinue ".$" contained -syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/ -syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-$/ -syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_$/ -syn match mkdRule /^\s*-\{3,}$/ -syn match mkdRule /^\s*\*\{3,5}$/ -syn match mkdListItem "^\s*[-*+]\s\+" -syn match mkdListItem "^\s*\d\+\.\s\+" -syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ -syn match mkdLineBreak / \+$/ -syn region mkdCode start=/\\\@/ end=/$/ contains=mkdLineBreak,mkdLineContinue,@Spell -syn region mkdCode start="]*>" end="
" -syn region mkdCode start="]*>" end="" - -"HTML headings -syn region htmlH1 start="^\s*#" end="\($\|#\+\)" contains=@Spell -syn region htmlH2 start="^\s*##" end="\($\|#\+\)" contains=@Spell -syn region htmlH3 start="^\s*###" end="\($\|#\+\)" contains=@Spell -syn region htmlH4 start="^\s*####" end="\($\|#\+\)" contains=@Spell -syn region htmlH5 start="^\s*#####" end="\($\|#\+\)" contains=@Spell -syn region htmlH6 start="^\s*######" end="\($\|#\+\)" contains=@Spell -syn match htmlH1 /^.\+\n=\+$/ contains=@Spell -syn match htmlH2 /^.\+\n-\+$/ contains=@Spell - -"highlighting for Markdown groups -HtmlHiLink mkdString String -HtmlHiLink mkdCode String -HtmlHiLink mkdBlockquote Comment -HtmlHiLink mkdLineContinue Comment -HtmlHiLink mkdListItem Identifier -HtmlHiLink mkdRule Identifier -HtmlHiLink mkdLineBreak Todo -HtmlHiLink mkdLink htmlLink -HtmlHiLink mkdURL htmlString -HtmlHiLink mkdID Identifier -HtmlHiLink mkdLinkDef mkdID -HtmlHiLink mkdLinkDefTarget mkdURL -HtmlHiLink mkdLinkTitle htmlString - -HtmlHiLink mkdDelimiter Delimiter - -let b:current_syntax = "mkd" - -delcommand HtmlHiLink -" vim: ts=8 diff --git a/.vim/syntax/motd.vim b/.vim/syntax/motd.vim deleted file mode 100644 index 6a5afb9..0000000 --- a/.vim/syntax/motd.vim +++ /dev/null @@ -1,23 +0,0 @@ -" Vim syntax file -" Language: MotD Public -" Maintainer: David Bushong - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -syn match motdSig "\(\s\s\+\|\t\)--\?.\+$\|\s--\?\w\+\s*$" -syn match motdThread "^\s\+\\[_-]" -syn match motdDate "^\d\+/\d\+\s" -syn match motdLink "https\?://\S\+" - -hi link motdSig String -hi link motdThread Type -hi link motdDate Number -hi link motdLink Underlined - -let b:current_syntax = "motd" diff --git a/.vim/syntax/nvpscript.vim b/.vim/syntax/nvpscript.vim deleted file mode 100644 index a19e65d..0000000 --- a/.vim/syntax/nvpscript.vim +++ /dev/null @@ -1,72 +0,0 @@ -" Vim syn file -" Language: NVISION Script -" Maintainer: Barak Michener -" Last Change: 2006 Jun 29 - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -"this language is oblivious to case. -syn case ignore - - -" The only keywords -syn keyword nvpKeyword elseif else defsub endif msgbox for if -syn keyword nvpKeyword gosub endsub next print printn sleep -syn keyword nvpKeyword to wend while yesnobox - -syn keyword nvpFunction #flush #sendbreak #halt -" String contstants -syn region nvpString start=+"+ skip=+\\"+ end=+"+ -"integer number, or floating point number without a dot. -syn match nvpNumber "\<\d\+\>" -"floating point number, with dot -syn match nvpNumber "\<\d\+\.\d*\>" -"floating point number, starting with a dot -syn match nvpNumber "\.\d\+\>" -"hex number -syn match nvpNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" -syn match nvpNumber "\<[0-9ABCDEF]{2}\>" - -syn region nvpComment start="!" end="$" -syn match nvpOperator "[+\-*/()%<>=\^]" - -syn match nvpVarPlain "$^[ADEFHILMOPSTWX]\=" -syn match nvpVarPlain "$[\\\"\[\]'&`+*.,;=%~?@$<>(-]" -syn match nvpVarPlain "$\(0\|[1-9]\d*\)" -syn region nvpSend start="<<" end="$" -syn region nvpRecv start="\d*: " end="$" - -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_basic_syntax_inits") - if version < 508 - let did_basic_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - "My Highlighting - HiLink nvpFunction PreProc - HiLink nvpKeyword Statement - HiLink nvpString String - HiLink nvpNumber Number - HiLink nvpComment Comment - HiLink nvpOperator Operator - HiLink nvpVarPlain Identifier - HiLink nvpSend Include - HiLink nvpRecv SpecialChar - - delcommand HiLink -endif - -let b:current_syntax = "nvpscript" - -"vim: ts=4 diff --git a/.vim/syntax/proto.vim b/.vim/syntax/proto.vim deleted file mode 100644 index 23085a2..0000000 --- a/.vim/syntax/proto.vim +++ /dev/null @@ -1,105 +0,0 @@ -" Protocol Buffers - Google's data interchange format -" Copyright 2008 Google Inc. All rights reserved. -" https://developers.google.com/protocol-buffers/ -" -" Redistribution and use in source and binary forms, with or without -" modification, are permitted provided that the following conditions are -" met: -" -" * Redistributions of source code must retain the above copyright -" notice, this list of conditions and the following disclaimer. -" * Redistributions in binary form must reproduce the above -" copyright notice, this list of conditions and the following disclaimer -" in the documentation and/or other materials provided with the -" distribution. -" * Neither the name of Google Inc. nor the names of its -" contributors may be used to endorse or promote products derived from -" this software without specific prior written permission. -" -" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -" This is the Vim syntax file for Google Protocol Buffers. -" -" Usage: -" -" 1. cp proto.vim ~/.vim/syntax/ -" 2. Add the following to ~/.vimrc: -" -" augroup filetype -" au! BufRead,BufNewFile *.proto setfiletype proto -" augroup end -" -" Or just create a new file called ~/.vim/ftdetect/proto.vim with the -" previous lines on it. - -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -syn case match - -syn keyword pbTodo contained TODO FIXME XXX -syn cluster pbCommentGrp contains=pbTodo - -syn keyword pbSyntax syntax import option -syn keyword pbStructure package message group oneof -syn keyword pbRepeat optional required repeated -syn keyword pbDefault default -syn keyword pbExtend extend extensions to max -syn keyword pbRPC service rpc returns - -syn keyword pbType int32 int64 uint32 uint64 sint32 sint64 -syn keyword pbType fixed32 fixed64 sfixed32 sfixed64 -syn keyword pbType float double bool string bytes -syn keyword pbTypedef enum -syn keyword pbBool true false - -syn match pbInt /-\?\<\d\+\>/ -syn match pbInt /\<0[xX]\x+\>/ -syn match pbFloat /\<-\?\d*\(\.\d*\)\?/ -syn region pbComment start="\/\*" end="\*\/" contains=@pbCommentGrp -syn region pbComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp -syn region pbString start=/"/ skip=/\\./ end=/"/ -syn region pbString start=/'/ skip=/\\./ end=/'/ - -if version >= 508 || !exists("did_proto_syn_inits") - if version < 508 - let did_proto_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink pbTodo Todo - - HiLink pbSyntax Include - HiLink pbStructure Structure - HiLink pbRepeat Repeat - HiLink pbDefault Keyword - HiLink pbExtend Keyword - HiLink pbRPC Keyword - HiLink pbType Type - HiLink pbTypedef Typedef - HiLink pbBool Boolean - - HiLink pbInt Number - HiLink pbFloat Float - HiLink pbComment Comment - HiLink pbString String - - delcommand HiLink -endif - -let b:current_syntax = "proto" diff --git a/.vim/syntax/scala.vim b/.vim/syntax/scala.vim deleted file mode 100644 index b19a04f..0000000 --- a/.vim/syntax/scala.vim +++ /dev/null @@ -1,153 +0,0 @@ -" Vim syntax file -" Language : Scala (http://scala-lang.org/) -" Maintainers: Stefan Matthias Aust, Julien Wetterwald -" Last Change: 2007 June 13 -" Revision : $Id$ -" $URL$ - -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -syn case match -syn sync minlines=50 - -" most Scala keywords -syn keyword scalaKeyword abstract case catch do else extends final finally for forSome if implicit lazy match new null override private protected requires return sealed super this throw try type while with yield -syn match scalaKeyword "=>" -syn match scalaKeyword "<-" -syn match scalaKeyword "\<_\>" - -syn match scalaOperator ":\{2,\}" "this is not a type - -" package and import statements -syn keyword scalaPackage package nextgroup=scalaFqn skipwhite -syn keyword scalaImport import nextgroup=scalaFqn skipwhite -syn match scalaFqn "\<[._$a-zA-Z0-9,]*" contained nextgroup=scalaFqnSet -syn region scalaFqnSet start="{" end="}" contained - -" boolean literals -syn keyword scalaBoolean true false - -" definitions -syn keyword scalaDef def nextgroup=scalaDefName skipwhite -syn keyword scalaVal val nextgroup=scalaValName skipwhite -syn keyword scalaVar var nextgroup=scalaVarName skipwhite -syn keyword scalaClass class nextgroup=scalaClassName skipwhite -syn keyword scalaObject object nextgroup=scalaClassName skipwhite -syn keyword scalaTrait trait nextgroup=scalaClassName skipwhite -syn match scalaDefName "[^ =:;([]\+" contained nextgroup=scalaDefSpecializer skipwhite -syn match scalaValName "[^ =:;([]\+" contained -syn match scalaVarName "[^ =:;([]\+" contained -syn match scalaClassName "[^ =:;(\[]\+" contained nextgroup=scalaClassSpecializer skipwhite -syn region scalaDefSpecializer start="\[" end="\]" contained contains=scalaDefSpecializer -syn region scalaClassSpecializer start="\[" end="\]" contained contains=scalaClassSpecializer - -" type constructor (actually anything with an uppercase letter) -syn match scalaConstructor "\<[A-Z][_$a-zA-Z0-9]*\>" nextgroup=scalaConstructorSpecializer -syn region scalaConstructorSpecializer start="\[" end="\]" contained contains=scalaConstructorSpecializer - -" method call -syn match scalaRoot "\<[a-zA-Z][_$a-zA-Z0-9]*\."me=e-1 -syn match scalaMethodCall "\.[a-z][_$a-zA-Z0-9]*"ms=s+1 - -" type declarations in val/var/def -syn match scalaType ":\s*\(=>\s*\)\?[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)\?\(\s*\(<:\|>:\|#\|=>\)\s*[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)*\)*"ms=s+1 - -" comments -syn match scalaTodo "[tT][oO][dD][oO]" contained -syn match scalaLineComment "//.*" contains=scalaTodo -syn region scalaComment start="/\*" end="\*/" contains=scalaTodo -syn case ignore -syn include @scalaHtml syntax/html.vim -unlet b:current_syntax -syn case match -syn region scalaDocComment start="/\*\*" end="\*/" contains=scalaDocTags,scalaTodo,@scalaHtml keepend -syn region scalaDocTags start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}" contained -syn match scalaDocTags "@[a-z]\+" contained - -syn match scalaEmptyString "\"\"" - -" multi-line string literals -syn region scalaMultiLineString start="\"\"\"" end="\"\"\"" contains=scalaUnicode -syn match scalaUnicode "\\u[0-9a-fA-F]\{4}" contained - -" string literals with escapes -syn region scalaString start="\"[^"]" skip="\\\"" end="\"" contains=scalaStringEscape " TODO end \n or not? -syn match scalaStringEscape "\\u[0-9a-fA-F]\{4}" contained -syn match scalaStringEscape "\\[nrfvb\\\"]" contained - -" symbol and character literals -syn match scalaSymbol "'[_a-zA-Z0-9][_a-zA-Z0-9]*\>" -syn match scalaChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'" - -" number literals -syn match scalaNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" -syn match scalaNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" -syn match scalaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" -syn match scalaNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" - -" xml literals -syn match scalaXmlTag "<[a-zA-Z]\_[^>]*/>" contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString -syn region scalaXmlString start="\"" end="\"" contained -syn match scalaXmlStart "<[a-zA-Z]\_[^>]*>" contained contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString -syn region scalaXml start="<\([a-zA-Z]\_[^>]*\_[^/]\|[a-zA-Z]\)>" matchgroup=scalaXmlStart end="]\+>" contains=scalaXmlEscape,scalaXmlQuote,scalaXml,scalaXmlStart,scalaXmlComment -syn region scalaXmlEscape matchgroup=scalaXmlEscapeSpecial start="{" matchgroup=scalaXmlEscapeSpecial end="}" contained contains=TOP -syn match scalaXmlQuote "&[^;]\+;" contained -syn match scalaXmlComment "" contained - -syn sync fromstart - -" map Scala groups to standard groups -hi link scalaKeyword Keyword -hi link scalaPackage Include -hi link scalaImport Include -hi link scalaBoolean Boolean -hi link scalaOperator Normal -hi link scalaNumber Number -hi link scalaEmptyString String -hi link scalaString String -hi link scalaChar String -hi link scalaMultiLineString String -hi link scalaStringEscape Special -hi link scalaSymbol Special -hi link scalaUnicode Special -hi link scalaComment Comment -hi link scalaLineComment Comment -hi link scalaDocComment Comment -hi link scalaDocTags Special -hi link scalaTodo Todo -hi link scalaType Type -hi link scalaTypeSpecializer scalaType -hi link scalaXml String -hi link scalaXmlTag Include -hi link scalaXmlString String -hi link scalaXmlStart Include -hi link scalaXmlEscape Normal -hi link scalaXmlEscapeSpecial Special -hi link scalaXmlQuote Special -hi link scalaXmlComment Comment -hi link scalaDef Keyword -hi link scalaVar Keyword -hi link scalaVal Keyword -hi link scalaClass Keyword -hi link scalaObject Keyword -hi link scalaTrait Keyword -hi link scalaDefName Function -hi link scalaDefSpecializer Function -hi link scalaClassName Special -hi link scalaClassSpecializer Special -hi link scalaConstructor Special -hi link scalaConstructorSpecializer scalaConstructor - -let b:current_syntax = "scala" - -" you might like to put these lines in your .vimrc -" -" customize colors a little bit (should be a different file) -" hi scalaNew gui=underline -" hi scalaMethodCall gui=italic -" hi scalaValName gui=underline -" hi scalaVarName gui=underline diff --git a/.vim/syntax/snippet.vim b/.vim/syntax/snippet.vim deleted file mode 100644 index 5e919e7..0000000 --- a/.vim/syntax/snippet.vim +++ /dev/null @@ -1,19 +0,0 @@ -" Syntax highlighting for snippet files (used for snipMate.vim) -" Hopefully this should make snippets a bit nicer to write! -syn match snipComment '^#.*' -syn match placeHolder '\${\d\+\(:.\{-}\)\=}' contains=snipCommand -syn match tabStop '\$\d\+' -syn match snipCommand '`.\{-}`' -syn match snippet '^snippet.*' transparent contains=multiSnipText,snipKeyword -syn match multiSnipText '\S\+ \zs.*' contained -syn match snipKeyword '^snippet'me=s+8 contained -syn match snipError "^[^#s\t].*$" - -hi link snipComment Comment -hi link multiSnipText String -hi link snipKeyword Keyword -hi link snipComment Comment -hi link placeHolder Special -hi link tabStop Special -hi link snipCommand String -hi link snipError Error diff --git a/.vim/syntax/svkannotate.vim b/.vim/syntax/svkannotate.vim deleted file mode 100644 index 3c53c3c..0000000 --- a/.vim/syntax/svkannotate.vim +++ /dev/null @@ -1,42 +0,0 @@ -" Vim syntax file -" Language: SVK annotate output -" Maintainer: Bob Hiestand -" Remark: Used by the vcscommand plugin. -" License: -" Copyright (c) 2007 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. - -if exists("b:current_syntax") - finish -endif - -syn match svkDate /\d\{4}-\d\{1,2}-\d\{1,2}/ skipwhite contained -syn match svkName /(\s*\zs\S\+/ contained nextgroup=svkDate skipwhite -syn match svkVer /^\s*\d\+/ contained nextgroup=svkName skipwhite -syn region svkHead start=/^/ end="):" contains=svkVer,svkName,svkDate oneline - -if !exists("did_svkannotate_syntax_inits") - let did_svkannotate_syntax_inits = 1 - hi link svkName Type - hi link svkDate Comment - hi link svkVer Statement -endif - -let b:current_syntax="svkAnnotate" diff --git a/.vim/syntax/svnannotate.vim b/.vim/syntax/svnannotate.vim deleted file mode 100644 index d46f771..0000000 --- a/.vim/syntax/svnannotate.vim +++ /dev/null @@ -1,40 +0,0 @@ -" Vim syntax file -" Language: SVN annotate output -" Maintainer: Bob Hiestand -" Remark: Used by the vcscommand plugin. -" License: -" Copyright (c) 2007 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. - -if exists("b:current_syntax") - finish -endif - -syn match svnName /\S\+/ contained -syn match svnVer /^\s\+\zs\d\+/ contained nextgroup=svnName skipwhite -syn match svnHead /^\s\+\d\+\s\+\S\+/ contains=svnVer,svnName - -if !exists("did_svnannotate_syntax_inits") - let did_svnannotate_syntax_inits = 1 - hi link svnName Type - hi link svnVer Statement -endif - -let b:current_syntax="svnAnnotate" diff --git a/.vim/syntax/vcscommit.vim b/.vim/syntax/vcscommit.vim deleted file mode 100644 index 0cd4c5e..0000000 --- a/.vim/syntax/vcscommit.vim +++ /dev/null @@ -1,31 +0,0 @@ -" Vim syntax file -" Language: VCS commit file -" Maintainer: Bob Hiestand (bob.hiestand@gmail.com) -" License: -" Copyright (c) 2007 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. - -if exists("b:current_syntax") - finish -endif - -syntax region vcsComment start="^VCS: " end="$" -highlight link vcsComment Comment -let b:current_syntax = "vcscommit" diff --git a/.vim/syntax_checkers/go/golintc.vim b/.vim/syntax_checkers/go/golintc.vim deleted file mode 100644 index 58e6102..0000000 --- a/.vim/syntax_checkers/go/golintc.vim +++ /dev/null @@ -1,42 +0,0 @@ -"============================================================================ -"File: golintc.vim -"Description: Check go syntax using 'golintc' -"Maintainer: Hiroshi Ioka -"License: This program is free software. It comes without any warranty, -" to the extent permitted by applicable law. You can redistribute -" it and/or modify it under the terms of the Do What The Fuck You -" Want To Public License, Version 2, as published by Sam Hocevar. -" See http://sam.zoy.org/wtfpl/COPYING for more details. -" -"============================================================================ - -if exists("g:loaded_syntastic_go_golintc_checker") - finish -endif -let g:loaded_syntastic_go_golintc_checker = 1 - -let s:save_cpo = &cpo -set cpo&vim - -function! SyntaxCheckers_go_golintc_GetLocList() dict - let makeprg = self.makeprgBuild({}) - - let errorformat = - \ '%f:%l:%c: %m,' . - \ '%-G%.%#' - - return SyntasticMake({ - \ 'makeprg': makeprg, - \ 'errorformat': errorformat, - \ 'defaults': {'type': 'w'}, - \ 'subtype': 'Style' }) -endfunction - -call g:SyntasticRegistry.CreateAndRegisterChecker({ - \ 'filetype': 'go', - \ 'name': 'golintc'}) - -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim: set sw=4 sts=4 et fdm=marker: diff --git a/.vim/syntax_checkers/go/gonyet.vim b/.vim/syntax_checkers/go/gonyet.vim deleted file mode 100644 index 3c703c5..0000000 --- a/.vim/syntax_checkers/go/gonyet.vim +++ /dev/null @@ -1,49 +0,0 @@ -"============================================================================ -"File: gonyet.vim -"Description: Perform static analysis of Go code with the go-nyet tool -"Maintainer: Barak Michener -"License: This program is free software. It comes without any warranty, -" to the extent permitted by applicable law. You can redistribute -" it and/or modify it under the terms of the Do What The Fuck You -" Want To Public License, Version 2, as published by Sam Hocevar. -" See http://sam.zoy.org/wtfpl/COPYING for more details. -" -"============================================================================ - -if exists("g:loaded_syntastic_go_gonyet_checker") - finish -endif -let g:loaded_syntastic_go_gonyet_checker = 1 - -let s:save_cpo = &cpo -set cpo&vim - -function! SyntaxCheckers_go_gonyet_IsAvailable() dict - return executable('go-nyet') -endfunction - -function! SyntaxCheckers_go_gonyet_GetLocList() dict - let makeprg = 'go-nyet ' . expand('%:p') - let errorformat = '%f:%l:%c:%m' - - " The go compiler needs to either be run with an import path as an - " argument or directly from the package directory. Since figuring out - " the proper import path is fickle, just cwd to the package. - - let errors = SyntasticMake({ - \ 'makeprg': makeprg, - \ 'errorformat': errorformat, - \ 'cwd': expand('%:p:h'), - \ 'defaults': {'type': 'w'} }) - - return errors -endfunction - -call g:SyntasticRegistry.CreateAndRegisterChecker({ - \ 'filetype': 'go', - \ 'name': 'gonyet'}) - -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim: set et sts=4 sw=4: diff --git a/.vim/syntax_checkers/go/govetshadow.vim b/.vim/syntax_checkers/go/govetshadow.vim deleted file mode 100644 index 24e1249..0000000 --- a/.vim/syntax_checkers/go/govetshadow.vim +++ /dev/null @@ -1,52 +0,0 @@ -"============================================================================ -"File: govetshadow.vim -"Description: Perform static analysis of Go code with the vet tool -"Maintainer: Kamil Kisiel -"License: This program is free software. It comes without any warranty, -" to the extent permitted by applicable law. You can redistribute -" it and/or modify it under the terms of the Do What The Fuck You -" Want To Public License, Version 2, as published by Sam Hocevar. -" See http://sam.zoy.org/wtfpl/COPYING for more details. -" -"============================================================================ - -if exists("g:loaded_syntastic_go_govetshadow_checker") - finish -endif -let g:loaded_syntastic_go_govetshadow_checker = 1 - -let s:save_cpo = &cpo -set cpo&vim - -function! SyntaxCheckers_go_govetshadow_IsAvailable() dict - return executable(self.getExec()) -endfunction - -function! SyntaxCheckers_go_govetshadow_GetLocList() dict - let makeprg = self.getExec() . ' tool vet -shadow ' . expand('%:p') - - let errorformat = - \ '%Evet: %.%\+: %f:%l:%c: %m,' . - \ '%W%f:%l: %m,' . - \ '%-G%.%#' - - " The go compiler needs to either be run with an import path as an - " argument or directly from the package directory. Since figuring out - " the proper import path is fickle, just cwd to the package. - - return SyntasticMake({ - \ 'makeprg': makeprg, - \ 'errorformat': errorformat, - \ 'cwd': expand('%:p:h', 1), - \ 'defaults': {'type': 'w'} }) -endfunction - -call g:SyntasticRegistry.CreateAndRegisterChecker({ - \ 'filetype': 'go', - \ 'name': 'govetshadow', - \ 'exec': 'go' }) - -let &cpo = s:save_cpo -unlet s:save_cpo - -" diff --git a/.vim/tabbar.vim b/.vim/tabbar.vim deleted file mode 100644 index b914734..0000000 --- a/.vim/tabbar.vim +++ /dev/null @@ -1,1646 +0,0 @@ -" Copyright: Copyright (C) 2005 Marius Groleo -" Permission is hereby granted to use and distribute this code, -" with or without modifications, provided that this copyright -" notice is copied with it. Like anything else that's free, -" tabbar.vim is provided *AS IS* and comes with no warranty of -" any kind, either expressed or implied. In no event will the -" copyright holder be liable for any damamges resulting from the -" use of this software. -" -" Derived from Bindu Wavell miniBufExplorer.vim version 6.3.2 - - -" Version: 0.7 -" Maintainer: Marius Groleo < groleo@gmail.com > -" Description: TabBar buffer explorer Vim Plugin -" Name Of File: tabbar.vim - -" DOCUMENTATION: is at line :1445 - -" press zR , in normal mode to OPEN all folds -" press zM , in normal mode to CLOSE all folds - -" Already been loaded? ~~ -if exists('Tb_loaded') - finish -else - let Tb_loaded= 1 -endif "%% - - -" Debug Level ~~ -" 0 = no logging -" 1-5 = errors ; 1 is the most important -" 5-9 = info ; 5 is the most important -" 10 = Entry/Exit -if !exists('g:Tb_DBG_LVL') - let g:Tb_DBG_LVL = 0 -endif" %% - - -" Logging method ~~ -" 0 = log to a window -" 1 = log with vim's echo facility -" 2 = log to a file named TabBar.DBG -" in the directory where vim was started -" THIS IS VERY SLOW -" 3 = log into g:Tb_DbgOutput -" global variable [This is the default] -if !exists('g:Tb_DebugMode') - let g:Tb_DebugMode = 0 -endif" %% - - -" Mappings and Commands -" TabBar Keyboard Mappings ~~ -if ! hasmapto('1') || !hasmapto('') - "gui bindings containing META key, are different from terminal bindings - if has('gui_running') - "NORMAL mode bindings for gvim - noremap + +
+
+ + diff --git a/dot_vim/skeletons/vue.skel b/dot_vim/skeletons/vue.skel new file mode 100644 index 0000000..8310166 --- /dev/null +++ b/dot_vim/skeletons/vue.skel @@ -0,0 +1,19 @@ + + + + + diff --git a/dot_vim/syntax/c.vim b/dot_vim/syntax/c.vim new file mode 100644 index 0000000..8381244 --- /dev/null +++ b/dot_vim/syntax/c.vim @@ -0,0 +1,377 @@ +" Vim syntax file +" Language: C +" Maintainer: Bram Moolenaar +" Last Change: 2008 Mar 19 + +" Quit when a (custom) syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +" A bunch of useful C keywords +syn keyword cStatement goto break return continue asm +syn keyword cLabel case default +syn keyword cConditional if else switch +syn keyword cRepeat while for do + +syn keyword cTodo contained TODO FIXME XXX + +" cCommentGroup allows adding matches for special things in comments +syn cluster cCommentGroup contains=cTodo + +" String and Character constants +" Highlight special characters (those which have a backslash) differently +syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)" +if !exists("c_no_utf") + syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)" +endif +if exists("c_no_cformat") + syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell + " cCppString: same as cString, but ends at end of line + syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,@Spell +else + if !exists("c_no_c99") " ISO C99 + syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained + else + syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained + endif + syn match cFormat display "%%" contained + syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell + " cCppString: same as cString, but ends at end of line + syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell +endif + +syn match cCharacter "L\='[^\\]'" +syn match cCharacter "L'[^']*'" contains=cSpecial +if exists("c_gnu") + syn match cSpecialError "L\='\\[^'\"?\\abefnrtv]'" + syn match cSpecialCharacter "L\='\\['\"?\\abefnrtv]'" +else + syn match cSpecialError "L\='\\[^'\"?\\abfnrtv]'" + syn match cSpecialCharacter "L\='\\['\"?\\abfnrtv]'" +endif +syn match cSpecialCharacter display "L\='\\\o\{1,3}'" +syn match cSpecialCharacter display "'\\x\x\{1,2}'" +syn match cSpecialCharacter display "L'\\x\x\+'" + +"when wanted, highlight trailing white space +if exists("c_space_errors") + if !exists("c_no_trail_space_error") + syn match cSpaceError display excludenl "\s\+$" + endif + if !exists("c_no_tab_space_error") + syn match cSpaceError display " \+\t"me=e-1 + endif +endif + +" This should be before cErrInParen to avoid problems with #define ({ xxx }) +if exists("c_curly_error") + syntax match cCurlyError "}" + syntax region cBlock start="{" end="}" contains=ALLBUT,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell fold +else + syntax region cBlock start="{" end="}" transparent fold +endif + +"catch errors caused by wrong parenthesis and brackets +" also accept <% for {, %> for }, <: for [ and :> for ] (C99) +" But avoid matching <::. +syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom +if exists("c_no_curly_error") + syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell + " cCppParen: same as cParen but ends at end-of-line; used in cDefine + syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell + syn match cParenError display ")" + syn match cErrInParen display contained "^[{}]\|^<%\|^%>" +elseif exists("c_no_bracket_error") + syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell + " cCppParen: same as cParen but ends at end-of-line; used in cDefine + syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell + syn match cParenError display ")" + syn match cErrInParen display contained "[{}]\|<%\|%>" +else + syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell + " cCppParen: same as cParen but ends at end-of-line; used in cDefine + syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell + syn match cParenError display "[\])]" + syn match cErrInParen display contained "[\]{}]\|<%\|%>" + syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell + " cCppBracket: same as cParen but ends at end-of-line; used in cDefine + syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell + syn match cErrInBracket display contained "[);{}]\|<%\|%>" +endif + +"integer number, or floating point number without a dot and with "f". +syn case ignore +syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal +" Same, but without octal error (for comments) +syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctal +syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>" +"hex number +syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" +" Flag the first zero of an octal number as something special +syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero +syn match cOctalZero display contained "\<0" +syn match cFloat display contained "\d\+f" +"floating point number, with dot, optional exponent +syn match cFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" +"floating point number, starting with a dot, optional exponent +syn match cFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" +"floating point number, without dot, with exponent +syn match cFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>" +if !exists("c_no_c99") + "hexadecimal floating point number, optional leading digits, with dot, with exponent + syn match cFloat display contained "0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>" + "hexadecimal floating point number, with leading digits, optional dot, with exponent + syn match cFloat display contained "0x\x\+\.\=p[-+]\=\d\+[fl]\=\>" +endif + +" flag an octal number with wrong digits +syn match cOctalError display contained "0\o*[89]\d*" +syn case match + +if exists("c_comment_strings") + " A comment can contain cString, cCharacter and cNumber. + " But a "*/" inside a cString in a cComment DOES end the comment! So we + " need to use a special type of cString: cCommentString, which also ends on + " "*/", and sees a "*" at the start of the line as comment again. + " Unfortunately this doesn't very well work for // type of comments :-( + syntax match cCommentSkip contained "^\s*\*\($\|\s\+\)" + syntax region cCommentString contained start=+L\=\\\@" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +syn match cPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>" +if !exists("c_no_if0") + if !exists("c_no_if0_fold") + syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2 fold + else + syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2 + endif + syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip + syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip +endif +syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ +syn match cIncluded display contained "<[^>]*>" +syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded +"syn match cLineSkip "\\$" +syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti +syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 keepend contains=ALLBUT,@cPreProcGroup,@Spell +syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell + +" Highlight User Labels +syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString +syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell +" Avoid matching foo::bar() in C++ by requiring that the next char is not ':' +syn cluster cLabelGroup contains=cUserLabel +syn match cUserCont display "^\s*\I\i*\s*:$" contains=@cLabelGroup +syn match cUserCont display ";\s*\I\i*\s*:$" contains=@cLabelGroup +syn match cUserCont display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup +syn match cUserCont display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup + +syn match cUserLabel display "\I\i*" contained + +" Avoid recognizing most bitfields as labels +syn match cBitField display "^\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType +syn match cBitField display ";\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType + +" Highlight Class and Function names +syn match cCustomParen "(" contains=cParen contains=cCppParen +syn match cCustomFunc "\w\+\s*(" contains=cCustomParen +syn match cCustomScope "::" +syn match cCustomClass "\w\+\s*::" contains=cCustomScope + +hi def link cCustomFunc Function +hi def link cCustomClass Function + +if exists("c_minlines") + let b:c_minlines = c_minlines +else + if !exists("c_no_if0") + let b:c_minlines = 50 " #if 0 constructs can be long + else + let b:c_minlines = 15 " mostly for () constructs + endif +endif +if exists("c_curly_error") + syn sync fromstart +else + exec "syn sync ccomment cComment minlines=" . b:c_minlines +endif + +" Define the default highlighting. +" Only used when an item doesn't have highlighting yet +hi def link cFormat cSpecial +hi def link cCppString cString +hi def link cCommentL cComment +hi def link cCommentStart cComment +hi def link cLabel Label +hi def link cUserLabel Label +hi def link cConditional Conditional +hi def link cRepeat Repeat +hi def link cCharacter Character +hi def link cSpecialCharacter cSpecial +hi def link cNumber Number +hi def link cOctal Number +hi def link cOctalZero PreProc " link this to Error if you want +hi def link cFloat Float +hi def link cOctalError cError +hi def link cParenError cError +hi def link cErrInParen cError +hi def link cErrInBracket cError +hi def link cCommentError cError +hi def link cCommentStartError cError +hi def link cSpaceError cError +hi def link cSpecialError cError +hi def link cCurlyError cError +hi def link cOperator Operator +hi def link cStructure Structure +hi def link cStorageClass StorageClass +hi def link cInclude Include +hi def link cPreProc PreProc +hi def link cDefine Macro +hi def link cIncluded cString +hi def link cError Error +hi def link cStatement Statement +hi def link cPreCondit PreCondit +hi def link cType Type +hi def link cConstant Constant +hi def link cCommentString cString +hi def link cComment2String cString +hi def link cCommentSkip cComment +hi def link cString String +hi def link cComment Comment +hi def link cSpecial SpecialChar +hi def link cTodo Todo +hi def link cCppSkip cCppOut +hi def link cCppOut2 cCppOut +hi def link cCppOut Comment + +let b:current_syntax = "c" + +" vim: ts=8 diff --git a/dot_vim/syntax/cvsannotate.vim b/dot_vim/syntax/cvsannotate.vim new file mode 100644 index 0000000..4af5809 --- /dev/null +++ b/dot_vim/syntax/cvsannotate.vim @@ -0,0 +1,45 @@ +" Vim syntax file +" Language: CVS annotate output +" Maintainer: Bob Hiestand +" Remark: Used by the cvscommand plugin. Originally written by Mathieu +" Clabaut +" License: +" Copyright (c) 2007 Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn match cvsDate /\d\d-...-\d\d/ contained +syn match cvsName /(\S* /hs=s+1,he=e-1 contained nextgroup=cvsDate +syn match cvsVer /^\d\+\(\.\d\+\)\+/ contained nextgroup=cvsName +syn region cvsHead start="^\d\+\.\d\+" end="):" contains=cvsVer,cvsName,cvsDate + +if !exists("did_cvsannotate_syntax_inits") + let did_cvsannotate_syntax_inits = 1 + hi link cvsDate Comment + hi link cvsName Type + hi link cvsVer Statement +endif + +let b:current_syntax="CVSAnnotate" diff --git a/dot_vim/syntax/gitannotate.vim b/dot_vim/syntax/gitannotate.vim new file mode 100644 index 0000000..932342d --- /dev/null +++ b/dot_vim/syntax/gitannotate.vim @@ -0,0 +1,44 @@ +" Vim syntax file +" Language: git annotate output +" Maintainer: Bob Hiestand +" Remark: Used by the vcscommand plugin. +" License: +" Copyright (c) 2009 Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if exists("b:current_syntax") + finish +endif + +syn region gitName start="(\@<=" end="\( \d\d\d\d-\)\@=" contained +syn match gitCommit /^\^\?\x\+/ contained +syn match gitDate /\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d [+-]\d\d\d\d/ contained +syn match gitLineNumber /\d\+)\@=/ contained +syn region gitAnnotation start="^" end=") " oneline keepend contains=gitCommit,gitLineNumber,gitDate,gitName + +if !exists("did_gitannotate_syntax_inits") + let did_gitannotate_syntax_inits = 1 + hi link gitName Type + hi link gitCommit Statement + hi link gitDate Comment + hi link gitLineNumber Label +endif + +let b:current_syntax="gitAnnotate" diff --git a/dot_vim/syntax/haskell.vim b/dot_vim/syntax/haskell.vim new file mode 100644 index 0000000..10bb221 --- /dev/null +++ b/dot_vim/syntax/haskell.vim @@ -0,0 +1,355 @@ +" Vim syntax file +" +" Modification of vims Haskell syntax file: +" - match types using regular expression +" - highlight toplevel functions +" - use "syntax keyword" instead of "syntax match" where appropriate +" - functions and types in import and module declarations are matched +" - removed hs_highlight_more_types (just not needed anymore) +" - enable spell checking in comments and strings only +" - FFI highlighting +" - QuasiQuotation +" - top level Template Haskell slices +" - PackageImport +" +" TODO: find out which vim versions are still supported +" +" From Original file: +" =================== +" +" Language: Haskell +" Maintainer: Haskell Cafe mailinglist +" Last Change: 2010 Feb 21 +" Original Author: John Williams +" +" Thanks to Ryan Crumley for suggestions and John Meacham for +" pointing out bugs. Also thanks to Ian Lynagh and Donald Bruce Stewart +" for providing the inspiration for the inclusion of the handling +" of C preprocessor directives, and for pointing out a bug in the +" end-of-line comment handling. +" +" Options-assign a value to these variables to turn the option on: +" +" hs_highlight_delimiters - Highlight delimiter characters--users +" with a light-colored background will +" probably want to turn this on. +" hs_highlight_boolean - Treat True and False as keywords. +" hs_highlight_types - Treat names of primitive types as keywords. +" hs_highlight_debug - Highlight names of debugging functions. +" hs_allow_hash_operator - Don't highlight seemingly incorrect C +" preprocessor directives but assume them to be +" operators +" +" + +if version < 600 + syn clear +elseif exists("b:current_syntax") + finish +endif + +"syntax sync fromstart "mmhhhh.... is this really ok to do so? +syntax sync linebreaks=15 minlines=50 maxlines=500 + +syn match hsSpecialChar contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)" +syn match hsSpecialChar contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)" +syn match hsSpecialCharError contained "\\&\|'''\+" +sy region hsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=hsSpecialChar,@Spell +sy match hsCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=hsSpecialChar,hsSpecialCharError +sy match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hsSpecialCharError + +" (Qualified) identifiers (no default highlighting) +syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>" +syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>" + +" Infix operators--most punctuation characters and any (qualified) identifier +" enclosed in `backquotes`. An operator starting with : is a constructor, +" others are variables (e.g. functions). +syn match hsVarSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[-!#$%&\*\+/<=>\?@\\^|~.][-!#$%&\*\+/<=>\?@\\^|~:.]*" +syn match hsConSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=:[-!#$%&\*\+./<=>\?@\\^|~:]*" +syn match hsVarSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[a-z][a-zA-Z0-9_']*`" +syn match hsConSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[A-Z][a-zA-Z0-9_']*`" + +" Toplevel Template Haskell support +"sy match hsTHTopLevel "^[a-z]\(\(.\&[^=]\)\|\(\n[^a-zA-Z0-9]\)\)*" +sy match hsTHIDTopLevel "^[a-z]\S*" +sy match hsTHTopLevel "^\$(\?" nextgroup=hsTHTopLevelName +sy match hsTHTopLevelName "[a-z]\S*" contained + +" Reserved symbols--cannot be overloaded. +syn match hsDelimiter "(\|)\|\[\|\]\|,\|;\|_\|{\|}" + +sy region hsInnerParen start="(" end=")" contained contains=hsInnerParen,hsConSym,hsType,hsVarSym +sy region hs_InfixOpFunctionName start="^(" end=")\s*[^:`]\(\W\&\S\&[^'\"`()[\]{}@]\)\+"re=s + \ contained keepend contains=hsInnerParen,hs_HlInfixOp + +sy match hs_hlFunctionName "[a-z_]\(\S\&[^,\(\)\[\]]\)*" contained +sy match hs_FunctionName "^[a-z_]\(\S\&[^,\(\)\[\]]\)*" contained contains=hs_hlFunctionName +sy match hs_HighliteInfixFunctionName "`[a-z_][^`]*`" contained +sy match hs_InfixFunctionName "^\S[^=]*`[a-z_][^`]*`"me=e-1 contained contains=hs_HighliteInfixFunctionName,hsType,hsConSym,hsVarSym,hsString,hsCharacter +sy match hs_HlInfixOp "\(\W\&\S\&[^`(){}'[\]]\)\+" contained contains=hsString +sy match hs_InfixOpFunctionName "^\(\(\w\|[[\]{}]\)\+\|\(\".*\"\)\|\('.*'\)\)\s*[^:]=*\(\W\&\S\&[^='\"`()[\]{}@]\)\+" + \ contained contains=hs_HlInfixOp,hsCharacter + +sy match hs_OpFunctionName "(\(\W\&[^(),\"]\)\+)" contained +"sy region hs_Function start="^["'a-z_([{]" end="=\(\s\|\n\|\w\|[([]\)" keepend extend +sy region hs_Function start="^["'a-zA-Z_([{]\(\(.\&[^=]\)\|\(\n\s\)\)*=" end="\(\s\|\n\|\w\|[([]\)" + \ contains=hs_OpFunctionName,hs_InfixOpFunctionName,hs_InfixFunctionName,hs_FunctionName,hsType,hsConSym,hsVarSym,hsString,hsCharacter + +sy match hs_DeclareFunction "^[a-z_(]\S*\(\s\|\n\)*::" contains=hs_FunctionName,hs_OpFunctionName + +" hi hs_InfixOpFunctionName guibg=yellow +" hi hs_Function guibg=green +" hi hs_InfixFunctionName guibg=red +" hi hs_DeclareFunction guibg=red + +sy keyword hsStructure data family class where instance default deriving +sy keyword hsTypedef type newtype + +sy keyword hsInfix infix infixl infixr +sy keyword hsStatement do case of let in +sy keyword hsConditional if then else + +"if exists("hs_highlight_types") + " Primitive types from the standard prelude and libraries. + sy match hsType "\<[A-Z]\(\S\&[^,.]\)*\>" + sy match hsType "()" +"endif + +" Not real keywords, but close. +if exists("hs_highlight_boolean") + " Boolean constants from the standard prelude. + syn keyword hsBoolean True False +endif + +syn region hsPackageString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial contained +sy match hsModuleName excludenl "\([A-Z]\w*\.\?\)*" contained + +sy match hsImport "\\s\+\(qualified\s\+\)\?\(\<\(\w\|\.\)*\>\)" + \ contains=hsModuleName,hsImportLabel + \ nextgroup=hsImportParams,hsImportIllegal skipwhite +sy keyword hsImportLabel import qualified contained + +sy match hsImportIllegal "\w\+" contained + +sy keyword hsAsLabel as contained +sy keyword hsHidingLabel hiding contained + +sy match hsImportParams "as\s\+\(\w\+\)" contained + \ contains=hsModuleName,hsAsLabel + \ nextgroup=hsImportParams,hsImportIllegal skipwhite +sy match hsImportParams "hiding" contained + \ contains=hsHidingLabel + \ nextgroup=hsImportParams,hsImportIllegal skipwhite +sy region hsImportParams start="(" end=")" contained + \ contains=hsBlockComment,hsLineComment, hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName + \ nextgroup=hsImportIllegal skipwhite + +" hi hsImport guibg=red +"hi hsImportParams guibg=bg +"hi hsImportIllegal guibg=bg +"hi hsModuleName guibg=bg + +"sy match hsImport "\\(.\|[^(]\)*\((.*)\)\?" +" \ contains=hsPackageString,hsImportLabel,hsImportMod,hsModuleName,hsImportList +"sy keyword hsImportLabel import contained +"sy keyword hsImportMod as qualified hiding contained +"sy region hsImportListInner start="(" end=")" contained keepend extend contains=hs_OpFunctionName +"sy region hsImportList matchgroup=hsImportListParens start="("rs=s+1 end=")"re=e-1 +" \ contained +" \ keepend extend +" \ contains=hsType,hsLineComment,hsBlockComment,hs_hlFunctionName,hsImportListInner + + + +" new module highlighting +syn region hsDelimTypeExport start="\<[A-Z]\(\S\&[^,.]\)*\>(" end=")" contained + \ contains=hsType + +sy keyword hsExportModuleLabel module contained +sy match hsExportModule "\\(\s\|\t\|\n\)*\([A-Z]\w*\.\?\)*" contained contains=hsExportModuleLabel,hsModuleName + +sy keyword hsModuleStartLabel module contained +sy keyword hsModuleWhereLabel where contained + +syn match hsModuleStart "^module\(\s\|\n\)*\(\<\(\w\|\.\)*\>\)\(\s\|\n\)*" + \ contains=hsModuleStartLabel,hsModuleName + \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel + +syn region hsModuleCommentA start="{-" end="-}" + \ contains=hsModuleCommentA,hsCommentTodo,@Spell contained + \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel skipwhite skipnl + +syn match hsModuleCommentA "--.*\n" + \ contains=hsCommentTodo,@Spell contained + \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel skipwhite skipnl + +syn region hsModuleExports start="(" end=")" contained + \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl + \ contains=hsBlockComment,hsLineComment,hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName,hsExportModule + +syn match hsModuleCommentB "--.*\n" + \ contains=hsCommentTodo,@Spell contained + \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl + +syn region hsModuleCommentB start="{-" end="-}" + \ contains=hsModuleCommentB,hsCommentTodo,@Spell contained + \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl +" end module highlighting + +" FFI support +sy keyword hsFFIForeign foreign contained +"sy keyword hsFFIImportExport import export contained +sy keyword hsFFIImportExport export contained +sy keyword hsFFICallConvention ccall stdcall contained +sy keyword hsFFISafety safe unsafe contained +sy region hsFFIString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=hsSpecialChar +sy match hsFFI excludenl "\\(.\&[^\"]\)*\"\(.\)*\"\(\s\|\n\)*\(.\)*::" + \ keepend + \ contains=hsFFIForeign,hsFFIImportExport,hsFFICallConvention,hsFFISafety,hsFFIString,hs_OpFunctionName,hs_hlFunctionName + + +sy match hsNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>" +sy match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>" + +" Comments +sy keyword hsCommentTodo TODO FIXME XXX TBD contained +sy match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=hsCommentTodo,@Spell +sy region hsBlockComment start="{-" end="-}" contains=hsBlockComment,hsCommentTodo,@Spell +sy region hsPragma start="{-#" end="#-}" + +" QuasiQuotation +sy region hsQQ start="\[\$" end="|\]"me=e-2 keepend contains=hsQQVarID,hsQQContent nextgroup=hsQQEnd +sy region hsQQNew start="\[\(.\&[^|]\&\S\)*|" end="|\]"me=e-2 keepend contains=hsQQVarIDNew,hsQQContent nextgroup=hsQQEnd +sy match hsQQContent ".*" contained +sy match hsQQEnd "|\]" contained +sy match hsQQVarID "\[\$\(.\&[^|]\)*|" contained +sy match hsQQVarIDNew "\[\(.\&[^|]\)*|" contained + +if exists("hs_highlight_debug") + " Debugging functions from the standard prelude. + syn keyword hsDebug undefined error trace +endif + + +" C Preprocessor directives. Shamelessly ripped from c.vim and trimmed +" First, see whether to flag directive-like lines or not +if (!exists("hs_allow_hash_operator")) + syn match cError display "^\s*\(%:\|#\).*$" +endif +" Accept %: for # (C99) +syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCommentError +syn match cPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>" +syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2 +syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cCppSkip +syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cCppSkip +syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ +syn match cIncluded display contained "<[^>]*>" +syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded +syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cCppOut,cCppOut2,cCppSkip,cCommentStartError +syn region cDefine matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" +syn region cPreProc matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend + +syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=cCommentStartError,cSpaceError contained +syntax match cCommentError display "\*/" contained +syntax match cCommentStartError display "/\*"me=e-1 contained +syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial contained + + +if version >= 508 || !exists("did_hs_syntax_inits") + if version < 508 + let did_hs_syntax_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink hs_hlFunctionName Function + HiLink hs_HighliteInfixFunctionName Function + HiLink hs_HlInfixOp Function + HiLink hs_OpFunctionName Function + HiLink hsTypedef Typedef + HiLink hsVarSym hsOperator + HiLink hsConSym hsOperator + if exists("hs_highlight_delimiters") + " Some people find this highlighting distracting. + HiLink hsDelimiter Delimiter + endif + + HiLink hsModuleStartLabel Structure + HiLink hsExportModuleLabel Keyword + HiLink hsModuleWhereLabel Structure + HiLink hsModuleName Normal + + HiLink hsImportIllegal Error + HiLink hsAsLabel hsImportLabel + HiLink hsHidingLabel hsImportLabel + HiLink hsImportLabel Include + HiLink hsImportMod Include + HiLink hsPackageString hsString + + HiLink hsOperator Operator + + HiLink hsInfix Keyword + HiLink hsStructure Structure + HiLink hsStatement Statement + HiLink hsConditional Conditional + + HiLink hsSpecialCharError Error + HiLink hsSpecialChar SpecialChar + HiLink hsString String + HiLink hsFFIString String + HiLink hsCharacter Character + HiLink hsNumber Number + HiLink hsFloat Float + + HiLink hsLiterateComment hsComment + HiLink hsBlockComment hsComment + HiLink hsLineComment hsComment + HiLink hsModuleCommentA hsComment + HiLink hsModuleCommentB hsComment + HiLink hsComment Comment + HiLink hsCommentTodo Todo + HiLink hsPragma SpecialComment + HiLink hsBoolean Boolean + + if exists("hs_highlight_types") + HiLink hsDelimTypeExport hsType + HiLink hsType Type + endif + + HiLink hsDebug Debug + + HiLink cCppString hsString + HiLink cCommentStart hsComment + HiLink cCommentError hsError + HiLink cCommentStartError hsError + HiLink cInclude Include + HiLink cPreProc PreProc + HiLink cDefine Macro + HiLink cIncluded hsString + HiLink cError Error + HiLink cPreCondit PreCondit + HiLink cComment Comment + HiLink cCppSkip cCppOut + HiLink cCppOut2 cCppOut + HiLink cCppOut Comment + + HiLink hsFFIForeign Keyword + HiLink hsFFIImportExport Structure + HiLink hsFFICallConvention Keyword + HiLink hsFFISafety Keyword + + HiLink hsTHIDTopLevel Macro + HiLink hsTHTopLevelName Macro + + HiLink hsQQVarID Keyword + HiLink hsQQVarIDNew Keyword + HiLink hsQQEnd Keyword + HiLink hsQQContent String + + delcommand HiLink +endif + +let b:current_syntax = "haskell" + diff --git a/dot_vim/syntax/hgannotate.vim b/dot_vim/syntax/hgannotate.vim new file mode 100755 index 0000000..cee9a23 --- /dev/null +++ b/dot_vim/syntax/hgannotate.vim @@ -0,0 +1,40 @@ +" Vim syntax file +" Language: HG annotate output +" Maintainer: Bob Hiestand +" Remark: Used by the vcscommand plugin. +" License: +" Copyright (c) 2010 Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if exists("b:current_syntax") + finish +endif + +syn match hgVer /\d\+/ contained +syn match hgName /^\s*\S\+/ contained +syn match hgHead /^\s*\S\+\s\+\d\+:/ contains=hgVer,hgName + +if !exists("did_hgannotate_syntax_inits") + let did_hgannotate_syntax_inits = 1 + hi link hgName Type + hi link hgVer Statement +endif + +let b:current_syntax="hgAnnotate" diff --git a/dot_vim/syntax/java.vim b/dot_vim/syntax/java.vim new file mode 100644 index 0000000..8c33b12 --- /dev/null +++ b/dot_vim/syntax/java.vim @@ -0,0 +1,9 @@ +" Highlight Class and Function names +syn match javaCustomParen "(" contains=javaParenT +syn match javaCustomFunc "\w\+\s*(" contains=javaCustomParen +syn match javaCustomScope "::" +syn match javaCustomClass "\w\+\s*::" contains=cCustomScope + +hi def link javaCustomFunc Function +hi def link javaCustomClass Function + diff --git a/dot_vim/syntax/javascript.vim b/dot_vim/syntax/javascript.vim new file mode 100644 index 0000000..53b684e --- /dev/null +++ b/dot_vim/syntax/javascript.vim @@ -0,0 +1,247 @@ +" Vim syntax file +" Language: JavaScript +" Maintainer: Yi Zhao (ZHAOYI) +" Last Change: June 4, 2009 +" Version: 0.7.7 +" Changes: Add "undefined" as a type keyword +" +" TODO: +" - Add the HTML syntax inside the JSDoc + +if !exists("main_syntax") + if version < 600 + syntax clear + elseif exists("b:current_syntax") + finish + endif + let main_syntax = 'javascript' +endif + +"" Drop fold if it set but VIM doesn't support it. +let b:javascript_fold='true' +if version < 600 " Don't support the old version + unlet! b:javascript_fold +endif + +"" dollar sigh is permittd anywhere in an identifier +setlocal iskeyword+=$ + +syntax sync fromstart + +"" JavaScript comments +syntax keyword javaScriptCommentTodo TODO FIXME XXX TBD contained +syntax region javaScriptLineComment start=+\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell +syntax region javaScriptLineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell fold +syntax region javaScriptCvsTag start="\$\cid:" end="\$" oneline contained +syntax region javaScriptComment start="/\*" end="\*/" contains=javaScriptCommentTodo,javaScriptCvsTag,@Spell fold + +"" JSDoc support start +if !exists("javascript_ignore_javaScriptdoc") + syntax case ignore + + "" syntax coloring for javadoc comments (HTML) + "syntax include @javaHtml :p:h/html.vim + "unlet b:current_syntax + + syntax region javaScriptDocComment matchgroup=javaScriptComment start="/\*\*\s*$" end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,javaScriptCvsTag,@javaScriptHtml,@Spell fold + syntax match javaScriptDocTags contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\)\>" nextgroup=javaScriptDocParam,javaScriptDocSeeTag skipwhite + syntax match javaScriptDocTags contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|returns\=\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>" + syntax match javaScriptDocParam contained "\%(#\|\w\|\.\|:\|\/\)\+" + syntax region javaScriptDocSeeTag contained matchgroup=javaScriptDocSeeTag start="{" end="}" contains=javaScriptDocTags + + syntax case match +endif "" JSDoc end + +syntax case match + +"" Syntax in the JavaScript code +syntax match javaScriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\." +syntax region javaScriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=javaScriptSpecial,@htmlPreproc +syntax region javaScriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc +syntax region javaScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,@htmlPreproc oneline +syntax match javaScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/ +syntax match javaScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/ +syntax match javaScriptLabel /\(?\s*\)\@/ + syntax match javaScriptDomElemFuncs contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=javaScriptParen skipwhite + " HTML things + syntax match javaScriptHtmlElemAttrs contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/ + syntax match javaScriptHtmlElemFuncs contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=javaScriptParen skipwhite + + " CSS Styles in JavaScript + syntax keyword javaScriptCssStyles contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition + syntax keyword javaScriptCssStyles contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition + syntax keyword javaScriptCssStyles contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode + syntax keyword javaScriptCssStyles contained bottom height left position right top width zIndex + syntax keyword javaScriptCssStyles contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout + syntax keyword javaScriptCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop + syntax keyword javaScriptCssStyles contained listStyle listStyleImage listStylePosition listStyleType + syntax keyword javaScriptCssStyles contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat + syntax keyword javaScriptCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType + syntax keyword javaScriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText + syntax keyword javaScriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor + + " Highlight ways + syntax match javaScriptDotNotation "\." nextgroup=javaScriptPrototype,javaScriptDomElemAttrs,javaScriptDomElemFuncs,javaScriptHtmlElemAttrs,javaScriptHtmlElemFuncs + syntax match javaScriptDotNotation "\.style\." nextgroup=javaScriptCssStyles + +endif "DOM/HTML/CSS + +"" end DOM/HTML/CSS specified things + + +"" Code blocks +syntax cluster javaScriptAll contains=javaScriptComment,javaScriptLineComment,javaScriptDocComment,javaScriptStringD,javaScriptStringS,javaScriptRegexpString,javaScriptNumber,javaScriptFloat,javaScriptLabel,javaScriptSource,javaScriptType,javaScriptOperator,javaScriptBoolean,javaScriptNull,javaScriptFunction,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptStatement,javaScriptGlobalObjects,javaScriptExceptions,javaScriptFutureKeys,javaScriptDomErrNo,javaScriptDomNodeConsts,javaScriptHtmlEvents,javaScriptDotNotation +syntax region javaScriptBracket matchgroup=javaScriptBracket transparent start="\[" end="\]" contains=@javaScriptAll,javaScriptParensErrB,javaScriptParensErrC,javaScriptBracket,javaScriptParen,javaScriptBlock,@htmlPreproc +syntax region javaScriptParen matchgroup=javaScriptParen transparent start="(" end=")" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrC,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc +syntax region javaScriptBlock matchgroup=javaScriptBlock transparent start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc + +"" catch errors caused by wrong parenthesis +syntax match javaScriptParensError ")\|}\|\]" +syntax match javaScriptParensErrA contained "\]" +syntax match javaScriptParensErrB contained ")" +syntax match javaScriptParensErrC contained "}" + +if main_syntax == "javascript" + syntax sync clear + syntax sync ccomment javaScriptComment minlines=200 + syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/ +endif + +"" Fold control +if exists("b:javascript_fold") + syntax match javaScriptFunction /\/ nextgroup=javaScriptFuncName skipwhite + syntax match javaScriptOpAssign /=\@= 508 || !exists("did_javascript_syn_inits") + if version < 508 + let did_javascript_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + HiLink javaScriptComment Comment + HiLink javaScriptLineComment Comment + HiLink javaScriptDocComment Comment + HiLink javaScriptCommentTodo Todo + HiLink javaScriptCvsTag Function + HiLink javaScriptDocTags Special + HiLink javaScriptDocSeeTag Function + HiLink javaScriptDocParam Function + HiLink javaScriptStringS String + HiLink javaScriptStringD String + HiLink javaScriptRegexpString String + HiLink javaScriptCharacter Character + HiLink javaScriptPrototype Type + HiLink javaScriptConditional Conditional + HiLink javaScriptBranch Conditional + HiLink javaScriptRepeat Repeat + HiLink javaScriptStatement Statement +" HiLink javaScriptFunction Function + HiLink javaScriptFunction Keyword + HiLink javaScriptError Error + HiLink javaScriptParensError Error + HiLink javaScriptParensErrA Error + HiLink javaScriptParensErrB Error + HiLink javaScriptParensErrC Error + HiLink javaScriptOperator Operator + HiLink javaScriptType Type + HiLink javaScriptNull Type + HiLink javaScriptNumber Number + HiLink javaScriptFloat Number + HiLink javaScriptBoolean Boolean + HiLink javaScriptLabel Label + HiLink javaScriptSpecial Special + HiLink javaScriptSource Special + HiLink javaScriptGlobalObjects Special + HiLink javaScriptExceptions Special + + HiLink javaScriptDomErrNo Constant + HiLink javaScriptDomNodeConsts Constant + HiLink javaScriptDomElemAttrs Label + HiLink javaScriptDomElemFuncs PreProc + + HiLink javaScriptHtmlEvents Special + HiLink javaScriptHtmlElemAttrs Label + HiLink javaScriptHtmlElemFuncs PreProc + + HiLink javaScriptCssStyles Label + + delcommand HiLink +endif + +" Define the htmlJavaScript for HTML syntax html.vim +"syntax clear htmlJavaScript +"syntax clear javaScriptExpression +syntax cluster htmlJavaScript contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError +syntax cluster javaScriptExpression contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError,@htmlPreproc + +let b:current_syntax = "javascript" +if main_syntax == 'javascript' + unlet main_syntax +endif + +" vim: ts=4 diff --git a/dot_vim/syntax/lilypond-words b/dot_vim/syntax/lilypond-words new file mode 100644 index 0000000..612d59b --- /dev/null +++ b/dot_vim/syntax/lilypond-words @@ -0,0 +1,1040 @@ +\\withMusicProperty +\\with +\\whiteTriangleMarkup +\\voiceTwoStyle +\\voiceTwo +\\voiceThreeStyle +\\voiceThree +\\voiceOneStyle +\\voiceOne +\\voiceNeutralStyle +\\voiceFourStyle +\\voiceFour +\\vocalName +\\virgula +\\virga +\\verylongfermata +\\verticallySpacedContexts +\\versus +\\version +\\varcoda +\\upprall +\\upmordent +\\upbow +\\up +\\unset +\\unit +\\unfoldRepeats +\\unaCorda +\\unHideNotes +\\type +\\tweak +\\turn +\\tupletUp +\\tupletNeutral +\\tupletDown +\\trill +\\treCorde +\\transposition +\\transposedCueDuring +\\transpose +\\tiny +\\timing +\\times +\\time +\\tildeSymbol +\\tieWaitForNote +\\tieUp +\\tieSolid +\\tieNeutral +\\tieDown +\\tieDotted +\\tieDashed +\\thumb +\\textSpannerUp +\\textSpannerNeutral +\\textSpannerDown +\\textLengthOn +\\textLengthOff +\\tenuto +\\tempoWholesPerMinute +\\tempo +\\teeny +\\tag +\\tablatureFormat +\\systemStartDelimiter +\\sustainOn +\\sustainOff +\\subdivideBeams +\\stropha +\\strokeFingerOrientations +\\stringTunings +\\stringOneTopmost +\\stringNumberOrientations +\\stopped +\\stopTrillSpan +\\stopTextSpan +\\stopStaff +\\stopGroup +\\stopGraceMusic +\\stopAppoggiaturaMusic +\\stopAcciaccaturaMusic +\\stop +\\stemUp +\\stemNeutral +\\stemDown +\\startTrillSpan +\\startTextSpan +\\startStaff +\\startGroup +\\startGraceMusic +\\startAppoggiaturaMusic +\\startAcciaccaturaMusic +\\start +\\staccato +\\staccatissimo +\\squashedPosition +\\spp +\\spacingTweaks +\\sp +\\sostenutoOn +\\sostenutoOff +\\soloText +\\soloIIText +\\smaller +\\small +\\slurUp +\\slurSolid +\\slurNeutral +\\slurDown +\\slurDotted +\\slurDashed +\\skipTypesetting +\\skip +\\simultaneous +\\signumcongruentiae +\\showStaffSwitch +\\shortfermata +\\shortVocalName +\\shortInstrumentName +\\shiftOnnn +\\shiftOnn +\\shiftOn +\\shiftOff +\\shiftDurations +\\sfz +\\sfp +\\sff +\\sf +\\setDefaultDurationToQuarter +\\set +\\sequential +\\semicirculus +\\semiGermanChords +\\segno +\\scriptDefinitions +\\scoreTweak +\\score +\\scaleDurations +\\sacredHarpHeads +\\rtoe +\\rightHandFinger +\\right +\\rheel +\\rfz +\\revert +\\reverseturn +\\rest +\\responsum +\\resetRelativeOctave +\\repeatTie +\\repeatCountVisibility +\\repeat +\\removeWithTag +\\remove +\\relative +\\rehearsalMark +\\quotedEventTypes +\\quoteDuring +\\quilisma +\\pt +\\printPartCombineTexts +\\printKeyCancellation +\\predefinedFretboardsOn +\\predefinedFretboardsOff +\\predefinedDiagramTable +\\prallup +\\prallprall +\\prallmordent +\\pralldown +\\prall +\\ppppp +\\pppp +\\ppp +\\pp +\\portato +\\pointAndClickOn +\\pointAndClickOff +\\pitchedTrill +\\pipeSymbol +\\phrygian +\\phrasingSlurUp +\\phrasingSlurSolid +\\phrasingSlurNeutral +\\phrasingSlurDown +\\phrasingSlurDotted +\\phrasingSlurDashed +\\pes +\\pedalUnaCordaStyle +\\pedalUnaCordaStrings +\\pedalSustainStyle +\\pedalSustainStrings +\\pedalSostenutoStyle +\\pedalSostenutoStrings +\\partialJazzMusic +\\partialJazzExceptions +\\partial +\\partcombine +\\partCombineListener +\\parenthesize +\\parenthesisOpenSymbol +\\parenthesisCloseSymbol +\\parallelMusic +\\paper +\\pageTurn +\\pageBreak +\\p +\\overrideProperty +\\override +\\ottava +\\oriscus +\\open +\\oneVoice +\\once +\\octaveCheck +\\objectid +\\numericTimeSignature +\\notemode +\\noteToFretFunction +\\normalsize +\\noPageTurn +\\noPageBreak +\\noBreak +\\noBeam +\\newSpacingSection +\\new +\\neumeDemoLayout +\\name +\\musicMap +\\mp +\\mordent +\\mm +\\mixolydian +\\minor +\\midiInstrument +\\midi +\\middleCPosition +\\middleCClefPosition +\\mf +\\metronomeMarkFormatter +\\mergeDifferentlyHeadedOn +\\mergeDifferentlyHeadedOff +\\mergeDifferentlyDottedOn +\\mergeDifferentlyDottedOff +\\melismaEnd +\\melismaBusyProperties +\\melisma +\\maxima +\\markuplines +\\markup +\\markFormatter +\\mark +\\marcato +\\makeClusters +\\majorSevenSymbol +\\major +\\maininput +\\lyricsto +\\lyrics +\\lyricmode +\\lyricMelismaAlignment +\\lydian +\\ltoe +\\longfermata +\\longa +\\locrian +\\localKeySignature +\\lineprall +\\linea +\\ligature +\\lheel +\\left +\\layout +\\large +\\laissezVibrer +\\label +\\killCues +\\keyAlterationOrder +\\key +\\keepWithTag +\\keepAliveInterfaces +\\italianChords +\\ionian +\\interscoreline +\\instrumentTransposition +\\instrumentSwitch +\\instrumentName +\\instrumentEqualizer +\\indent +\\includePageLayoutFile +\\include +\\inclinatum +\\in +\\improvisationOn +\\improvisationOff +\\implicitTimeSignatureVisibility +\\ij +\\iij +\\ignoreFiguredBassRest +\\ignoreBarChecks +\\ignatzekExceptions +\\ignatzekExceptionMusic +\\ictus +\\huge +\\highStringOne +\\hideStaffSwitch +\\hideNotes +\\header +\\harmonicAccidentals +\\harmonic +\\grobdescriptions +\\graceSettings +\\grace +\\glissando +\\germanChords +\\fz +\\fullJazzExceptions +\\frenchChords +\\fp +\\fontSize +\\flexa +\\flageolet +\\firstClef +\\fingeringOrientations +\\finalis +\\figures +\\figuremode +\\figuredBassFormatter +\\ffff +\\fff +\\ff +\\fermataMarkup +\\fermata +\\featherDurations +\\f +\\extraNatural +\\explicitKeySignatureVisibility +\\explicitClefVisibility +\\expandFullBarRests +\\espressivo +\\escapedSmallerSymbol +\\escapedParenthesisOpenSymbol +\\escapedParenthesisCloseSymbol +\\escapedExclamationSymbol +\\escapedBiggerSymbol +\\episemInitium +\\episemFinis +\\endincipit +\\enddim +\\enddecr +\\endcresc +\\endcr +\\endSpanners +\\easyHeadsOn +\\easyHeadsOff +\\dynamicUp +\\dynamicNeutral +\\dynamicDown +\\dynamicAbsoluteVolumeFunction +\\drums +\\drummode +\\drumStyleTable +\\drumPitchTable +\\downprall +\\downmordent +\\downbow +\\down +\\doubleRepeatType +\\dotsUp +\\dotsNeutral +\\dotsDown +\\dorian +\\divisioMinima +\\divisioMaxima +\\divisioMaior +\\displayMusic +\\displayLilyMusic +\\dimTextDim +\\dimTextDecresc +\\dimTextDecr +\\dimHairpin +\\dim +\\description +\\descendens +\\denies +\\deminutum +\\defaultchild +\\defaultTimeSignature +\\defaultBarType +\\default +\\decrescendoSpanner +\\decr +\\dashUnderscore +\\dashPlus +\\dashLarger +\\dashHat +\\dashDot +\\dashDash +\\dashBar +\\cueDuring +\\crescendoSpanner +\\crescTextCresc +\\crescHairpin +\\cresc +\\createSpacing +\\cr +\\context +\\consists +\\compressFullBarRests +\\coda +\\cm +\\clefPosition +\\clefOctavation +\\clefGlyph +\\clef +\\circulus +\\chords +\\chordmodifiers +\\chordmode +\\chordRootNamer +\\chordPrefixSpacer +\\chordNoteNamer +\\chordNameSeparator +\\chordNameFunction +\\chordNameExceptionsPartial +\\chordNameExceptionsFull +\\chordNameExceptions +\\change +\\center +\\cavum +\\caesura +\\cadenzaOn +\\cadenzaOff +\\breve +\\breathe +\\break +\\bracketOpenSymbol +\\bracketCloseSymbol +\\bookpart +\\book +\\blackTriangleMarkup +\\bigger +\\bendAfter +\\bassStaffProperties +\\bassFigureStaffAlignmentUp +\\bassFigureStaffAlignmentNeutral +\\bassFigureStaffAlignmentDown +\\bassFigureExtendersOn +\\bassFigureExtendersOff +\\barNumberVisibility +\\barNumberCheck +\\barCheckSynchronize +\\barAlways +\\bar +\\balloonText +\\balloonLengthOn +\\balloonLengthOff +\\balloonGrobText +\\automaticBars +\\autochange +\\autoCautionaries +\\autoBeaming +\\autoBeamSettings +\\autoBeamOn +\\autoBeamOff +\\autoBeamCheck +\\autoAccidentals +\\augmentum +\\auctum +\\assertBeamSlope +\\assertBeamQuant +\\ascendens +\\arpeggioParenthesis +\\arpeggioNormal +\\arpeggioBracket +\\arpeggioArrowUp +\\arpeggioArrowDown +\\arpeggio +\\appoggiatura +\\applyOutput +\\applyMusic +\\applyContext +\\alternative +\\allowPageTurn +\\alias +\\aikenHeads +\\afterGraceFraction +\\afterGrace +\\aeolian +\\addlyrics +\\addQuote +\\addInstrumentDefinition +\\acciaccatura +\\accepts +\\accentus +\\accent +\\aDueText +\\RemoveEmptyStaffContext +\\RemoveEmptyRhythmicStaffContext +\\IJ +\\IIJ +\\C +\\B +\\AncientRemoveEmptyStaffContext +\\A +strings +Volta_engraver +Voice +Vertically_spaced_contexts_engraver +Vertical_align_engraver +Vaticana_ligature_engraver +VaticanaVoice +VaticanaStaff +Tweak_engraver +Tuplet_engraver +Trill_spanner_engraver +Timing_translator +Time_signature_performer +Time_signature_engraver +Tie_performer +Tie_engraver +Text_spanner_engraver +Text_engraver +Tempo_performer +Tab_staff_symbol_engraver +Tab_note_heads_engraver +Tab_harmonic_engraver +TabVoice +TabStaff +System_start_delimiter_engraver +Swallow_performer +Swallow_engraver +String_number_engraver +Stem_engraver +Stanza_number_engraver +Stanza_number_align_engraver +Staff_symbol_engraver +Staff_performer +Staff_collecting_engraver +StaffGroup +Staff +Spanner_break_forbid_engraver +Span_bar_engraver +Span_arpeggio_engraver +Spacing_engraver +Slur_performer +Slur_engraver +Slash_repeat_engraver +Skip_event_swallow_translator +Separating_line_group_engraver +Script_row_engraver +Script_engraver +Script_column_engraver +Score +Rhythmic_column_engraver +RhythmicStaff +Rest_swallow_translator +Rest_engraver +Rest_collision_engraver +Repeat_tie_engraver +Repeat_acknowledge_engraver +Pitched_trill_engraver +Pitch_squash_engraver +Piano_pedal_performer +Piano_pedal_engraver +Piano_pedal_align_engraver +PianoStaff +Phrasing_slur_engraver +Percent_repeat_engraver +Part_combine_engraver +Parenthesis_engraver +Paper_column_engraver +Output_property_engraver +Ottava_spanner_engraver +Note_swallow_translator +Note_spacing_engraver +Note_performer +Note_name_engraver +Note_heads_engraver +Note_head_line_engraver +NoteNames +New_fingering_engraver +New_dynamic_engraver +Multi_measure_rest_engraver +Metronome_mark_engraver +Mensural_ligature_engraver +MensuralVoice +MensuralStaff +Mark_engraver +Lyrics +Lyric_performer +Lyric_engraver +Ligature_bracket_engraver +Ledger_line_engraver +Laissez_vibrer_engraver +Key_performer +Key_engraver +Instrument_switch_engraver +Instrument_name_engraver +Hyphen_engraver +Hara_kiri_engraver +Grob_pq_engraver +GregorianTranscriptionVoice +GregorianTranscriptionStaff +GrandStaff +Grace_spacing_engraver +Grace_engraver +Grace_beam_engraver +Global +Glissando_engraver +Fretboard_engraver +FretBoards +Forbid_line_break_engraver +Font_size_engraver +Fingering_engraver +Figured_bass_position_engraver +Figured_bass_engraver +FiguredBass +Extender_engraver +Dynamic_performer +Dynamic_align_engraver +Drum_notes_engraver +Drum_note_performer +DrumVoice +DrumStaff +Dots_engraver +Dot_column_engraver +Devnull +Default_bar_line_engraver +Custos_engraver +CueVoice +Control_track_performer +Collision_engraver +Cluster_spanner_engraver +Clef_engraver +Chord_tremolo_engraver +Chord_name_engraver +ChordNames +ChordNameVoice +ChoirStaff +Breathing_sign_engraver +Break_align_engraver +Bend_engraver +Beam_performer +Beam_engraver +Bar_number_engraver +Bar_engraver +Axis_group_engraver +Auto_beam_engraver +Arpeggio_engraver +Accidental_engraver +vibraslap +twoup +twodown +tt +triangle +threeup +threedown +tambourine +splashcymbal +solstqt +solss +solsqt +solsd +solsb +sols +solkk +solk +soldsd +soldd +sold +solbtqt +solbsb +solbqt +solbb +solb +sol +snare +sistqt +siss +sisqt +sisd +sisb +sis +sikk +sik +sidsd +sidestick +sidd +sid +sibtqt +sibsb +sibqt +sibb +sib +si +shortwhistle +shortguiro +ridecymbalb +ridecymbala +ridecymbal +ridebell +restqt +ress +resqt +resd +resb +res +rekk +rek +redsd +redd +red +rebtqt +rebsb +rebqt +rebb +reb +re +pedalhihat +opentriangle +openloconga +openlobongo +openhihat +openhiconga +openhibongo +opencuica +oneup +onedown +mutetriangle +muteloconga +mutelobongo +mutehiconga +mutehibongo +mutecuica +mistqt +miss +misqt +misd +misb +mis +mikk +mik +midsd +midd +mid +mibtqt +mibsb +mibqt +mibb +mib +mi +maracas +lowtom +lowoodblock +lowmidtom +lowfloortom +lotimbale +losidestick +longwhistle +longguiro +loconga +lobongo +loagogo +lastqt +lass +lasqt +lasd +lasb +las +lakk +lak +ladsd +ladd +lad +labtqt +labsb +labqt +labb +lab +la +hiwoodblock +hitimbale +hississ +hiss +hisis +hisih +hisidestick +his +himidtom +hihat +hih +hightom +highfloortom +hiconga +hibongo +hiagogo +hessess +heses +heseh +handclap +halfopenhihat +h +gx +guiro +gtqs +gtqf +gss +gsharpsharp +gsharp +gs +gqs +gqf +gississ +giss +gisis +gisih +gis +gih +gflatflat +gflat +gff +gf +gessess +gess +geses +geseh +ges +geh +g +fx +ftqs +ftqf +fss +fsharpsharp +fsharp +fs +fqs +fqf +fourup +fourdown +fiveup +fivedown +fississ +fiss +fisis +fisih +fis +fih +fflatflat +fflat +fff +ff +fessess +fess +feses +feseh +fes +feh +fastqt +fass +fasqt +fasd +fasb +fas +fakk +fak +fadsd +fadd +fad +fabtqt +fabsb +fabqt +fabb +fab +fa +f +ex +etqs +etqf +essess +ess +esharpsharp +esharp +eses +eseh +es +eqs +eqf +electricsnare +eississ +eiss +eisis +eisih +eis +eih +eflatflat +eflat +eff +ef +eessess +eess +eeses +eeseh +ees +eeh +e +dx +dtqs +dtqf +dss +dsharpsharp +dsharp +ds +dqs +dqf +dostqt +doss +dosqt +dosd +dosb +dos +dokk +dok +dodsd +dodd +dod +dobtqt +dobsb +dobqt +dobb +dob +do +dississ +diss +disis +disih +dis +dih +dflatflat +dflat +dff +df +dessess +dess +deses +deseh +des +deh +d +cx +ctqs +ctqf +css +csharpsharp +csharp +cs +crashcymbalb +crashcymbala +crashcymbal +cqs +cqf +cowbell +closedhihat +claves +cississ +ciss +cisis +cisih +cis +cih +chinesecymbal +cflatflat +cflat +cff +cf +cessess +cess +ceses +ceseh +ces +ceh +cabasa +c +bx +btqs +btqf +bss +bsharpsharp +bsharp +bs +bqs +bqf +bisis +bisih +bis +bih +bflatflat +bflat +bff +bf +bess +beses +beseh +bes +beh +bb +bassdrum +b +ax +atqs +atqf +assess +ass +asharpsharp +asharp +ases +aseh +asas +asah +as +aqs +aqf +aississ +aiss +aisis +aisih +ais +aih +aflatflat +aflat +aff +af +aessess +aess +aeses +aeseh +aes +aeh +acousticsnare +a diff --git a/dot_vim/syntax/lilypond-words.vim b/dot_vim/syntax/lilypond-words.vim new file mode 100644 index 0000000..cd4eb57 --- /dev/null +++ b/dot_vim/syntax/lilypond-words.vim @@ -0,0 +1,3 @@ +syn match lilyKeyword "[-_^]\?\\\(withMusicProperty\|with\|whiteTriangleMarkup\|voiceTwoStyle\|voiceTwo\|voiceThreeStyle\|voiceThree\|voiceOneStyle\|voiceOne\|voiceNeutralStyle\|voiceFourStyle\|voiceFour\|vocalName\|virgula\|virga\|verylongfermata\|verticallySpacedContexts\|versus\|version\|varcoda\|upprall\|upmordent\|upbow\|up\|unset\|unit\|unfoldRepeats\|unaCorda\|unHideNotes\|type\|tweak\|turn\|tupletUp\|tupletNeutral\|tupletDown\|trill\|treCorde\|transposition\|transposedCueDuring\|transpose\|tiny\|timing\|times\|time\|tildeSymbol\|tieWaitForNote\|tieUp\|tieSolid\|tieNeutral\|tieDown\|tieDotted\|tieDashed\|thumb\|textSpannerUp\|textSpannerNeutral\|textSpannerDown\|textLengthOn\|textLengthOff\|tenuto\|tempoWholesPerMinute\|tempo\|teeny\|tag\|tablatureFormat\|systemStartDelimiter\|sustainOn\|sustainOff\|subdivideBeams\|stropha\|strokeFingerOrientations\|stringTunings\|stringOneTopmost\|stringNumberOrientations\|stopped\|stopTrillSpan\|stopTextSpan\|stopStaff\|stopGroup\|stopGraceMusic\|stopAppoggiaturaMusic\|stopAcciaccaturaMusic\|stop\|stemUp\|stemNeutral\|stemDown\|startTrillSpan\|startTextSpan\|startStaff\|startGroup\|startGraceMusic\|startAppoggiaturaMusic\|startAcciaccaturaMusic\|start\|staccato\|staccatissimo\|squashedPosition\|spp\|spacingTweaks\|sp\|sostenutoOn\|sostenutoOff\|soloText\|soloIIText\|smaller\|small\|slurUp\|slurSolid\|slurNeutral\|slurDown\|slurDotted\|slurDashed\|skipTypesetting\|skip\|simultaneous\|signumcongruentiae\|showStaffSwitch\|shortfermata\|shortVocalName\|shortInstrumentName\|shiftOnnn\|shiftOnn\|shiftOn\|shiftOff\|shiftDurations\|sfz\|sfp\|sff\|sf\|setDefaultDurationToQuarter\|set\|sequential\|semicirculus\|semiGermanChords\|segno\|scriptDefinitions\|scoreTweak\|score\|scaleDurations\|sacredHarpHeads\|rtoe\|rightHandFinger\|right\|rheel\|rfz\|revert\|reverseturn\|rest\|responsum\|resetRelativeOctave\|repeatTie\|repeatCountVisibility\|repeat\|removeWithTag\|remove\|relative\|rehearsalMark\|quotedEventTypes\|quoteDuring\|quilisma\|pt\|printPartCombineTexts\|printKeyCancellation\|predefinedFretboardsOn\|predefinedFretboardsOff\|predefinedDiagramTable\|prallup\|prallprall\|prallmordent\|pralldown\|prall\|ppppp\|pppp\|ppp\|pp\|portato\|pointAndClickOn\|pointAndClickOff\|pitchedTrill\|pipeSymbol\|phrygian\|phrasingSlurUp\|phrasingSlurSolid\|phrasingSlurNeutral\|phrasingSlurDown\|phrasingSlurDotted\|phrasingSlurDashed\|pes\|pedalUnaCordaStyle\|pedalUnaCordaStrings\|pedalSustainStyle\|pedalSustainStrings\|pedalSostenutoStyle\|pedalSostenutoStrings\|partialJazzMusic\|partialJazzExceptions\|partial\|partcombine\|partCombineListener\|parenthesize\|parenthesisOpenSymbol\|parenthesisCloseSymbol\|parallelMusic\|paper\|pageTurn\|pageBreak\|p\|overrideProperty\|override\|ottava\|oriscus\|open\|oneVoice\|once\|octaveCheck\|objectid\|numericTimeSignature\|notemode\|noteToFretFunction\|normalsize\|noPageTurn\|noPageBreak\|noBreak\|noBeam\|newSpacingSection\|new\|neumeDemoLayout\|name\|musicMap\|mp\|mordent\|mm\|mixolydian\|minor\|midiInstrument\|midi\|middleCPosition\|middleCClefPosition\|mf\|metronomeMarkFormatter\|mergeDifferentlyHeadedOn\|mergeDifferentlyHeadedOff\|mergeDifferentlyDottedOn\|mergeDifferentlyDottedOff\|melismaEnd\|melismaBusyProperties\|melisma\|maxima\|markuplines\|markup\|markFormatter\|mark\|marcato\|makeClusters\|majorSevenSymbol\|major\|maininput\|lyricsto\|lyrics\|lyricmode\|lyricMelismaAlignment\|lydian\|ltoe\|longfermata\|longa\|locrian\|localKeySignature\|lineprall\|linea\|ligature\|lheel\|left\|layout\|large\|laissezVibrer\|label\|killCues\|keyAlterationOrder\|key\|keepWithTag\|keepAliveInterfaces\|italianChords\|ionian\|interscoreline\|instrumentTransposition\|instrumentSwitch\|instrumentName\|instrumentEqualizer\|indent\|includePageLayoutFile\|include\|inclinatum\|in\|improvisationOn\|improvisationOff\|implicitTimeSignatureVisibility\|ij\|iij\|ignoreFiguredBassRest\|ignoreBarChecks\|ignatzekExceptions\|ignatzekExceptionMusic\|ictus\|huge\|highStringOne\|hideStaffSwitch\|hideNotes\|header\|harmonicAccidentals\|harmonic\|grobdescriptions\|graceSettings\|grace\|glissando\|germanChords\|fz\|fullJazzExceptions\|frenchChords\|fp\|fontSize\|flexa\|flageolet\|firstClef\|fingeringOrientations\|finalis\|figures\|figuremode\|figuredBassFormatter\|ffff\|fff\|ff\|fermataMarkup\|fermata\|featherDurations\|f\|extraNatural\|explicitKeySignatureVisibility\|explicitClefVisibility\|expandFullBarRests\|espressivo\|escapedSmallerSymbol\|escapedParenthesisOpenSymbol\|escapedParenthesisCloseSymbol\|escapedExclamationSymbol\|escapedBiggerSymbol\|episemInitium\|episemFinis\|endincipit\|enddim\|enddecr\|endcresc\|endcr\|endSpanners\|easyHeadsOn\|easyHeadsOff\|dynamicUp\|dynamicNeutral\|dynamicDown\|dynamicAbsoluteVolumeFunction\|drums\|drummode\|drumStyleTable\|drumPitchTable\|downprall\|downmordent\|downbow\|down\|doubleRepeatType\|dotsUp\|dotsNeutral\|dotsDown\|dorian\|divisioMinima\|divisioMaxima\|divisioMaior\|displayMusic\|displayLilyMusic\|dimTextDim\|dimTextDecresc\|dimTextDecr\|dimHairpin\|dim\|description\|descendens\|denies\|deminutum\|defaultchild\|defaultTimeSignature\|defaultBarType\|default\|decrescendoSpanner\|decr\|dashUnderscore\|dashPlus\|dashLarger\|dashHat\|dashDot\|dashDash\|dashBar\|cueDuring\|crescendoSpanner\|crescTextCresc\|crescHairpin\|cresc\|createSpacing\|cr\|context\|consists\|compressFullBarRests\|coda\|cm\|clefPosition\|clefOctavation\|clefGlyph\|clef\|circulus\|chords\|chordmodifiers\|chordmode\|chordRootNamer\|chordPrefixSpacer\|chordNoteNamer\|chordNameSeparator\|chordNameFunction\|chordNameExceptionsPartial\|chordNameExceptionsFull\|chordNameExceptions\|change\|center\|cavum\|caesura\|cadenzaOn\|cadenzaOff\|breve\|breathe\|break\|bracketOpenSymbol\|bracketCloseSymbol\|bookpart\|book\|blackTriangleMarkup\|bigger\|bendAfter\|bassStaffProperties\|bassFigureStaffAlignmentUp\|bassFigureStaffAlignmentNeutral\|bassFigureStaffAlignmentDown\|bassFigureExtendersOn\|bassFigureExtendersOff\|barNumberVisibility\|barNumberCheck\|barCheckSynchronize\|barAlways\|bar\|balloonText\|balloonLengthOn\|balloonLengthOff\|balloonGrobText\|automaticBars\|autochange\|autoCautionaries\|autoBeaming\|autoBeamSettings\|autoBeamOn\|autoBeamOff\|autoBeamCheck\|autoAccidentals\|augmentum\|auctum\|assertBeamSlope\|assertBeamQuant\|ascendens\|arpeggioParenthesis\|arpeggioNormal\|arpeggioBracket\|arpeggioArrowUp\|arpeggioArrowDown\|arpeggio\|appoggiatura\|applyOutput\|applyMusic\|applyContext\|alternative\|allowPageTurn\|alias\|aikenHeads\|afterGraceFraction\|afterGrace\|aeolian\|addlyrics\|addQuote\|addInstrumentDefinition\|acciaccatura\|accepts\|accentus\|accent\|aDueText\|RemoveEmptyStaffContext\|RemoveEmptyRhythmicStaffContext\|IJ\|IIJ\|C\|B\|AncientRemoveEmptyStaffContext\|A\|n\)\(\A\|\n\)"me=e-1 +syn match lilyReservedWord "\(\A\|\n\)\(strings\|Volta_engraver\|Voice\|Vertically_spaced_contexts_engraver\|Vertical_align_engraver\|Vaticana_ligature_engraver\|VaticanaVoice\|VaticanaStaff\|Tweak_engraver\|Tuplet_engraver\|Trill_spanner_engraver\|Timing_translator\|Time_signature_performer\|Time_signature_engraver\|Tie_performer\|Tie_engraver\|Text_spanner_engraver\|Text_engraver\|Tempo_performer\|Tab_staff_symbol_engraver\|Tab_note_heads_engraver\|Tab_harmonic_engraver\|TabVoice\|TabStaff\|System_start_delimiter_engraver\|Swallow_performer\|Swallow_engraver\|String_number_engraver\|Stem_engraver\|Stanza_number_engraver\|Stanza_number_align_engraver\|Staff_symbol_engraver\|Staff_performer\|Staff_collecting_engraver\|StaffGroup\|Staff\|Spanner_break_forbid_engraver\|Span_bar_engraver\|Span_arpeggio_engraver\|Spacing_engraver\|Slur_performer\|Slur_engraver\|Slash_repeat_engraver\|Skip_event_swallow_translator\|Separating_line_group_engraver\|Script_row_engraver\|Script_engraver\|Script_column_engraver\|Score\|Rhythmic_column_engraver\|RhythmicStaff\|Rest_swallow_translator\|Rest_engraver\|Rest_collision_engraver\|Repeat_tie_engraver\|Repeat_acknowledge_engraver\|Pitched_trill_engraver\|Pitch_squash_engraver\|Piano_pedal_performer\|Piano_pedal_engraver\|Piano_pedal_align_engraver\|PianoStaff\|Phrasing_slur_engraver\|Percent_repeat_engraver\|Part_combine_engraver\|Parenthesis_engraver\|Paper_column_engraver\|Output_property_engraver\|Ottava_spanner_engraver\|Note_swallow_translator\|Note_spacing_engraver\|Note_performer\|Note_name_engraver\|Note_heads_engraver\|Note_head_line_engraver\|NoteNames\|New_fingering_engraver\|New_dynamic_engraver\|Multi_measure_rest_engraver\|Metronome_mark_engraver\|Mensural_ligature_engraver\|MensuralVoice\|MensuralStaff\|Mark_engraver\|Lyrics\|Lyric_performer\|Lyric_engraver\|Ligature_bracket_engraver\|Ledger_line_engraver\|Laissez_vibrer_engraver\|Key_performer\|Key_engraver\|Instrument_switch_engraver\|Instrument_name_engraver\|Hyphen_engraver\|Hara_kiri_engraver\|Grob_pq_engraver\|GregorianTranscriptionVoice\|GregorianTranscriptionStaff\|GrandStaff\|Grace_spacing_engraver\|Grace_engraver\|Grace_beam_engraver\|Global\|Glissando_engraver\|Fretboard_engraver\|FretBoards\|Forbid_line_break_engraver\|Font_size_engraver\|Fingering_engraver\|Figured_bass_position_engraver\|Figured_bass_engraver\|FiguredBass\|Extender_engraver\|Dynamic_performer\|Dynamic_align_engraver\|Drum_notes_engraver\|Drum_note_performer\|DrumVoice\|DrumStaff\|Dots_engraver\|Dot_column_engraver\|Devnull\|Default_bar_line_engraver\|Custos_engraver\|CueVoice\|Control_track_performer\|Collision_engraver\|Cluster_spanner_engraver\|Clef_engraver\|Chord_tremolo_engraver\|Chord_name_engraver\|ChordNames\|ChordNameVoice\|ChoirStaff\|Breathing_sign_engraver\|Break_align_engraver\|Bend_engraver\|Beam_performer\|Beam_engraver\|Bar_number_engraver\|Bar_engraver\|Axis_group_engraver\|Auto_beam_engraver\|Arpeggio_engraver\|Accidental_engraver\|Score\)\(\A\|\n\)"ms=s+1,me=e-1 +syn match lilyNote "\<\(\(\(vibraslap\|twoup\|twodown\|tt\|triangle\|threeup\|threedown\|tambourine\|splashcymbal\|solstqt\|solss\|solsqt\|solsd\|solsb\|sols\|solkk\|solk\|soldsd\|soldd\|sold\|solbtqt\|solbsb\|solbqt\|solbb\|solb\|sol\|snare\|sistqt\|siss\|sisqt\|sisd\|sisb\|sis\|sikk\|sik\|sidsd\|sidestick\|sidd\|sid\|sibtqt\|sibsb\|sibqt\|sibb\|sib\|si\|shortwhistle\|shortguiro\|ridecymbalb\|ridecymbala\|ridecymbal\|ridebell\|restqt\|ress\|resqt\|resd\|resb\|res\|rekk\|rek\|redsd\|redd\|red\|rebtqt\|rebsb\|rebqt\|rebb\|reb\|re\|pedalhihat\|opentriangle\|openloconga\|openlobongo\|openhihat\|openhiconga\|openhibongo\|opencuica\|oneup\|onedown\|mutetriangle\|muteloconga\|mutelobongo\|mutehiconga\|mutehibongo\|mutecuica\|mistqt\|miss\|misqt\|misd\|misb\|mis\|mikk\|mik\|midsd\|midd\|mid\|mibtqt\|mibsb\|mibqt\|mibb\|mib\|mi\|maracas\|lowtom\|lowoodblock\|lowmidtom\|lowfloortom\|lotimbale\|losidestick\|longwhistle\|longguiro\|loconga\|lobongo\|loagogo\|lastqt\|lass\|lasqt\|lasd\|lasb\|las\|lakk\|lak\|ladsd\|ladd\|lad\|labtqt\|labsb\|labqt\|labb\|lab\|la\|hiwoodblock\|hitimbale\|hississ\|hiss\|hisis\|hisih\|hisidestick\|his\|himidtom\|hihat\|hih\|hightom\|highfloortom\|hiconga\|hibongo\|hiagogo\|hessess\|heses\|heseh\|handclap\|halfopenhihat\|h\|gx\|guiro\|gtqs\|gtqf\|gss\|gsharpsharp\|gsharp\|gs\|gqs\|gqf\|gississ\|giss\|gisis\|gisih\|gis\|gih\|gflatflat\|gflat\|gff\|gf\|gessess\|gess\|geses\|geseh\|ges\|geh\|g\|fx\|ftqs\|ftqf\|fss\|fsharpsharp\|fsharp\|fs\|fqs\|fqf\|fourup\|fourdown\|fiveup\|fivedown\|fississ\|fiss\|fisis\|fisih\|fis\|fih\|fflatflat\|fflat\|fff\|ff\|fessess\|fess\|feses\|feseh\|fes\|feh\|fastqt\|fass\|fasqt\|fasd\|fasb\|fas\|fakk\|fak\|fadsd\|fadd\|fad\|fabtqt\|fabsb\|fabqt\|fabb\|fab\|fa\|f\|ex\|etqs\|etqf\|essess\|ess\|esharpsharp\|esharp\|eses\|eseh\|es\|eqs\|eqf\|electricsnare\|eississ\|eiss\|eisis\|eisih\|eis\|eih\|eflatflat\|eflat\|eff\|ef\|eessess\|eess\|eeses\|eeseh\|ees\|eeh\|e\|dx\|dtqs\|dtqf\|dss\|dsharpsharp\|dsharp\|ds\|dqs\|dqf\|dostqt\|doss\|dosqt\|dosd\|dosb\|dos\|dokk\|dok\|dodsd\|dodd\|dod\|dobtqt\|dobsb\|dobqt\|dobb\|dob\|do\|dississ\|diss\|disis\|disih\|dis\|dih\|dflatflat\|dflat\|dff\|df\|dessess\|dess\|deses\|deseh\|des\|deh\|d\|cx\|ctqs\|ctqf\|css\|csharpsharp\|csharp\|cs\|crashcymbalb\|crashcymbala\|crashcymbal\|cqs\|cqf\|cowbell\|closedhihat\|claves\|cississ\|ciss\|cisis\|cisih\|cis\|cih\|chinesecymbal\|cflatflat\|cflat\|cff\|cf\|cessess\|cess\|ceses\|ceseh\|ces\|ceh\|cabasa\|c\|bx\|btqs\|btqf\|bss\|bsharpsharp\|bsharp\|bs\|bqs\|bqf\|bisis\|bisih\|bis\|bih\|bflatflat\|bflat\|bff\|bf\|bess\|beses\|beseh\|bes\|beh\|bb\|bassdrum\|b\|ax\|atqs\|atqf\|assess\|ass\|asharpsharp\|asharp\|ases\|aseh\|asas\|asah\|as\|aqs\|aqf\|aississ\|aiss\|aisis\|aisih\|ais\|aih\|aflatflat\|aflat\|aff\|af\|aessess\|aess\|aeses\|aeseh\|aes\|aeh\|acousticsnare\|a\|a\)\([,']\)\{,4}\([?!]\)\?\)\|s\|r\)\(\(128\|64\|32\|16\|8\|4\|2\|1\|\\breve\|\\longa\|\\maxima\)[.]\{,8}\)\?\(\A\|\n\)"me=e-1 diff --git a/dot_vim/syntax/lilypond.vim b/dot_vim/syntax/lilypond.vim new file mode 100644 index 0000000..7d0a6d8 --- /dev/null +++ b/dot_vim/syntax/lilypond.vim @@ -0,0 +1,83 @@ +" LilyPond syntax file +" Language: LilyPond +" Maintainer: Heikki Junes +" Created: Oct 17, 2002 +" Last Change: Sep 23, 2003 +" Version: 6.1-1 +" +" Installed As: vim/syntax/lilypond.vim +" Uses Generated File: vim/syntax/lilypond-words.vim +" +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Read the LilyPond syntax match groups: +" lilyKeyword, lilyReservedWord, lilyNote +if version < 600 + so :p:h/lilypond-words.vim +else + runtime! syntax/lilypond-words.vim + if exists("b:current_syntax") + unlet b:current_syntax + endif +endif + +" Match also parethesis of angle type +setlocal mps+=<:> + +" Case matters +syn case match + +syn cluster lilyMatchGroup contains=lilyMatcher,lilyString,lilyComment,lilyStatement,lilyNumber,lilyEquation,lilySlur,lilySpecial,lilyNote,lilyKeyword,lilyArticulation,lilyReservedWord + +syn region lilyMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[<>]" end="}" contains=@lilyMatchGroup fold +syn region lilyMatcher matchgroup=Delimiter start="\[" end="]" contains=@lilyMatchGroup fold +syn region lilyMatcher matchgroup=Delimiter start="<" skip="\\\\\|\\[{<>}]" end=">" contains=@lilyMatchGroup fold + +syn region lilyString start=/"/ end=/"/ skip=/\\"/ +syn region lilyComment start="%{" skip="%$" end="%}" +syn region lilyComment start="%\([^{]\|$\)" end="$" + +syn match lilyNumber "[-_^.]\?\d\+[.]\?" +syn match lilyEquation "\(#['`]\)\?\(\a*[-]\)*\a*\s*=\s*\(#[#'`]\?\)\?\a*" +syn match lilySlur "[(~)]" +syn match lilySlur "\\[()]" +syn match lilySpecial "\\[\\]" +" avoid highlighting the extra character in situations like +" c--\mf c^^\mf c__\mf +syn match lilyArticulation "[-_^][-_^+|>.]" + +" Rest of syntax highlighting rules start here +" +" " Define the default highlighting. +" " For version 5.7 and earlier: only when not done already +" " For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_lily_syn_inits") + if version < 508 + let did_lily_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink Delimiter Identifier + + HiLink lilyString String + HiLink lilyComment Comment + + HiLink lilyNote Identifier + HiLink lilyArticulation PreProc + HiLink lilyKeyword Keyword + HiLink lilyReservedWord Type + + HiLink lilyNumber Constant + HiLink lilySpecial Special + HiLink lilySlur ModeMsg + + delcommand HiLink +endif diff --git a/dot_vim/syntax/mako.vim b/dot_vim/syntax/mako.vim new file mode 100644 index 0000000..a9244a2 --- /dev/null +++ b/dot_vim/syntax/mako.vim @@ -0,0 +1,83 @@ +" Vim syntax file +" Language: Mako +" Maintainer: Armin Ronacher +" URL: http://lucumr.pocoo.org/ +" Last Change: 2007 April 8 +" Version: 0.6 +" +" Known Limitations +" the <%text> block does not have correct attributes + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +if !exists("main_syntax") + let main_syntax = "html" +endif + +"Source the html syntax file +ru! syntax/html.vim +unlet b:current_syntax + +"Put the python syntax file in @pythonTop +syn include @pythonTop syntax/python.vim + +" End keywords +syn keyword makoEnd contained endfor endwhile endif endtry enddef + +" Block rules +syn region makoLine matchgroup=makoDelim start=#%\s*# end=#$# keepend contains=@pythonTop,makoEnd +syn region makoBlock matchgroup=makoDelim start=#<%!\?# end=#%># keepend contains=@pythonTop,makoEnd + +" Variables +syn region makoNested start="{" end="}" transparent display contained contains=makoNested,@pythonTop +syn region makoVariable matchgroup=makoDelim start=#\${# end=#}# contains=makoNested,@pythonTop + +" Comments +syn region makoComment start="##" end="$" +syn region makoDocComment matchgroup=makoDelim start="<%doc>" end="" keepend + +" Literal Blocks +syn region makoText matchgroup=makoDelim start="<%text[^>]*>" end="" + +" Attribute Sublexing +syn match makoAttributeKey containedin=makoTag contained "[a-zA-Z_][a-zA-Z0-9_]*=" +syn region makoAttributeValue containedin=makoTag contained start=/"/ skip=/\\"/ end=/"/ +syn region makoAttributeValue containedin=MakoTag contained start=/'/ skip=/\\'/ end=/'/ + +" Tags +syn region makoTag matchgroup=makoDelim start="<%\(def\|call\|page\|include\|namespace\|inherit\)\>\s*" end="/\?>" +syn match makoDelim "" + +" Newline Escapes +syn match makoEscape /\\$/ + +" Default highlighting links +if version >= 508 || !exists("did_mako_syn_inits") + if version < 508 + let did_mako_syn_inits = 1 + com -nargs=+ HiLink hi link + else + com -nargs=+ HiLink hi def link + endif + + HiLink makoDocComment makoComment + HiLink makoDefEnd makoDelim + + HiLink makoAttributeKey Type + HiLink makoAttributeValue String + HiLink makoText Normal + HiLink makoDelim Preproc + HiLink makoEnd Keyword + HiLink makoComment Comment + HiLink makoEscape Special + + delc HiLink +endif + +let b:current_syntax = "mako" diff --git a/dot_vim/syntax/mediawiki.vim b/dot_vim/syntax/mediawiki.vim new file mode 100644 index 0000000..339993e --- /dev/null +++ b/dot_vim/syntax/mediawiki.vim @@ -0,0 +1,304 @@ +" Taken from http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#Vim + +" Wikipedia syntax file for Vim +" Published on Wikipedia in 2003-04 and declared authorless. +" +" Based on the HTML syntax file. Probably too closely based, in fact. There +" may well be name collisions everywhere, but ignorance is bliss, so they say. +" +" To do: plug-in support for downloading and uploading to the server. + +if !exists("main_syntax") + if version < 600 + syntax clear + elseif exists("b:current_syntax") + finish +endif + let main_syntax = 'html' +endif + +if version < 508 + command! -nargs=+ HtmlHiLink hi link +else + command! -nargs=+ HtmlHiLink hi def link +endif + +syn case ignore +if v:version >= 700 + syn spell toplevel +endif + +" tags +syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar +syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar +syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 +syn region htmlEndTag start=++ contains=htmlTagN + +syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlBadArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster + +syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,htmlBadTag,@htmlTagNameCluster +syn match htmlTagN contained +]<"ms=s+1 +" This would highlight all tags and fragments that are not allowed. +"syn match htmlBadTag contained +<\s*[-a-zA-Z0-9]\++ms=s+1 +" Highlight only known disallowed HTML tags, so that not every "" +" fragment is flagged. +syn keyword htmlBadTag contained a acronym address applet area base basefont bdo body button col colgroup dfn dir fieldset form frame frameset head html iframe img input isindex kbd label legend link map menu meta noframes noscript object optgroup option param q script select style tbody textarea tfoot thead title +syn match htmlBadArg contained "\s\+[-a-zA-Z0-9]\+\s*="ms=s+1,me=e-1 + +" allowed HTML tag names +syn keyword htmlTagName contained b big blockquote br caption center cite code dd del div dl dt em font h1 h2 h3 h4 h5 h6 hr i ins li ol p pre rb rp rt ruby s small span strike strong sub sup table td th tr tt u ul var +" allowed Wiki tag names +syn keyword htmlTagName contained nowiki math references + +" allowed arg names +syn keyword htmlArg contained title align lang dir width height nowrap +syn keyword htmlArg contained bgcolor clear noshade +syn keyword htmlArg contained cite datetime size face color +syn keyword htmlArg contained type start value compact +syn keyword htmlArg contained summary border frame rules +syn keyword htmlArg contained cellspacing cellpadding valign char +syn keyword htmlArg contained charoff colgroup col span abbr axis +syn keyword htmlArg contained headers scope rowspan colspan +syn keyword htmlArg contained id class name style + +" special characters +syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" + +" comments +syn region htmlComment start=++ contains=htmlCommentPart,htmlCommentError +syn match htmlCommentError contained "[^>+ + +" HTML formatting +syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlComment,htmlLink + +syn region htmlBold start="" end=""me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic +syn region htmlBold start="" end=""me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic +syn region htmlBoldUnderline contained start="" end=""me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic +syn region htmlBoldItalic contained start="" end=""me=e-4 contains=@htmlTop,htmlBoldItalicUnderline +syn region htmlBoldItalic contained start="" end=""me=e-5 contains=@htmlTop,htmlBoldItalicUnderline +syn region htmlBoldUnderlineItalic contained start="" end=""me=e-4 contains=@htmlTop +syn region htmlBoldUnderlineItalic contained start="" end=""me=e-5 contains=@htmlTop +syn region htmlBoldItalicUnderline contained start="" end=""me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic + +syn region htmlUnderline start="" end=""me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic +syn region htmlUnderlineBold contained start="" end=""me=e-4 contains=@htmlTop,htmlUnderlineBoldItalic +syn region htmlUnderlineBold contained start="" end=""me=e-9 contains=@htmlTop,htmlUnderlineBoldItalic +syn region htmlUnderlineItalic contained start="" end=""me=e-4 contains=@htmlTop,htmUnderlineItalicBold +syn region htmlUnderlineItalic contained start="" end=""me=e-5 contains=@htmlTop,htmUnderlineItalicBold +syn region htmlUnderlineItalicBold contained start="" end=""me=e-4 contains=@htmlTop +syn region htmlUnderlineItalicBold contained start="" end=""me=e-9 contains=@htmlTop +syn region htmlUnderlineBoldItalic contained start="" end=""me=e-4 contains=@htmlTop +syn region htmlUnderlineBoldItalic contained start="" end=""me=e-5 contains=@htmlTop + +syn region htmlItalic start="" end=""me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline +syn region htmlItalic start="" end=""me=e-5 contains=@htmlTop +syn region htmlItalicBold contained start="" end=""me=e-4 contains=@htmlTop,htmlItalicBoldUnderline +syn region htmlItalicBold contained start="" end=""me=e-9 contains=@htmlTop,htmlItalicBoldUnderline +syn region htmlItalicBoldUnderline contained start="" end=""me=e-4 contains=@htmlTop +syn region htmlItalicUnderline contained start="" end=""me=e-4 contains=@htmlTop,htmlItalicUnderlineBold +syn region htmlItalicUnderlineBold contained start="" end=""me=e-4 contains=@htmlTop +syn region htmlItalicUnderlineBold contained start="" end=""me=e-9 contains=@htmlTop + +syn region htmlH1 start="" end="

"me=e-5 contains=@htmlTop +syn region htmlH2 start="" end=""me=e-5 contains=@htmlTop +syn region htmlH3 start="" end=""me=e-5 contains=@htmlTop +syn region htmlH4 start="" end=""me=e-5 contains=@htmlTop +syn region htmlH5 start="" end=""me=e-5 contains=@htmlTop +syn region htmlH6 start="" end=""me=e-5 contains=@htmlTop +syn region htmlHead start="" end=""me=e-7 end=""me=e-5 end=""me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,cssStyle +syn region htmlTitle start="" end=""me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment + +" No htmlTop and wikiPre inside HTML preformatted areas, because Wikipedia +" renders everything in there literally (HTML tags and entities, too): +"
 tags work as the combination of  and the standard HTML 
+"   tag: the content will preformatted, and it will not be parsed, but shown as
+"   in the wikitext source.
+" With wikiPre, indented lines would be rendered differently from unindented
+" lines.
+syn match htmlPreTag /
/ contains=htmlTag
+syn match wikiNowikiTag // contains=htmlTag
+syn match wikiNowikiEndTag /<\/nowiki>/ contains=htmlEndTag
+" Note: Cannot use 'start="
"rs=e', so still have the 
 tag highlighted
+" correctly via separate syn-match. Unfortunately, this will also highlight
+" 
 tags inside the preformatted region. 
+syn region htmlPre start="
" end="
"me=e-6 contains=htmlPreTag +syn region wikiNowiki start="" end=""me=e-9 contains=wikiNowikiTag + +" wiki formatting +syn region wikiItalic start=+'\@.*" contains=@Spell,wikiLink,wikiItalicBold,wikiNowiki,wikiNowikiEndTag +syn region wikiBold start=+'''+ end=+'''+ skip=".*" contains=@Spell,wikiLink,wikiBoldItalic,wikiNowiki,wikiNowikiEndTag +syn region wikiBoldAndItalic start=+'''''+ end=+'''''+ skip=".*" contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag + +syn region wikiBoldItalic contained start=+'\@.*" contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag +syn region wikiItalicBold contained start=+'''+ end=+'''+ skip=".*" contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag + +syn region wikiH1 start="^=" end="=" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag +syn region wikiH2 start="^==" end="==" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag +syn region wikiH3 start="^===" end="===" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag +syn region wikiH4 start="^====" end="====" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag +syn region wikiH5 start="^=====" end="=====" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag +syn region wikiH6 start="^======" end="======" skip=".*" oneline contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag +syn region wikiLink start="\[\[" end="\]\]\(s\|'s\|es\|ing\|\)" skip=".*" oneline contains=wikiLink,wikiNowiki,wikiNowikiEndTag +syn region wikiLink start="\[http:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag +syn region wikiLink start="\[https:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag +syn region wikiLink start="\[ftp:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag +syn region wikiLink start="\[gopher:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag +syn region wikiLink start="\[news:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag +syn region wikiLink start="\[mailto:" end="\]" skip=".*" oneline contains=wikiNowiki,wikiNowikiEndTag +syn region wikiTemplate start="{{" end="}}" skip=".*" contains=wikiNowiki,wikiNowikiEndTag + +syn match wikiParaFormatChar /^[\:|\*|;|#]\+/ +syn match wikiParaFormatChar /^-----*/ +syn match wikiPre /^\ .*$/ contains=wikiNowiki,wikiNowikiEndTag + +syn include @TeX syntax/tex.vim +syntax region wikiTeX matchgroup=htmlTag start="" end="" skip=".*" contains=@TeX,wikiNowiki,wikiNowikiEndTag +syntax region wikiRef matchgroup=htmlTag start="" end="" skip=".*" contains=wikiNowiki,wikiNowikiEndTag + + +" HTML highlighting + +HtmlHiLink htmlTag Function +HtmlHiLink htmlEndTag Identifier +HtmlHiLink htmlArg Type +HtmlHiLink htmlTagName htmlStatement +HtmlHiLink htmlSpecialTagName Exception +HtmlHiLink htmlValue String +HtmlHiLink htmlSpecialChar Special + +HtmlHiLink htmlH1 Title +HtmlHiLink htmlH2 htmlH1 +HtmlHiLink htmlH3 htmlH2 +HtmlHiLink htmlH4 htmlH3 +HtmlHiLink htmlH5 htmlH4 +HtmlHiLink htmlH6 htmlH5 +HtmlHiLink htmlHead PreProc +HtmlHiLink htmlTitle Title +HtmlHiLink htmlBoldItalicUnderline htmlBoldUnderlineItalic +HtmlHiLink htmlUnderlineBold htmlBoldUnderline +HtmlHiLink htmlUnderlineItalicBold htmlBoldUnderlineItalic +HtmlHiLink htmlUnderlineBoldItalic htmlBoldUnderlineItalic +HtmlHiLink htmlItalicUnderline htmlUnderlineItalic +HtmlHiLink htmlItalicBold htmlBoldItalic +HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic +HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic + +HtmlHiLink htmlSpecial Special +HtmlHiLink htmlSpecialChar Special +HtmlHiLink htmlString String +HtmlHiLink htmlStatement Statement +HtmlHiLink htmlComment Comment +HtmlHiLink htmlCommentPart Comment +HtmlHiLink htmlValue String +HtmlHiLink htmlCommentError htmlError +HtmlHiLink htmlTagError htmlError +HtmlHiLink htmlBadTag htmlError +HtmlHiLink htmlBadArg htmlError +HtmlHiLink htmlEvent javaScript +HtmlHiLink htmlError Error + +HtmlHiLink htmlCssStyleComment Comment +HtmlHiLink htmlCssDefinition Special + +" The default highlighting. +if version >= 508 || !exists("did_html_syn_inits") + if version < 508 + let did_html_syn_inits = 1 + endif + HtmlHiLink htmlTag Function + HtmlHiLink htmlEndTag Identifier + HtmlHiLink htmlArg Type + HtmlHiLink htmlTagName htmlStatement + HtmlHiLink htmlSpecialTagName Exception + HtmlHiLink htmlValue String + HtmlHiLink htmlSpecialChar Special + +if !exists("html_no_rendering") + HtmlHiLink htmlH1 Title + HtmlHiLink htmlH2 htmlH1 + HtmlHiLink htmlH3 htmlH2 + HtmlHiLink htmlH4 htmlH3 + HtmlHiLink htmlH5 htmlH4 + HtmlHiLink htmlH6 htmlH5 + HtmlHiLink htmlHead PreProc + HtmlHiLink htmlTitle Title + HtmlHiLink htmlBoldItalicUnderline htmlBoldUnderlineItalic + HtmlHiLink htmlUnderlineBold htmlBoldUnderline + HtmlHiLink htmlUnderlineItalicBold htmlBoldUnderlineItalic + HtmlHiLink htmlUnderlineBoldItalic htmlBoldUnderlineItalic + HtmlHiLink htmlItalicUnderline htmlUnderlineItalic + HtmlHiLink htmlItalicBold htmlBoldItalic + HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic + HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic + HtmlHiLink htmlLink Underlined + if !exists("html_my_rendering") + hi def htmlBold term=bold cterm=bold gui=bold + hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline + hi def htmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic + hi def htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline + hi def htmlUnderline term=underline cterm=underline gui=underline + hi def htmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline + hi def htmlItalic term=italic cterm=italic gui=italic + endif +endif + + HtmlHiLink htmlPreStmt PreProc + HtmlHiLink htmlPreError Error + HtmlHiLink htmlPreProc PreProc + HtmlHiLink htmlPreAttr String + HtmlHiLink htmlPreProcAttrName PreProc + HtmlHiLink htmlPreProcAttrError Error + HtmlHiLink htmlSpecial Special + HtmlHiLink htmlSpecialChar Special + HtmlHiLink htmlString String + HtmlHiLink htmlStatement Statement + HtmlHiLink htmlComment Comment + HtmlHiLink htmlCommentPart Comment + HtmlHiLink htmlValue String + HtmlHiLink htmlCommentError htmlError + HtmlHiLink htmlTagError htmlError + HtmlHiLink htmlBadTag htmlError + HtmlHiLink htmlBadArg htmlError + HtmlHiLink htmlEvent javaScript + HtmlHiLink htmlError Error + + HtmlHiLink javaScript Special + HtmlHiLink javaScriptExpression javaScript + HtmlHiLink htmlCssStyleComment Comment + HtmlHiLink htmlCssDefinition Special +endif + +" wiki highlighting + +HtmlHiLink wikiItalic htmlItalic +HtmlHiLink wikiBold htmlBold + +HtmlHiLink wikiBoldItalic htmlBoldItalic +HtmlHiLink wikiItalicBold htmlBoldItalic + +HtmlHiLink wikiBoldAndItalic htmlBoldItalic + +HtmlHiLink wikiH1 htmlH1 +HtmlHiLink wikiH2 htmlH2 +HtmlHiLink wikiH3 htmlH3 +HtmlHiLink wikiH4 htmlH4 +HtmlHiLink wikiH5 htmlH5 +HtmlHiLink wikiH6 htmlH6 +HtmlHiLink wikiLink Underlined +HtmlHiLink wikiTemplate Special +HtmlHiLink wikiParaFormatChar Special +HtmlHiLink wikiPre Constant +HtmlHiLink wikiRef Comment + + +let b:current_syntax = "html" + +delcommand HtmlHiLink + +if main_syntax == 'html' + unlet main_syntax +endif + diff --git a/dot_vim/syntax/mkd.vim b/dot_vim/syntax/mkd.vim new file mode 100644 index 0000000..ee22365 --- /dev/null +++ b/dot_vim/syntax/mkd.vim @@ -0,0 +1,104 @@ +" Vim syntax file +" Language: Markdown +" Maintainer: Ben Williams +" URL: http://plasticboy.com/markdown-vim-mode/ +" Version: 9 +" Last Change: 2009 May 18 +" Remark: Uses HTML syntax file +" Remark: I don't do anything with angle brackets (<>) because that would too easily +" easily conflict with HTML syntax +" TODO: Handle stuff contained within stuff (e.g. headings within blockquotes) + + +" Read the HTML syntax to start with +if version < 600 + so :p:h/html.vim +else + runtime! syntax/html.vim + unlet b:current_syntax +endif + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" don't use standard HiLink, it will not work with included syntax files +if version < 508 + command! -nargs=+ HtmlHiLink hi link +else + command! -nargs=+ HtmlHiLink hi def link +endif + +syn spell toplevel +syn case ignore +syn sync linebreaks=1 + +"additions to HTML groups +syn region htmlBold start=/\\\@) +syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite +syn region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]" contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline +syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+ end=+"+ contained +syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained +syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained + +"define Markdown groups +syn match mkdLineContinue ".$" contained +syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/ +syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-$/ +syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_$/ +syn match mkdRule /^\s*-\{3,}$/ +syn match mkdRule /^\s*\*\{3,5}$/ +syn match mkdListItem "^\s*[-*+]\s\+" +syn match mkdListItem "^\s*\d\+\.\s\+" +syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ +syn match mkdLineBreak / \+$/ +syn region mkdCode start=/\\\@/ end=/$/ contains=mkdLineBreak,mkdLineContinue,@Spell +syn region mkdCode start="]*>" end="
" +syn region mkdCode start="]*>" end="" + +"HTML headings +syn region htmlH1 start="^\s*#" end="\($\|#\+\)" contains=@Spell +syn region htmlH2 start="^\s*##" end="\($\|#\+\)" contains=@Spell +syn region htmlH3 start="^\s*###" end="\($\|#\+\)" contains=@Spell +syn region htmlH4 start="^\s*####" end="\($\|#\+\)" contains=@Spell +syn region htmlH5 start="^\s*#####" end="\($\|#\+\)" contains=@Spell +syn region htmlH6 start="^\s*######" end="\($\|#\+\)" contains=@Spell +syn match htmlH1 /^.\+\n=\+$/ contains=@Spell +syn match htmlH2 /^.\+\n-\+$/ contains=@Spell + +"highlighting for Markdown groups +HtmlHiLink mkdString String +HtmlHiLink mkdCode String +HtmlHiLink mkdBlockquote Comment +HtmlHiLink mkdLineContinue Comment +HtmlHiLink mkdListItem Identifier +HtmlHiLink mkdRule Identifier +HtmlHiLink mkdLineBreak Todo +HtmlHiLink mkdLink htmlLink +HtmlHiLink mkdURL htmlString +HtmlHiLink mkdID Identifier +HtmlHiLink mkdLinkDef mkdID +HtmlHiLink mkdLinkDefTarget mkdURL +HtmlHiLink mkdLinkTitle htmlString + +HtmlHiLink mkdDelimiter Delimiter + +let b:current_syntax = "mkd" + +delcommand HtmlHiLink +" vim: ts=8 diff --git a/dot_vim/syntax/motd.vim b/dot_vim/syntax/motd.vim new file mode 100644 index 0000000..6a5afb9 --- /dev/null +++ b/dot_vim/syntax/motd.vim @@ -0,0 +1,23 @@ +" Vim syntax file +" Language: MotD Public +" Maintainer: David Bushong + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn match motdSig "\(\s\s\+\|\t\)--\?.\+$\|\s--\?\w\+\s*$" +syn match motdThread "^\s\+\\[_-]" +syn match motdDate "^\d\+/\d\+\s" +syn match motdLink "https\?://\S\+" + +hi link motdSig String +hi link motdThread Type +hi link motdDate Number +hi link motdLink Underlined + +let b:current_syntax = "motd" diff --git a/dot_vim/syntax/nvpscript.vim b/dot_vim/syntax/nvpscript.vim new file mode 100644 index 0000000..a19e65d --- /dev/null +++ b/dot_vim/syntax/nvpscript.vim @@ -0,0 +1,72 @@ +" Vim syn file +" Language: NVISION Script +" Maintainer: Barak Michener +" Last Change: 2006 Jun 29 + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +"this language is oblivious to case. +syn case ignore + + +" The only keywords +syn keyword nvpKeyword elseif else defsub endif msgbox for if +syn keyword nvpKeyword gosub endsub next print printn sleep +syn keyword nvpKeyword to wend while yesnobox + +syn keyword nvpFunction #flush #sendbreak #halt +" String contstants +syn region nvpString start=+"+ skip=+\\"+ end=+"+ +"integer number, or floating point number without a dot. +syn match nvpNumber "\<\d\+\>" +"floating point number, with dot +syn match nvpNumber "\<\d\+\.\d*\>" +"floating point number, starting with a dot +syn match nvpNumber "\.\d\+\>" +"hex number +syn match nvpNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" +syn match nvpNumber "\<[0-9ABCDEF]{2}\>" + +syn region nvpComment start="!" end="$" +syn match nvpOperator "[+\-*/()%<>=\^]" + +syn match nvpVarPlain "$^[ADEFHILMOPSTWX]\=" +syn match nvpVarPlain "$[\\\"\[\]'&`+*.,;=%~?@$<>(-]" +syn match nvpVarPlain "$\(0\|[1-9]\d*\)" +syn region nvpSend start="<<" end="$" +syn region nvpRecv start="\d*: " end="$" + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_basic_syntax_inits") + if version < 508 + let did_basic_syntax_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + "My Highlighting + HiLink nvpFunction PreProc + HiLink nvpKeyword Statement + HiLink nvpString String + HiLink nvpNumber Number + HiLink nvpComment Comment + HiLink nvpOperator Operator + HiLink nvpVarPlain Identifier + HiLink nvpSend Include + HiLink nvpRecv SpecialChar + + delcommand HiLink +endif + +let b:current_syntax = "nvpscript" + +"vim: ts=4 diff --git a/dot_vim/syntax/proto.vim b/dot_vim/syntax/proto.vim new file mode 100644 index 0000000..23085a2 --- /dev/null +++ b/dot_vim/syntax/proto.vim @@ -0,0 +1,105 @@ +" Protocol Buffers - Google's data interchange format +" Copyright 2008 Google Inc. All rights reserved. +" https://developers.google.com/protocol-buffers/ +" +" Redistribution and use in source and binary forms, with or without +" modification, are permitted provided that the following conditions are +" met: +" +" * Redistributions of source code must retain the above copyright +" notice, this list of conditions and the following disclaimer. +" * Redistributions in binary form must reproduce the above +" copyright notice, this list of conditions and the following disclaimer +" in the documentation and/or other materials provided with the +" distribution. +" * Neither the name of Google Inc. nor the names of its +" contributors may be used to endorse or promote products derived from +" this software without specific prior written permission. +" +" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +" This is the Vim syntax file for Google Protocol Buffers. +" +" Usage: +" +" 1. cp proto.vim ~/.vim/syntax/ +" 2. Add the following to ~/.vimrc: +" +" augroup filetype +" au! BufRead,BufNewFile *.proto setfiletype proto +" augroup end +" +" Or just create a new file called ~/.vim/ftdetect/proto.vim with the +" previous lines on it. + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn case match + +syn keyword pbTodo contained TODO FIXME XXX +syn cluster pbCommentGrp contains=pbTodo + +syn keyword pbSyntax syntax import option +syn keyword pbStructure package message group oneof +syn keyword pbRepeat optional required repeated +syn keyword pbDefault default +syn keyword pbExtend extend extensions to max +syn keyword pbRPC service rpc returns + +syn keyword pbType int32 int64 uint32 uint64 sint32 sint64 +syn keyword pbType fixed32 fixed64 sfixed32 sfixed64 +syn keyword pbType float double bool string bytes +syn keyword pbTypedef enum +syn keyword pbBool true false + +syn match pbInt /-\?\<\d\+\>/ +syn match pbInt /\<0[xX]\x+\>/ +syn match pbFloat /\<-\?\d*\(\.\d*\)\?/ +syn region pbComment start="\/\*" end="\*\/" contains=@pbCommentGrp +syn region pbComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp +syn region pbString start=/"/ skip=/\\./ end=/"/ +syn region pbString start=/'/ skip=/\\./ end=/'/ + +if version >= 508 || !exists("did_proto_syn_inits") + if version < 508 + let did_proto_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink pbTodo Todo + + HiLink pbSyntax Include + HiLink pbStructure Structure + HiLink pbRepeat Repeat + HiLink pbDefault Keyword + HiLink pbExtend Keyword + HiLink pbRPC Keyword + HiLink pbType Type + HiLink pbTypedef Typedef + HiLink pbBool Boolean + + HiLink pbInt Number + HiLink pbFloat Float + HiLink pbComment Comment + HiLink pbString String + + delcommand HiLink +endif + +let b:current_syntax = "proto" diff --git a/dot_vim/syntax/scala.vim b/dot_vim/syntax/scala.vim new file mode 100644 index 0000000..b19a04f --- /dev/null +++ b/dot_vim/syntax/scala.vim @@ -0,0 +1,153 @@ +" Vim syntax file +" Language : Scala (http://scala-lang.org/) +" Maintainers: Stefan Matthias Aust, Julien Wetterwald +" Last Change: 2007 June 13 +" Revision : $Id$ +" $URL$ + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn case match +syn sync minlines=50 + +" most Scala keywords +syn keyword scalaKeyword abstract case catch do else extends final finally for forSome if implicit lazy match new null override private protected requires return sealed super this throw try type while with yield +syn match scalaKeyword "=>" +syn match scalaKeyword "<-" +syn match scalaKeyword "\<_\>" + +syn match scalaOperator ":\{2,\}" "this is not a type + +" package and import statements +syn keyword scalaPackage package nextgroup=scalaFqn skipwhite +syn keyword scalaImport import nextgroup=scalaFqn skipwhite +syn match scalaFqn "\<[._$a-zA-Z0-9,]*" contained nextgroup=scalaFqnSet +syn region scalaFqnSet start="{" end="}" contained + +" boolean literals +syn keyword scalaBoolean true false + +" definitions +syn keyword scalaDef def nextgroup=scalaDefName skipwhite +syn keyword scalaVal val nextgroup=scalaValName skipwhite +syn keyword scalaVar var nextgroup=scalaVarName skipwhite +syn keyword scalaClass class nextgroup=scalaClassName skipwhite +syn keyword scalaObject object nextgroup=scalaClassName skipwhite +syn keyword scalaTrait trait nextgroup=scalaClassName skipwhite +syn match scalaDefName "[^ =:;([]\+" contained nextgroup=scalaDefSpecializer skipwhite +syn match scalaValName "[^ =:;([]\+" contained +syn match scalaVarName "[^ =:;([]\+" contained +syn match scalaClassName "[^ =:;(\[]\+" contained nextgroup=scalaClassSpecializer skipwhite +syn region scalaDefSpecializer start="\[" end="\]" contained contains=scalaDefSpecializer +syn region scalaClassSpecializer start="\[" end="\]" contained contains=scalaClassSpecializer + +" type constructor (actually anything with an uppercase letter) +syn match scalaConstructor "\<[A-Z][_$a-zA-Z0-9]*\>" nextgroup=scalaConstructorSpecializer +syn region scalaConstructorSpecializer start="\[" end="\]" contained contains=scalaConstructorSpecializer + +" method call +syn match scalaRoot "\<[a-zA-Z][_$a-zA-Z0-9]*\."me=e-1 +syn match scalaMethodCall "\.[a-z][_$a-zA-Z0-9]*"ms=s+1 + +" type declarations in val/var/def +syn match scalaType ":\s*\(=>\s*\)\?[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)\?\(\s*\(<:\|>:\|#\|=>\)\s*[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)*\)*"ms=s+1 + +" comments +syn match scalaTodo "[tT][oO][dD][oO]" contained +syn match scalaLineComment "//.*" contains=scalaTodo +syn region scalaComment start="/\*" end="\*/" contains=scalaTodo +syn case ignore +syn include @scalaHtml syntax/html.vim +unlet b:current_syntax +syn case match +syn region scalaDocComment start="/\*\*" end="\*/" contains=scalaDocTags,scalaTodo,@scalaHtml keepend +syn region scalaDocTags start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}" contained +syn match scalaDocTags "@[a-z]\+" contained + +syn match scalaEmptyString "\"\"" + +" multi-line string literals +syn region scalaMultiLineString start="\"\"\"" end="\"\"\"" contains=scalaUnicode +syn match scalaUnicode "\\u[0-9a-fA-F]\{4}" contained + +" string literals with escapes +syn region scalaString start="\"[^"]" skip="\\\"" end="\"" contains=scalaStringEscape " TODO end \n or not? +syn match scalaStringEscape "\\u[0-9a-fA-F]\{4}" contained +syn match scalaStringEscape "\\[nrfvb\\\"]" contained + +" symbol and character literals +syn match scalaSymbol "'[_a-zA-Z0-9][_a-zA-Z0-9]*\>" +syn match scalaChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'" + +" number literals +syn match scalaNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" +syn match scalaNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" +syn match scalaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" +syn match scalaNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" + +" xml literals +syn match scalaXmlTag "<[a-zA-Z]\_[^>]*/>" contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString +syn region scalaXmlString start="\"" end="\"" contained +syn match scalaXmlStart "<[a-zA-Z]\_[^>]*>" contained contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString +syn region scalaXml start="<\([a-zA-Z]\_[^>]*\_[^/]\|[a-zA-Z]\)>" matchgroup=scalaXmlStart end="]\+>" contains=scalaXmlEscape,scalaXmlQuote,scalaXml,scalaXmlStart,scalaXmlComment +syn region scalaXmlEscape matchgroup=scalaXmlEscapeSpecial start="{" matchgroup=scalaXmlEscapeSpecial end="}" contained contains=TOP +syn match scalaXmlQuote "&[^;]\+;" contained +syn match scalaXmlComment "" contained + +syn sync fromstart + +" map Scala groups to standard groups +hi link scalaKeyword Keyword +hi link scalaPackage Include +hi link scalaImport Include +hi link scalaBoolean Boolean +hi link scalaOperator Normal +hi link scalaNumber Number +hi link scalaEmptyString String +hi link scalaString String +hi link scalaChar String +hi link scalaMultiLineString String +hi link scalaStringEscape Special +hi link scalaSymbol Special +hi link scalaUnicode Special +hi link scalaComment Comment +hi link scalaLineComment Comment +hi link scalaDocComment Comment +hi link scalaDocTags Special +hi link scalaTodo Todo +hi link scalaType Type +hi link scalaTypeSpecializer scalaType +hi link scalaXml String +hi link scalaXmlTag Include +hi link scalaXmlString String +hi link scalaXmlStart Include +hi link scalaXmlEscape Normal +hi link scalaXmlEscapeSpecial Special +hi link scalaXmlQuote Special +hi link scalaXmlComment Comment +hi link scalaDef Keyword +hi link scalaVar Keyword +hi link scalaVal Keyword +hi link scalaClass Keyword +hi link scalaObject Keyword +hi link scalaTrait Keyword +hi link scalaDefName Function +hi link scalaDefSpecializer Function +hi link scalaClassName Special +hi link scalaClassSpecializer Special +hi link scalaConstructor Special +hi link scalaConstructorSpecializer scalaConstructor + +let b:current_syntax = "scala" + +" you might like to put these lines in your .vimrc +" +" customize colors a little bit (should be a different file) +" hi scalaNew gui=underline +" hi scalaMethodCall gui=italic +" hi scalaValName gui=underline +" hi scalaVarName gui=underline diff --git a/dot_vim/syntax/snippet.vim b/dot_vim/syntax/snippet.vim new file mode 100644 index 0000000..5e919e7 --- /dev/null +++ b/dot_vim/syntax/snippet.vim @@ -0,0 +1,19 @@ +" Syntax highlighting for snippet files (used for snipMate.vim) +" Hopefully this should make snippets a bit nicer to write! +syn match snipComment '^#.*' +syn match placeHolder '\${\d\+\(:.\{-}\)\=}' contains=snipCommand +syn match tabStop '\$\d\+' +syn match snipCommand '`.\{-}`' +syn match snippet '^snippet.*' transparent contains=multiSnipText,snipKeyword +syn match multiSnipText '\S\+ \zs.*' contained +syn match snipKeyword '^snippet'me=s+8 contained +syn match snipError "^[^#s\t].*$" + +hi link snipComment Comment +hi link multiSnipText String +hi link snipKeyword Keyword +hi link snipComment Comment +hi link placeHolder Special +hi link tabStop Special +hi link snipCommand String +hi link snipError Error diff --git a/dot_vim/syntax/svkannotate.vim b/dot_vim/syntax/svkannotate.vim new file mode 100644 index 0000000..3c53c3c --- /dev/null +++ b/dot_vim/syntax/svkannotate.vim @@ -0,0 +1,42 @@ +" Vim syntax file +" Language: SVK annotate output +" Maintainer: Bob Hiestand +" Remark: Used by the vcscommand plugin. +" License: +" Copyright (c) 2007 Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if exists("b:current_syntax") + finish +endif + +syn match svkDate /\d\{4}-\d\{1,2}-\d\{1,2}/ skipwhite contained +syn match svkName /(\s*\zs\S\+/ contained nextgroup=svkDate skipwhite +syn match svkVer /^\s*\d\+/ contained nextgroup=svkName skipwhite +syn region svkHead start=/^/ end="):" contains=svkVer,svkName,svkDate oneline + +if !exists("did_svkannotate_syntax_inits") + let did_svkannotate_syntax_inits = 1 + hi link svkName Type + hi link svkDate Comment + hi link svkVer Statement +endif + +let b:current_syntax="svkAnnotate" diff --git a/dot_vim/syntax/svnannotate.vim b/dot_vim/syntax/svnannotate.vim new file mode 100644 index 0000000..d46f771 --- /dev/null +++ b/dot_vim/syntax/svnannotate.vim @@ -0,0 +1,40 @@ +" Vim syntax file +" Language: SVN annotate output +" Maintainer: Bob Hiestand +" Remark: Used by the vcscommand plugin. +" License: +" Copyright (c) 2007 Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if exists("b:current_syntax") + finish +endif + +syn match svnName /\S\+/ contained +syn match svnVer /^\s\+\zs\d\+/ contained nextgroup=svnName skipwhite +syn match svnHead /^\s\+\d\+\s\+\S\+/ contains=svnVer,svnName + +if !exists("did_svnannotate_syntax_inits") + let did_svnannotate_syntax_inits = 1 + hi link svnName Type + hi link svnVer Statement +endif + +let b:current_syntax="svnAnnotate" diff --git a/dot_vim/syntax/vcscommit.vim b/dot_vim/syntax/vcscommit.vim new file mode 100644 index 0000000..0cd4c5e --- /dev/null +++ b/dot_vim/syntax/vcscommit.vim @@ -0,0 +1,31 @@ +" Vim syntax file +" Language: VCS commit file +" Maintainer: Bob Hiestand (bob.hiestand@gmail.com) +" License: +" Copyright (c) 2007 Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if exists("b:current_syntax") + finish +endif + +syntax region vcsComment start="^VCS: " end="$" +highlight link vcsComment Comment +let b:current_syntax = "vcscommit" diff --git a/dot_vim/syntax_checkers/go/golintc.vim b/dot_vim/syntax_checkers/go/golintc.vim new file mode 100644 index 0000000..58e6102 --- /dev/null +++ b/dot_vim/syntax_checkers/go/golintc.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: golintc.vim +"Description: Check go syntax using 'golintc' +"Maintainer: Hiroshi Ioka +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_go_golintc_checker") + finish +endif +let g:loaded_syntastic_go_golintc_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_go_golintc_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%f:%l:%c: %m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'type': 'w'}, + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'golintc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/dot_vim/syntax_checkers/go/gonyet.vim b/dot_vim/syntax_checkers/go/gonyet.vim new file mode 100644 index 0000000..3c703c5 --- /dev/null +++ b/dot_vim/syntax_checkers/go/gonyet.vim @@ -0,0 +1,49 @@ +"============================================================================ +"File: gonyet.vim +"Description: Perform static analysis of Go code with the go-nyet tool +"Maintainer: Barak Michener +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_go_gonyet_checker") + finish +endif +let g:loaded_syntastic_go_gonyet_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_go_gonyet_IsAvailable() dict + return executable('go-nyet') +endfunction + +function! SyntaxCheckers_go_gonyet_GetLocList() dict + let makeprg = 'go-nyet ' . expand('%:p') + let errorformat = '%f:%l:%c:%m' + + " The go compiler needs to either be run with an import path as an + " argument or directly from the package directory. Since figuring out + " the proper import path is fickle, just cwd to the package. + + let errors = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'cwd': expand('%:p:h'), + \ 'defaults': {'type': 'w'} }) + + return errors +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'gonyet'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/dot_vim/syntax_checkers/go/govetshadow.vim b/dot_vim/syntax_checkers/go/govetshadow.vim new file mode 100644 index 0000000..24e1249 --- /dev/null +++ b/dot_vim/syntax_checkers/go/govetshadow.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: govetshadow.vim +"Description: Perform static analysis of Go code with the vet tool +"Maintainer: Kamil Kisiel +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_go_govetshadow_checker") + finish +endif +let g:loaded_syntastic_go_govetshadow_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_go_govetshadow_IsAvailable() dict + return executable(self.getExec()) +endfunction + +function! SyntaxCheckers_go_govetshadow_GetLocList() dict + let makeprg = self.getExec() . ' tool vet -shadow ' . expand('%:p') + + let errorformat = + \ '%Evet: %.%\+: %f:%l:%c: %m,' . + \ '%W%f:%l: %m,' . + \ '%-G%.%#' + + " The go compiler needs to either be run with an import path as an + " argument or directly from the package directory. Since figuring out + " the proper import path is fickle, just cwd to the package. + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'cwd': expand('%:p:h', 1), + \ 'defaults': {'type': 'w'} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'govetshadow', + \ 'exec': 'go' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" diff --git a/dot_vim/tabbar.vim b/dot_vim/tabbar.vim new file mode 100644 index 0000000..b914734 --- /dev/null +++ b/dot_vim/tabbar.vim @@ -0,0 +1,1646 @@ +" Copyright: Copyright (C) 2005 Marius Groleo +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" tabbar.vim is provided *AS IS* and comes with no warranty of +" any kind, either expressed or implied. In no event will the +" copyright holder be liable for any damamges resulting from the +" use of this software. +" +" Derived from Bindu Wavell miniBufExplorer.vim version 6.3.2 + + +" Version: 0.7 +" Maintainer: Marius Groleo < groleo@gmail.com > +" Description: TabBar buffer explorer Vim Plugin +" Name Of File: tabbar.vim + +" DOCUMENTATION: is at line :1445 + +" press zR , in normal mode to OPEN all folds +" press zM , in normal mode to CLOSE all folds + +" Already been loaded? ~~ +if exists('Tb_loaded') + finish +else + let Tb_loaded= 1 +endif "%% + + +" Debug Level ~~ +" 0 = no logging +" 1-5 = errors ; 1 is the most important +" 5-9 = info ; 5 is the most important +" 10 = Entry/Exit +if !exists('g:Tb_DBG_LVL') + let g:Tb_DBG_LVL = 0 +endif" %% + + +" Logging method ~~ +" 0 = log to a window +" 1 = log with vim's echo facility +" 2 = log to a file named TabBar.DBG +" in the directory where vim was started +" THIS IS VERY SLOW +" 3 = log into g:Tb_DbgOutput +" global variable [This is the default] +if !exists('g:Tb_DebugMode') + let g:Tb_DebugMode = 0 +endif" %% + + +" Mappings and Commands +" TabBar Keyboard Mappings ~~ +if ! hasmapto('1') || !hasmapto('') + "gui bindings containing META key, are different from terminal bindings + if has('gui_running') + "NORMAL mode bindings for gvim + noremap