├── rspec ├── editrc ├── gemrc ├── jshintrc ├── setup.rb ├── inputrc ├── TODO.txt ├── bash_profile ├── nvim ├── lua │ ├── plugins │ │ ├── vim-commentary.lua │ │ ├── nvim-lspconfig.lua │ │ ├── telescope.lua │ │ ├── rustaceanvim.lua │ │ ├── colorschme.lua │ │ ├── lazydev.lua │ │ ├── lualine_conf.bak │ │ ├── neotest.lua │ │ ├── treesitter.lua │ │ ├── lualine.lua │ │ └── neotree.lua │ └── config │ │ ├── lazy.lua │ │ ├── telescope.lua │ │ └── lspconfig.lua ├── init.lua ├── README.md └── old_init.vm ├── recompile_ycm.sh ├── osx-paste-fix.conf ├── cookbooks └── profile │ ├── metadata.rb │ └── recipes │ ├── link_dotfiles.rb │ ├── powerline.rb │ ├── setup.rb │ ├── github_projects.rb │ ├── vim_setup.rb │ ├── nvim_setup.rb │ └── packages.rb ├── .gitignore ├── scripts ├── nodejs_rest_2.md ├── init_nodejs_rest ├── init_jadebootstrap ├── setup_symlinks.sh └── init_node_proj.sh ├── fonts ├── PowerlineSymbols.otf.1 ├── 10-powerline-symbols.conf └── 10-powerline-symbols.conf.1 ├── bin └── run_setup ├── install_dependencies_redhat.sh ├── my.cnf ├── install_dependencies_debian.sh ├── pryrc ├── tigrc ├── VIM_README ├── add_github_key.sh ├── install_fonts.sh ├── show_hosts_on_subnet.sh ├── bootstrap.sh ├── README.md ├── VIM_SHORTCUTS.md ├── iterm2 └── README.md ├── Dockerfile ├── profile_init.sh ├── vim-setup.sh ├── gitignore ├── gitconfig ├── show_colors.sh ├── irssi ├── hilightwin.pl ├── trackbar.pl └── nicklist.pl ├── colors ├── colorspaces.pl ├── 24bitcolors.pl ├── 24-bit-color.sh ├── 256colors2.pl └── colortest.pl ├── smb_mount.sh ├── tmux.conf ├── nvimrc.old ├── makesetup.sh ├── solarized ├── Solarized Dark.itermcolors └── Solarized Light.itermcolors ├── aws_scripts.sh ├── irssirc ├── vimrc └── bashrc /rspec: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /editrc: -------------------------------------------------------------------------------- 1 | bind -v 2 | -------------------------------------------------------------------------------- /gemrc: -------------------------------------------------------------------------------- 1 | gem: --no-ri --no-rdoc 2 | -------------------------------------------------------------------------------- /jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "indent": 2 3 | } 4 | -------------------------------------------------------------------------------- /setup.rb: -------------------------------------------------------------------------------- 1 | cookbooks/profile/recipes/setup.rb -------------------------------------------------------------------------------- /inputrc: -------------------------------------------------------------------------------- 1 | set editing-mode vi 2 | set keymap vi 3 | -------------------------------------------------------------------------------- /TODO.txt: -------------------------------------------------------------------------------- 1 | Add a line to run vim :PluginInstall/PluginUpdate after make setup. 2 | -------------------------------------------------------------------------------- /bash_profile: -------------------------------------------------------------------------------- 1 | [[ -r ~/.bashrc ]] && . ~/.bashrc 2 | 3 | . "$HOME/.cargo/env" 4 | -------------------------------------------------------------------------------- /nvim/lua/plugins/vim-commentary.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'tpope/vim-commentary' 3 | } 4 | -------------------------------------------------------------------------------- /recompile_ycm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd ~/.vim/bundle/YouCompleteMe; ./install.sh 3 | -------------------------------------------------------------------------------- /osx-paste-fix.conf: -------------------------------------------------------------------------------- 1 | set-option -g default-command "reattach-to-user-namespace -l bash" 2 | -------------------------------------------------------------------------------- /cookbooks/profile/metadata.rb: -------------------------------------------------------------------------------- 1 | name "profile" 2 | version "1.0.0" 3 | 4 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-lspconfig.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | 'neovim/nvim-lspconfig', 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.orig 3 | sshconfig 4 | local-mode-cache/ 5 | nodes 6 | nvim/lazy-lock.json 7 | -------------------------------------------------------------------------------- /scripts/nodejs_rest_2.md: -------------------------------------------------------------------------------- 1 | https://github.com/trwalker/generator-express-rest-api 2 | yo express-rest-api 3 | -------------------------------------------------------------------------------- /fonts/PowerlineSymbols.otf.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohnMorales/dotfiles/HEAD/fonts/PowerlineSymbols.otf.1 -------------------------------------------------------------------------------- /bin/run_setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | exec chef-client -z --config-option cookbook_path=$PWD/cookbooks -r profile::setup -l info 3 | 4 | -------------------------------------------------------------------------------- /nvim/lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'nvim-telescope/telescope.nvim', tag = '0.1.8', 3 | dependencies = { 'nvim-lua/plenary.nvim' } 4 | } 5 | -------------------------------------------------------------------------------- /install_dependencies_redhat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ "$EUID" != "0" ]; then 3 | exec sudo $0 4 | fi 5 | yum install -y gcc git openssl-devel readline-devel zlib-devel 6 | -------------------------------------------------------------------------------- /my.cnf: -------------------------------------------------------------------------------- 1 | [mysql] 2 | pager = vim -R -c "set nowrap" - 3 | prompt='\u@\h:\d> ' 4 | user=jmorales 5 | host=127.0.0.1 6 | !include ~/.mysqlpassword 7 | !include ~/.mysqldefaultdb 8 | -------------------------------------------------------------------------------- /nvim/lua/plugins/rustaceanvim.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'mrcjkb/rustaceanvim', 3 | version = '^5', -- Recommended 4 | lazy = false, -- This plugin is already lazy 5 | } 6 | 7 | -------------------------------------------------------------------------------- /scripts/init_nodejs_rest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | git clone git@github.com:JohnMorales/Node-Backend-Seed.git 3 | mv Node-Backend-Seed/* . 4 | rm -rf Node-Backend-Seed 5 | npm update --save 6 | -------------------------------------------------------------------------------- /install_dependencies_debian.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ "$EUID" != "0" ]; then 3 | exec sudo $0 4 | fi 5 | apt-get update 6 | apt-get install -y libssl-dev libreadline-dev zlib1g-dev 7 | -------------------------------------------------------------------------------- /scripts/init_jadebootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | git clone https://github.com/rajasegar/jadebootstrap-seed.git 3 | mv jadebootstrap-seed/* . 4 | rm -rf jadebootstrap-seed 5 | npm install 6 | -------------------------------------------------------------------------------- /pryrc: -------------------------------------------------------------------------------- 1 | #if defined? PryStackExplorer 2 | # Pry.commands.alias_command 'f', 'finish' 3 | # Pry.commands.alias_command 'ss', 'show-stack' 4 | # Pry.commands.alias_command 'gf', 'frame' 5 | #end 6 | #Pry.config.commands.alias_command "@", "whereami" 7 | -------------------------------------------------------------------------------- /tigrc: -------------------------------------------------------------------------------- 1 | # John Morales tigrc 2 | # option references for this file: http://jonas.nitro.dk/tig/tigrc.5.html 3 | set refresh-mode = auto 4 | set show-changes = true 5 | set line-graphics = utf-8 6 | set main-view = date:default author id commit-title:graph=true,refs=true 7 | bind log J :/^commit 8 | bind log K :?^commit 9 | -------------------------------------------------------------------------------- /VIM_README: -------------------------------------------------------------------------------- 1 | # Current customized shortcuts 2 | leader is space ' ' 3 | show recent files fr 4 | show buffers files fb 5 | show live grep 6 | ,t Neotree toggle 7 | ,r Neotree reveal 8 | ,b Neotree buffers 9 | ,g Neotree git_status 10 | ,s Neotree document_symbols 11 | 12 | 13 | -------------------------------------------------------------------------------- /add_github_key.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | [ -f ~/.ssh/id_rsa.pub ] || ssh-keygen -q -f ~/.ssh/id_rsa -N '' 3 | read -p "github username? " username 4 | read -p "github password? " password 5 | curl -u "$username:$password" --data "$(awk '{ printf("{\042title\042:\042%s\042, \042key\042: \042%s\042 }", $3, $0);} ' ~/.ssh/id_rsa.pub)" https://api.github.com/user/keys 6 | -------------------------------------------------------------------------------- /install_fonts.sh: -------------------------------------------------------------------------------- 1 | # go to https://www.nerdfonts.com/font-downloads and copy the url of the download 2 | font_url=https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/0xProto.zip 3 | zip_file=$(basename $font_url) 4 | wget -P ~/.local/share/fonts $font_url \ 5 | && cd ~/.local/share/fonts \ 6 | && unzip $zip_file \ 7 | && rm $zip_file \ 8 | && fc-cache -fv 9 | -------------------------------------------------------------------------------- /nvim/lua/plugins/colorschme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/tokyonight.nvim", 4 | lazy = false, -- make sure we load this during startup if it is your main colorscheme 5 | priority = 1000, -- make sure to load this before all the other start plugins 6 | config = function() 7 | -- load the colorscheme here 8 | vim.cmd([[colorscheme tokyonight]]) 9 | end, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /show_hosts_on_subnet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | default_dev=$(netstat -rnf inet | grep default | awk '{print $6}') 3 | which ipcalc >/dev/null || { echo "please install ipcalc"; exit 1; } 4 | broadcast=$(ifconfig $default_dev | grep broadcast | awk '{ print $2 " " $4}' | xargs ipcalc --nobinary | awk '/Network/ { print $2 }') 5 | sudo nmap -sn $broadcast | awk '/scan report/ { ip = $5; getline;getline; print ip " " $0 }' 6 | -------------------------------------------------------------------------------- /nvim/init.lua: -------------------------------------------------------------------------------- 1 | require("config.lazy") 2 | require("config.telescope") 3 | require("config.lspconfig") 4 | 5 | require('neotest').setup { 6 | adapters = { 7 | require('rustaceanvim.neotest') 8 | }, 9 | } 10 | 11 | 12 | vim.opt.wrap = true 13 | vim.opt.relativenumber = true 14 | vim.opt.number = true 15 | vim.opt.ts = 2 16 | vim.opt.sw = 2 17 | vim.opt.expandtab = true 18 | 19 | vim.keymap.set("n", "r", "lua vim.lsp.buf.format()") 20 | -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | [ -d ~/home ] || git clone https://github.com/JohnMorales/dotfiles ~/home 4 | cd ~/home 5 | [ -f /etc/redhat-release ] && grep CentOS /etc/redhat-release >/dev/null && ./install_dependencies_redhat.sh 6 | [ -f /etc/os-release ] && grep Debian /etc/os-release >/dev/null && ./install_dependencies_debian.sh 7 | git pull 8 | which chef >/dev/null || ./profile_init.sh 9 | chef-client -z --config-option cookbook_path=$PWD/cookbooks -r profile::setup -l info 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | home 2 | ==== 3 | 4 | dev home directory 5 | 6 | 7 | ## Issues 8 | 9 | Currently doesn't install java, java is a PITA to automate, but simply using `java --request` seems to bring up a dialog with the correct url to download java 10 | 11 | 12 | ## Prompt 13 | 14 | I've moved customizing the prompt to be machine specific, as for certain machines (mostly work where I can't change the hostname, I want a different prompt) it's using [pureline](https://github.com/chris-marsh/pureline) 15 | -------------------------------------------------------------------------------- /VIM_SHORTCUTS.md: -------------------------------------------------------------------------------- 1 | # VIM customizations 2 | 3 | 4 | ## ALT key shortcuts 5 | Mac and VIM doesn't play well with alt-key shortcuts. To VIM they just look like extended character keys, there doesn't seem to be any indication of an alt-key modifier. 6 | 7 | The following alt level shortcuts have been defined 8 | 9 | `alt-r` i.e. ® => recent files 10 | `alt-p` i.e. π => project level files 11 | `alt-f` i.e. ƒ => file level tags 12 | `alt-t` i.e. † => buffer files 13 | `alt-]` i.e. ‘ => visual tjump (tag jump plugin) 14 | -------------------------------------------------------------------------------- /iterm2/README.md: -------------------------------------------------------------------------------- 1 | # Iterm Keys customizations 2 | 3 | First we need to send super-enter without going into full screen 4 | Add the following shortcuts (in global settings, not the profile keys) 5 | shift-enter => send text "✠" 6 | command-enter => esc sequence "[24;2~" 7 | command-r => ignore 8 | 9 | 10 | Under the profile make sure that left alt is sending normal. 11 | that allows the default alt-r (unicode ®) chars to be mapped in vim. 12 | Then we need the command and alt keys to send the correct keys 13 | 14 | -------------------------------------------------------------------------------- /scripts/setup_symlinks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | setup_symlinks() { 4 | for source in `find ~/dotfiles -iname "*.symlink"` 5 | do 6 | dest="$HOME/.`basename \"${source%.*}\"`" 7 | rm -rf $dest 8 | ln -s $source $dest 9 | done 10 | 11 | rm -rf $HOME/.config/nvim 12 | ln -s $HOME/dotfiles/nvim $HOME/.config/nvim 13 | ln -s $HOME/dotfiles/nvim/ $HOME/.vim 14 | ln -s $HOME/dotfiles/alacritty/config.yml $HOME/.config/alacritty/alacritty.yml 15 | 16 | echo "symlinks ✓" 17 | } 18 | 19 | setup_symlinks 20 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.10 2 | RUN apt-get update && apt-get install -y \ 3 | autoconf \ 4 | bison \ 5 | build-essential \ 6 | curl \ 7 | git \ 8 | libffi-dev \ 9 | libssl-dev \ 10 | libyaml-dev \ 11 | libreadline6-dev \ 12 | libncurses5-dev \ 13 | libgdbm3 \ 14 | libgdbm-dev \ 15 | vim \ 16 | zlib1g-dev 17 | RUN useradd -m jmorales && (echo "jmorales:yagni" | chpasswd ) && usermod -aG sudo jmorales 18 | USER jmorales 19 | WORKDIR /home/jmorales 20 | COPY profile_init.sh / 21 | RUN /profile_init.sh 22 | -------------------------------------------------------------------------------- /cookbooks/profile/recipes/link_dotfiles.rb: -------------------------------------------------------------------------------- 1 | # link in all profile files 2 | current_user = ENV["SUDO_USER"] 3 | dotfiles_dir = ENV["PWD"] 4 | %w{ 5 | vimrc 6 | bashrc 7 | gemrc 8 | gitconfig 9 | gitignore 10 | tmux.conf 11 | bash_profile 12 | tigrc 13 | my.cnf 14 | pryrc 15 | editrc 16 | inputrc 17 | rspec 18 | jshintrc 19 | smb_mount.sh 20 | }.each do |file| 21 | link File.expand_path("~/.#{file}") do 22 | to File.join(dotfiles_dir, file) 23 | owner current_user 24 | group current_user 25 | end 26 | end 27 | 28 | -------------------------------------------------------------------------------- /cookbooks/profile/recipes/powerline.rb: -------------------------------------------------------------------------------- 1 | current_user = ENV["SUDO_USER"] 2 | development_dir = File.expand_path("~/Development") 3 | execute "install_powerline" do 4 | command "./install.sh" 5 | cwd "#{development_dir}/powerline-fonts" 6 | user current_user 7 | group current_user 8 | action :nothing 9 | end 10 | git "#{development_dir}/powerline-fonts" do 11 | repository "https://github.com/powerline/fonts.git" 12 | user current_user 13 | group current_user 14 | not_if "[ -d #{development_dir}/powerline-fonts ]" 15 | notifies :run, "execute[install_powerline]", :immediately 16 | end 17 | 18 | 19 | -------------------------------------------------------------------------------- /profile_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | [ -d ~/.rbenv ] || git clone https://github.com/sstephenson/rbenv.git ~/.rbenv 3 | echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc && echo 'eval "$(rbenv init -)"' >> ~/.bashrc 4 | . ~/.bashrc 5 | [ -d ~/.rbenv/plugins/ruby-build ] || git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build 6 | ruby_install_version=$(rbenv install -l | sed 's/^ *//' | grep ^[[:digit:]] | grep '\.[[:digit:]]$'| tail -1) 7 | echo "Latest matz ruby: $ruby_install_version" 8 | ~/.rbenv/bin/rbenv install $ruby_install_version 9 | echo "gem: --no-ri --no-rdoc" > ~/.gemrc 10 | ~/.rbenv/bin/rbenv global $ruby_install_version 11 | ~/.rbenv/shims/gem install chef 12 | -------------------------------------------------------------------------------- /vim-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | 4 | ##install vim plug 5 | curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ 6 | h~/.config/fontconfig/conf.d/ttps://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 7 | 8 | ## Powerline fonts 9 | ( 10 | mkdir fonts 11 | cd fonts 12 | wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf 13 | wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf 14 | mkdir -p ~/.local/share/fonts/ 15 | mv PowerlineSymbols.otf ~/.local/share/fonts/ 16 | fc-cache -vf ~/.local/share/fonts/ 17 | mkdir -p ~/.config/fontconfig/conf.d/ 18 | mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/ 19 | ) 20 | 21 | ##create link 22 | ln -s $(readlink -f vimrc) ~/.vimrc 23 | -------------------------------------------------------------------------------- /gitignore: -------------------------------------------------------------------------------- 1 | .* 2 | .*.swp 3 | *.orig 4 | quickfix.out 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | node_modules/ 24 | 25 | # CocoaPods 26 | # 27 | # We recommend against adding the Pods directory to your .gitignore. However 28 | # you should judge for yourself, the pros and cons are mentioned at: 29 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 30 | # 31 | Pods/ 32 | 33 | # CMake 34 | # 35 | CMakeCache.txt 36 | CMakeFiles 37 | Makefile 38 | cmake_install.cmake 39 | install_manifest.txt 40 | *.a 41 | -------------------------------------------------------------------------------- /cookbooks/profile/recipes/setup.rb: -------------------------------------------------------------------------------- 1 | # chef recipe to configure profile 2 | current_user = ENV["SUDO_USER"] 3 | include_recipe "profile::link_dotfiles" 4 | 5 | # update homebrew 6 | if node["os"] == "darwin" 7 | execute "update homebrew" do 8 | command "brew update" 9 | end 10 | end 11 | include_recipe "profile::packages" 12 | # 13 | # install generic system packages 14 | directory File.expand_path("~/.ssh/config.d") do 15 | action :create 16 | owner current_user 17 | group current_user 18 | recursive true 19 | end 20 | 21 | # configure vim. 22 | using_vim = false 23 | if using_vim 24 | include_recipe "profile::vim_setup" 25 | else 26 | include_recipe "profile::nvim_setup" 27 | end 28 | include_recipe "profile::github_projects" 29 | include_recipe "profile::powerline" 30 | 31 | # vim: set ts=2 sw=2 tw=0 et ft=chef.ruby : 32 | -------------------------------------------------------------------------------- /cookbooks/profile/recipes/github_projects.rb: -------------------------------------------------------------------------------- 1 | current_user = ENV["SUDO_USER"] 2 | development_dir = File.expand_path("~/Development") 3 | ## Github projects. 4 | { 5 | 6 | 'magicmonty/bash-git-prompt' => File.expand_path("~/.bash-git-prompt"), 7 | 'JohnMorales/base16-shell' => "#{development_dir}/base-16/shell", 8 | 'seebi/dircolors-solarized' => "#{development_dir}/dircolors-solarized", 9 | 'seebi/tmux-colors-solarized' => "#{development_dir}/tmux-colors-solarized", 10 | 11 | }.each do |project, dest| 12 | parent_directory = File.dirname(dest) 13 | directory parent_directory do 14 | action :create 15 | recursive true 16 | not_if "[ -d #{parent_directory} ]" 17 | end 18 | git dest do 19 | repository "https://github.com/#{project}.git" 20 | user current_user 21 | group current_user 22 | not_if "[ -d #{dest} ]" 23 | end 24 | end 25 | 26 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lazydev.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/lazydev.nvim", 4 | ft = "lua", -- only load on lua files 5 | opts = { 6 | library = { 7 | -- See the configuration section for more details 8 | -- Load luvit types when the `vim.uv` word is found 9 | { path = "luvit-meta/library", words = { "vim%.uv" } }, 10 | }, 11 | }, 12 | }, 13 | { "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings 14 | { -- optional completion source for require statements and module annotations 15 | "hrsh7th/nvim-cmp", 16 | opts = function(_, opts) 17 | opts.sources = opts.sources or {} 18 | table.insert(opts.sources, { 19 | name = "lazydev", 20 | group_index = 0, -- set group index to 0 to skip loading LuaLS completions 21 | }) 22 | end, 23 | }, 24 | -- { "folke/neodev.nvim", enabled = false }, -- make sure to uninstall or disable neodev.nvim 25 | } 26 | -------------------------------------------------------------------------------- /gitconfig: -------------------------------------------------------------------------------- 1 | [include] 2 | path = ~/.gitconfig_username 3 | [color] 4 | branch = auto 5 | diff = auto 6 | status = auto 7 | ui = true 8 | [color "branch"] 9 | current = yellow reverse 10 | local = yellow 11 | remote = green 12 | [color "diff"] 13 | meta = yellow bold 14 | frag = magenta bold 15 | old = red 16 | new = cyan 17 | [color "status"] 18 | added = yellow 19 | changed = green 20 | untracked = cyan 21 | [push] 22 | default = simple 23 | excludesfile = ~/.gitignore_global 24 | [alias] 25 | gr = log --graph --full-history --all --color --pretty=tformat:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s%x20%x1b[33m(%an)%x1b[0m" 26 | [diff] 27 | tool = diffmerge 28 | [difftool "diffmerge"] 29 | com = "diffmerge \"$LOCAL\" \"$REMOTE\" " 30 | [merge] 31 | tool = diffmerge 32 | [mergetool "diffmerge"] 33 | trustExitCode = true 34 | cmd = "diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\" " 35 | [credential] 36 | helper = osxkeychain 37 | [user] 38 | name = John Morales 39 | [include] 40 | path = ~/.git_email 41 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lualine_conf.bak: -------------------------------------------------------------------------------- 1 | require('lualine').setup { 2 | options = { 3 | icons_enabled = true, 4 | theme = 'auto', 5 | component_separators = { left = '', right = ''}, 6 | section_separators = { left = '', right = ''}, 7 | disabled_filetypes = { 8 | statusline = {}, 9 | winbar = {}, 10 | }, 11 | ignore_focus = {}, 12 | always_divide_middle = true, 13 | globalstatus = false, 14 | refresh = { 15 | statusline = 1000, 16 | tabline = 1000, 17 | winbar = 1000, 18 | } 19 | }, 20 | sections = { 21 | lualine_a = {'mode'}, 22 | lualine_b = {'branch', 'diff', 'diagnostics'}, 23 | lualine_c = {'filename'}, 24 | lualine_x = {'encoding', 'fileformat', 'filetype'}, 25 | lualine_y = {'progress'}, 26 | lualine_z = {'location'} 27 | }, 28 | inactive_sections = { 29 | lualine_a = {}, 30 | lualine_b = {}, 31 | lualine_c = {'filename'}, 32 | lualine_x = {'location'}, 33 | lualine_y = {}, 34 | lualine_z = {} 35 | }, 36 | tabline = {}, 37 | winbar = {}, 38 | inactive_winbar = {}, 39 | extensions = {} 40 | } 41 | -------------------------------------------------------------------------------- /show_colors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This file echoes a bunch of color codes to the 4 | # terminal to demonstrate what's available. Each 5 | # line is the color code of one forground color, 6 | # out of 17 (default + 16 escapes), followed by a 7 | # test use of that color on all nine background 8 | # colors (default + 8 escapes). 9 | # 10 | 11 | T='gYw' # The test text 12 | # Ascii escape char is 27, Hex \x1B, Octal 033 13 | 14 | COLOR_NAMES=('' Black Red Green Yellow Blue Magenta Cyan White) 15 | LIGHT_DARK=('' Bright) 16 | echo -e "\n 40m 41m 42m 43m\ 17 | 44m 45m 46m 47m"; 18 | FGS=(' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \ 19 | '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \ 20 | ' 36m' '1;36m' ' 37m' '1;37m') 21 | for i in "${!FGS[@]}" 22 | do 23 | FG=${FGS[$i]// /} 24 | c=$((i/2)) 25 | if [ $i -gt 2 ]; then l=$((i-2)); fi 26 | printf -v COLOR "%15s" "${LIGHT_DARK[$((l%2))]} ${COLOR_NAMES[$c]}" 27 | echo -en " $COLOR ${FGS[$i]} \033[$FG $T " 28 | for BG in 40m 41m 42m 43m 44m 45m 46m 47m; 29 | do echo -en " \033[$FG\033[$BG $T \033[0m"; 30 | done 31 | echo; 32 | done 33 | echo 34 | -------------------------------------------------------------------------------- /cookbooks/profile/recipes/vim_setup.rb: -------------------------------------------------------------------------------- 1 | current_user = ENV["SUDO_USER"] 2 | directory File.expand_path("~/.vim") do 3 | action :create 4 | owner current_user 5 | group current_user 6 | end 7 | %w{ swap backup undo }.each do |dir| 8 | directory File.expand_path("~/.vim/#{dir}") do 9 | action :create 10 | owner current_user 11 | group current_user 12 | end 13 | end 14 | vim_plugin_dir = File.expand_path "~/.vim/bundle" 15 | execute "clone vundle" do # ~FC040 16 | command "git clone https://github.com/VundleVim/Vundle.vim #{vim_plugin_dir}/Vundle.vim && vim +PluginInstall +qall 2&> /dev/null "1" }) 35 | action :nothing 36 | end 37 | 38 | 39 | -------------------------------------------------------------------------------- /irssi/hilightwin.pl: -------------------------------------------------------------------------------- 1 | # Print hilighted messages & private messages to window named "hilight" 2 | # for irssi 0.7.99 by Timo Sirainen 3 | use Irssi; 4 | use vars qw($VERSION %IRSSI); 5 | $VERSION = "0.01"; 6 | %IRSSI = ( 7 | authors => "Timo \'cras\' Sirainen", 8 | contact => "tss\@iki.fi", 9 | name => "hilightwin", 10 | description => "Print hilighted messages & private messages to window named \"hilight\"", 11 | license => "Public Domain", 12 | url => "http://irssi.org/", 13 | changed => "2002-03-04T22:47+0100" 14 | ); 15 | 16 | sub sig_printtext { 17 | my ($dest, $text, $stripped) = @_; 18 | 19 | # change to (MSGLEVEL_HILIGHT|MSGLEVEL_MSGS) to work for 20 | # all privmsgs too 21 | if (($dest->{level} & (MSGLEVEL_HILIGHT)) && 22 | ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0) { 23 | $window = Irssi::window_find_name('hilight'); 24 | 25 | if ($dest->{level} & MSGLEVEL_PUBLIC) { 26 | $text = $dest->{target}.": ".$text; 27 | } 28 | $text =~ s/%/%%/g; 29 | $window->print($text, MSGLEVEL_CLIENTCRAP) if ($window); 30 | } 31 | } 32 | 33 | $window = Irssi::window_find_name('hilight'); 34 | Irssi::print("Create a window named 'hilight'") if (!$window); 35 | 36 | Irssi::signal_add('print text', 'sig_printtext'); 37 | -------------------------------------------------------------------------------- /cookbooks/profile/recipes/nvim_setup.rb: -------------------------------------------------------------------------------- 1 | current_user = ENV["SUDO_USER"] 2 | dotfiles_dir = ENV["PWD"] 3 | package "vim" do 4 | action :remove 5 | end 6 | execute "tap neovim" do 7 | command "brew tap neovim/neovim" 8 | end 9 | package "neovim" do 10 | action :install 11 | end 12 | directory File.expand_path("~/.config/nvim") do 13 | action :create 14 | owner current_user 15 | group current_user 16 | end 17 | %w{ swap backup undo }.each do |dir| 18 | directory File.expand_path("~/.config/nvim/#{dir}") do 19 | action :create 20 | owner current_user 21 | group current_user 22 | end 23 | end 24 | 25 | file File.expand_path("~/.nvimrc") do 26 | action :delete 27 | end 28 | 29 | link File.expand_path("~/.config/nvim/init.vim") do 30 | to File.join(dotfiles_dir, "nvimrc") 31 | owner current_user 32 | group current_user 33 | end 34 | 35 | vim_plugin_dir = File.expand_path "~/.config/nvim/autoload/" 36 | 37 | execute "clone vim-plug" do # ~FC040 38 | command "curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ 39 | https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim && nvim +PlugInstall +UpdateRemotePlugins +qall ff', builtin.find_files, {}) 3 | vim.keymap.set('n', 'fg', builtin.live_grep, {}) 4 | vim.keymap.set('n', 'fb', builtin.buffers, {}) 5 | vim.keymap.set('n', 'fh', builtin.help_tags, {}) 6 | vim.keymap.set('n', 'fr', builtin.oldfiles, {}) 7 | require('telescope').setup{ 8 | 9 | defaults = { 10 | -- Default configuration for telescope goes here: 11 | -- config_key = value, 12 | mappings = { 13 | i = { 14 | -- map actions.which_key to (default: ) 15 | -- actions.which_key shows the mappings for your picker, 16 | -- e.g. git_{create, delete, ...}_branch for the git_branches picker 17 | [""] = "which_key" 18 | } 19 | } 20 | }, 21 | pickers = { 22 | -- Default configuration for builtin pickers goes here: 23 | -- picker_name = { 24 | -- picker_config_key = value, 25 | -- ... 26 | -- } 27 | -- Now the picker_config_key will be applied every time you call this 28 | -- builtin picker 29 | }, 30 | extensions = { 31 | -- Your extension configuration goes here: 32 | -- extension_name = { 33 | -- extension_config_key = value, 34 | -- } 35 | -- please take a look at the readme of the extension you want to configure 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /nvim/lua/config/lspconfig.lua: -------------------------------------------------------------------------------- 1 | require 'lspconfig'.lua_ls.setup { 2 | on_init = function(client) 3 | local path = client.workspace_folders[1].name 4 | if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then 5 | return 6 | end 7 | 8 | client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { 9 | runtime = { 10 | -- Tell the language server which version of Lua you're using 11 | -- (most likely LuaJIT in the case of Neovim) 12 | version = 'LuaJIT' 13 | }, 14 | -- Make the server aware of Neovim runtime files 15 | workspace = { 16 | checkThirdParty = false, 17 | library = { 18 | vim.env.VIMRUNTIME 19 | -- Depending on the usage, you might want to add additional paths here. 20 | -- "${3rd}/luv/library" 21 | -- "${3rd}/busted/library", 22 | } 23 | -- or pull in all of 'runtimepath'. NOTE: this is a lot slower 24 | -- library = vim.api.nvim_get_runtime_file("", true) 25 | } 26 | }) 27 | end, 28 | settings = { 29 | Lua = {} 30 | } 31 | } 32 | 33 | local capabilities = vim.lsp.protocol.make_client_capabilities() 34 | capabilities.textDocument.completion.completionItem.snippetSupport = true 35 | 36 | require'lspconfig'.jsonls.setup { 37 | capabilities = capabilities, 38 | } 39 | -------------------------------------------------------------------------------- /cookbooks/profile/recipes/packages.rb: -------------------------------------------------------------------------------- 1 | generic_packages = %w{ 2 | chromedriver 3 | tree 4 | tig 5 | tmux 6 | wget 7 | pv 8 | bash-completion 9 | jq 10 | cmake 11 | hub 12 | } 13 | execute "install homebrew versions" do 14 | command "brew tap homebrew/versions" 15 | not_if "[ -d /usr/local/Library/Taps/homebrew/homebrew-versions ]" 16 | end 17 | 18 | execute "remove bash-completion" do 19 | command "brew unlink bash-completion" 20 | only_if "brew info bash-completion | grep -i poured >/dev/null" 21 | end 22 | 23 | legacy_packages = %w{ 24 | } 25 | legacy_packages.each do |pkg| 26 | execute "remove #{pkg}" do 27 | command "brew uninstall #{pkg}" 28 | not_if "brew info #{pkg}|grep 'Not installed'>/dev/null" 29 | end 30 | end 31 | 32 | mac_tools = %w{ 33 | homebrew/dupes/grep 34 | pstree 35 | the_silver_searcher 36 | awsebcli 37 | awscli 38 | bash-completion2 39 | reattach-to-user-namespace 40 | coreutils } 41 | platform_specific = { 42 | 'mac' => mac_tools, 43 | 'darwin' => mac_tools, 44 | 'linux' => %w{ 45 | python 46 | python-dev 47 | powerline 48 | } 49 | } 50 | if %w{ mac darwin }.include? node['os'] 51 | execute "install diffmerge" do 52 | command "brew cask install diffmerge" 53 | end 54 | end 55 | 56 | (generic_packages + platform_specific[node['os']]).each do |pkg| 57 | package pkg do 58 | action :install 59 | end 60 | end 61 | 62 | 63 | -------------------------------------------------------------------------------- /nvim/lua/plugins/neotest.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-neotest/neotest", 3 | dependencies = { 4 | "nvim-neotest/nvim-nio", 5 | "mrcjkb/rustaceanvim", 6 | "nvim-lua/plenary.nvim", 7 | "antoinemadec/FixCursorHold.nvim", 8 | "nvim-treesitter/nvim-treesitter" 9 | }, 10 | opts = { 11 | adapters = { 12 | -- require('rustaceanvim.neotest'), 13 | }, 14 | }, 15 | keys = { 16 | { "t", "", desc = "+test" }, 17 | { "tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, 18 | { "tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" }, 19 | { "tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, 20 | { "tl", function() require("neotest").run.run_last() end, desc = "Run Last" }, 21 | { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, 22 | { "to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" }, 23 | { "tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" }, 24 | { "tS", function() require("neotest").run.stop() end, desc = "Stop" }, 25 | { "tw", function() require("neotest").watch.toggle(vim.fn.expand("%")) end, desc = "Toggle Watch" }, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /colors/colorspaces.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # Author: Todd Larason 3 | # $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.1 1999/07/11 08:49:54 dawes Exp $ 4 | 5 | print "256 color mode\n\n"; 6 | 7 | # display back ground colors 8 | 9 | for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) { 10 | 11 | # first the system ones: 12 | print "System colors:\n"; 13 | for ($color = 0; $color < 8; $color++) { 14 | print "\x1b[${fgbg};5;${color}m::"; 15 | } 16 | print "\x1b[0m\n"; 17 | for ($color = 8; $color < 16; $color++) { 18 | print "\x1b[${fgbg};5;${color}m::"; 19 | } 20 | print "\x1b[0m\n\n"; 21 | 22 | # now the color cube 23 | print "Color cube, 6x6x6:\n"; 24 | for ($green = 0; $green < 6; $green++) { 25 | for ($red = 0; $red < 6; $red++) { 26 | for ($blue = 0; $blue < 6; $blue++) { 27 | $color = 16 + ($red * 36) + ($green * 6) + $blue; 28 | print "\x1b[${fgbg};5;${color}m::"; 29 | } 30 | print "\x1b[0m "; 31 | } 32 | print "\n"; 33 | } 34 | 35 | # now the grayscale ramp 36 | print "Grayscale ramp:\n"; 37 | for ($color = 232; $color < 256; $color++) { 38 | print "\x1b[${fgbg};5;${color}m::"; 39 | } 40 | print "\x1b[0m\n\n"; 41 | 42 | } 43 | 44 | print "Examples for the 3-byte color mode\n\n"; 45 | 46 | for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) { 47 | 48 | # now the color cube 49 | print "Color cube\n"; 50 | for ($green = 0; $green < 256; $green+=51) { 51 | for ($red = 0; $red < 256; $red+=51) { 52 | for ($blue = 0; $blue < 256; $blue+=51) { 53 | print "\x1b[${fgbg};2;${red};${green};${blue}m::"; 54 | } 55 | print "\x1b[0m "; 56 | } 57 | print "\n"; 58 | } 59 | 60 | # now the grayscale ramp 61 | print "Grayscale ramp:\n"; 62 | for ($gray = 8; $gray < 256; $gray+=10) { 63 | print "\x1b[${fgbg};2;${gray};${gray};${gray}m::"; 64 | } 65 | print "\x1b[0m\n\n"; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /colors/24bitcolors.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # Author: Todd Larason 3 | # $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.1 1999/07/11 08:49:54 dawes Exp $ 4 | 5 | print "256 color mode\n\n"; 6 | 7 | # display back ground colors 8 | 9 | for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) { 10 | 11 | # first the system ones: 12 | print "System colors:\n"; 13 | for ($color = 0; $color < 8; $color++) { 14 | print "\x1b[${fgbg};5;${color}m::"; 15 | } 16 | print "\x1b[0m\n"; 17 | for ($color = 8; $color < 16; $color++) { 18 | print "\x1b[${fgbg};5;${color}m::"; 19 | } 20 | print "\x1b[0m\n\n"; 21 | 22 | # now the color cube 23 | print "Color cube, 6x6x6:\n"; 24 | for ($green = 0; $green < 6; $green++) { 25 | for ($red = 0; $red < 6; $red++) { 26 | for ($blue = 0; $blue < 6; $blue++) { 27 | $color = 16 + ($red * 36) + ($green * 6) + $blue; 28 | print "\x1b[${fgbg};5;${color}m::"; 29 | } 30 | print "\x1b[0m "; 31 | } 32 | print "\n"; 33 | } 34 | 35 | # now the grayscale ramp 36 | print "Grayscale ramp:\n"; 37 | for ($color = 232; $color < 256; $color++) { 38 | print "\x1b[${fgbg};5;${color}m::"; 39 | } 40 | print "\x1b[0m\n\n"; 41 | 42 | } 43 | 44 | print "Examples for the 3-byte color mode\n\n"; 45 | 46 | for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) { 47 | 48 | # now the color cube 49 | print "Color cube\n"; 50 | for ($green = 0; $green < 256; $green+=51) { 51 | for ($red = 0; $red < 256; $red+=51) { 52 | for ($blue = 0; $blue < 256; $blue+=51) { 53 | print "\x1b[${fgbg};2;${red};${green};${blue}m::"; 54 | } 55 | print "\x1b[0m "; 56 | } 57 | print "\n"; 58 | } 59 | 60 | # now the grayscale ramp 61 | print "Grayscale ramp:\n"; 62 | for ($gray = 8; $gray < 256; $gray+=10) { 63 | print "\x1b[${fgbg};2;${gray};${gray};${gray}m::"; 64 | } 65 | print "\x1b[0m\n\n"; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /smb_mount.sh: -------------------------------------------------------------------------------- 1 | smb_mount() { 2 | if [ -f ~/.smbrc ]; then 3 | . ~/.smbrc 4 | fi 5 | local smb_host=$1 6 | local smb_host_uri=$smb_user:$smb_password@$smb_host 7 | local smb_share=$2 8 | local smb_mount_point=$3 9 | local result exit_code 10 | 11 | 12 | if [ -z $smb_host ] || [ -z $smb_share ]; then 13 | cat <<-USAGE 14 | smb_mount {host} {share_name} {mount_point} 15 | 16 | Parameters 17 | ========== 18 | Host: The hostname or ip address only. 19 | Sharename: The name of the share on the remote host. 20 | Mount point: Optional (will default to /Volumes/{Sharename}) 21 | 22 | Authentication 23 | ============== 24 | This function will use smb_user and smb_password environment variables, 25 | or it will pull those values from a ~/.smbrc file. syntax is: 26 | smb_user={username} 27 | smb_password={password} 28 | NOTE: no spaces between the equal sign. 29 | USAGE 30 | return 1; 31 | fi 32 | if [ -z $smb_mount_point ]; then 33 | smb_mount_point=/Volumes/$smb_share 34 | fi 35 | if ! mount | grep " $smb_mount_point " >/dev/null; then 36 | mkdir -p $smb_mount_point 37 | echo mount -t smbfs //${smb_host_uri}/$smb_share $smb_mount_point 38 | result=$(mount -t smbfs //${smb_host_uri}/$smb_share $smb_mount_point 2>&1) 39 | exit_code=$? 40 | if [ $exit_code -ne 0 ]; then 41 | re='server connection failed: Socket is not connected' 42 | if [[ $result =~ $re ]]; then 43 | echo "'mount -t smbfs' failed, falling back to mount_smbfs" 44 | result=$(mount_smbfs -s //${smb_host_uri}/$smb_share $smb_mount_point 2>&1) 45 | exit_code=$? 46 | if [ $exit_code -ne 0 ]; then 47 | echo "mount failed (exit_code: $exit_code): $result" 48 | return 1 49 | fi 50 | fi 51 | fi 52 | else 53 | echo "$smb_mount_point already mounted." 54 | fi 55 | } 56 | -------------------------------------------------------------------------------- /nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'nvim-treesitter/nvim-treesitter', 3 | dependencies = {'windwp/nvim-ts-autotag'}, 4 | cmd = {'TSInstall', 'TSBufEnable', 'TSBufDisable', 'TSModuleInfo'}, 5 | build = ':TSUpdate', 6 | config = function() 7 | local configs = require('nvim-treesitter.configs') 8 | local parsers = require('nvim-treesitter.parsers') 9 | 10 | configs.setup { 11 | highlight = { 12 | enable = true, 13 | disable = {}, 14 | }, 15 | indent = { 16 | enable = true, 17 | disable = {}, 18 | }, 19 | matchup = { 20 | enable = true, 21 | disable = {}, 22 | }, 23 | ensure_installed = { 24 | 'markdown', 25 | 'markdown_inline', 26 | 'tsx', 27 | 'typescript', 28 | 'php', 29 | 'json', 30 | 'yaml', 31 | 'css', 32 | 'scss', 33 | 'html', 34 | 'javascript', 35 | 'lua', 36 | 'vim', 37 | 'vimdoc', 38 | 'jsdoc', 39 | 'graphql', 40 | 'bash', 41 | 'prisma', 42 | 'svelte', 43 | 'sql', 44 | 'rust', 45 | 'regex', 46 | }, 47 | autotag = { 48 | enable = true, 49 | enable_rename = true, 50 | enable_close = true, 51 | enable_close_on_slash = false, 52 | }, 53 | context_commentstring = { 54 | enable = true, 55 | enable_autocmd = false, 56 | }, 57 | incremental_selection = { 58 | enable = true, 59 | keymaps = { 60 | init_selection = 'gi', 61 | scope_incremental = 'gs', 62 | node_incremental = 'gi', 63 | node_decremental = 'gd', 64 | }, 65 | }, 66 | } 67 | 68 | local parser_configs = parsers.get_parser_configs(); 69 | parser_configs.tsx.filetype_to_parsername = {'javascript', 'typescript.tsx'} 70 | end 71 | } 72 | -------------------------------------------------------------------------------- /scripts/init_node_proj.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | app_name=${1:-$(basename $PWD)} 3 | cat < package.json 4 | { 5 | "name": "$app_name", 6 | "version": "0.0.1", 7 | "main": "main.js", 8 | "scripts": { 9 | "lint": "npm run lint-json && npm run lint-js && npm run lint-js-style", 10 | "lint-json": "jsonlint -q package.json .jscsrc .jshintrc", 11 | "lint-js": "jshint .", 12 | "lint-js-style": "jscs ." 13 | } 14 | } 15 | PACKAGE 16 | [ -f main.js ] || touch main.js 17 | CAT < .jscrc 18 | { 19 | "preset": "crockford", 20 | "validateIndentation": 2, 21 | "excludeFiles": ["node_modules", "bower_components"] 22 | } 23 | JSCRC 24 | 25 | CAT < .jshintignore 26 | **/node_modules 27 | **/bower_components 28 | JSHINTIGNORE 29 | 30 | CAT <<'JSHINT' > .jshintrc 31 | { 32 | "camelcase": true, // Require variable names to be camelCased 33 | "curly": true, // Require {} following if, for, while and do statements 34 | "eqeqeq": true, // Require `===` and `!==` 35 | "forin": true, // Require all `for in` statements to filter `hasOwnProperty` 36 | "immed": true, // Require IIFEs to be wrapped in parens e.g. `(function () { } ());` 37 | "indent": 2, // Require indentation of 2 spaces 38 | "newcap": true, // Require capitalization of constructor functions e.g. `new F()` 39 | "noarg": true, // Prohibit use of deprecated `arguments.caller` and `arguments.callee` 40 | "nonbsp": true, // Prohibit UTF-8 breaking nbsp characters 41 | "nonew": true, // Prohibit use of constructor functions for side-effects 42 | "quotmark": "single", // Require single quotes for consistency 43 | "undef": true, // Require all variables be declared 44 | "unused": true, // Require all variables to be used 45 | "strict": true, // Require ES5 Strict mode 46 | "maxlen": 120, // Require all lines to be less than 120 characters long 47 | "node": true // Defines node specific global variables (REMOVE IF PROJECT SPECIFIC) 48 | } 49 | JSHINT 50 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lualine.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | 'nvim-lualine/lualine.nvim', 4 | dependencies = { 'nvim-tree/nvim-web-devicons' }, 5 | lazy = false, 6 | opts = { 7 | config = { 8 | icons_enabled = true, 9 | theme = 'auto', 10 | component_separators = { left = '', right = ''}, 11 | section_separators = { left = '', right = ''}, 12 | disabled_filetypes = { 13 | statusline = {}, 14 | winbar = {}, 15 | }, 16 | ignore_focus = {}, 17 | always_divide_middle = true, 18 | globalstatus = false, 19 | refresh = { 20 | statusline = 1000, 21 | tabline = 1000, 22 | winbar = 1000, 23 | } 24 | }, 25 | sections = { 26 | lualine_a = {'mode'}, 27 | lualine_b = {'branch', 'diff', 'diagnostics'}, 28 | lualine_c = {'filename'}, 29 | lualine_x = {'encoding', 'fileformat', 'filetype'}, 30 | lualine_y = {'progress'}, 31 | lualine_z = {'location'} 32 | }, 33 | inactive_sections = { 34 | lualine_a = {}, 35 | lualine_b = {}, 36 | lualine_c = {'filename'}, 37 | lualine_x = {'location'}, 38 | lualine_y = {}, 39 | lualine_z = {} 40 | }, 41 | tabline = { 42 | lualine_a = {'buffers'}, 43 | lualine_b = {}, 44 | lualine_c = {}, 45 | lualine_x = {}, 46 | lualine_y = {}, 47 | lualine_z = {'tabs'} 48 | }, 49 | winbar = {}, 50 | inactive_winbar = {}, 51 | extensions = {} 52 | }, 53 | keys = { 54 | { "1", "LualineBuffersJump 1", desc = "Jump to buffer 1" }, 55 | { "2", "LualineBuffersJump 2", desc = "Jump to buffer 2" }, 56 | { "3", "LualineBuffersJump 3", desc = "Jump to buffer 3" }, 57 | { "4", "LualineBuffersJump 4", desc = "Jump to buffer 4" }, 58 | { "5", "LualineBuffersJump 5", desc = "Jump to buffer 5" }, 59 | { "6", "LualineBuffersJump 5", desc = "Jump to buffer 6" }, 60 | { "7", "LualineBuffersJump 7", desc = "Jump to buffer 7" }, 61 | { "8", "LualineBuffersJump 8", desc = "Jump to buffer 8" }, 62 | { "9", "LualineBuffersJump 9", desc = "Jump to buffer 9" }, 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /colors/24-bit-color.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This file was originally taken from iterm2 https://github.com/gnachman/iTerm2/blob/master/tests/24-bit-color.sh 3 | # 4 | # This file echoes a bunch of 24-bit color codes 5 | # to the terminal to demonstrate its functionality. 6 | # The foreground escape sequence is ^[38;2;;;m 7 | # The background escape sequence is ^[48;2;;;m 8 | # range from 0 to 255 inclusive. 9 | # The escape sequence ^[0m returns output to default 10 | 11 | setBackgroundColor() 12 | { 13 | #printf '\x1bPtmux;\x1b\x1b[48;2;%s;%s;%sm' $1 $2 $3 14 | printf '\x1b[48;2;%s;%s;%sm' $1 $2 $3 15 | } 16 | 17 | resetOutput() 18 | { 19 | echo -en "\x1b[0m\n" 20 | } 21 | 22 | # Gives a color $1/255 % along HSV 23 | # Who knows what happens when $1 is outside 0-255 24 | # Echoes "$red $green $blue" where 25 | # $red $green and $blue are integers 26 | # ranging between 0 and 255 inclusive 27 | rainbowColor() 28 | { 29 | let h=$1/43 30 | let f=$1-43*$h 31 | let t=$f*255/43 32 | let q=255-t 33 | 34 | if [ $h -eq 0 ] 35 | then 36 | echo "255 $t 0" 37 | elif [ $h -eq 1 ] 38 | then 39 | echo "$q 255 0" 40 | elif [ $h -eq 2 ] 41 | then 42 | echo "0 255 $t" 43 | elif [ $h -eq 3 ] 44 | then 45 | echo "0 $q 255" 46 | elif [ $h -eq 4 ] 47 | then 48 | echo "$t 0 255" 49 | elif [ $h -eq 5 ] 50 | then 51 | echo "255 0 $q" 52 | else 53 | # execution should never reach here 54 | echo "0 0 0" 55 | fi 56 | } 57 | 58 | for i in `seq 0 127`; do 59 | setBackgroundColor $i 0 0 60 | echo -en " " 61 | done 62 | resetOutput 63 | for i in `seq 255 -1 128`; do 64 | setBackgroundColor $i 0 0 65 | echo -en " " 66 | done 67 | resetOutput 68 | 69 | for i in `seq 0 127`; do 70 | setBackgroundColor 0 $i 0 71 | echo -n " " 72 | done 73 | resetOutput 74 | for i in `seq 255 -1 128`; do 75 | setBackgroundColor 0 $i 0 76 | echo -n " " 77 | done 78 | resetOutput 79 | 80 | for i in `seq 0 127`; do 81 | setBackgroundColor 0 0 $i 82 | echo -n " " 83 | done 84 | resetOutput 85 | for i in `seq 255 -1 128`; do 86 | setBackgroundColor 0 0 $i 87 | echo -n " " 88 | done 89 | resetOutput 90 | 91 | for i in `seq 0 127`; do 92 | setBackgroundColor `rainbowColor $i` 93 | echo -n " " 94 | done 95 | resetOutput 96 | for i in `seq 255 -1 128`; do 97 | setBackgroundColor `rainbowColor $i` 98 | echo -n " " 99 | done 100 | resetOutput 101 | -------------------------------------------------------------------------------- /tmux.conf: -------------------------------------------------------------------------------- 1 | # set colors 2 | #set -g default-terminal "screen-256color" 3 | 4 | set -s default-terminal screen-256color 5 | set -sa terminal-overrides ",*-256color:Tc" 6 | setw -g xterm-keys on 7 | # set the base index for windows to 1 8 | set -g base-index 1 9 | #set -g quiet on 10 | 11 | # set the base index for panes to 1 12 | set -g pane-base-index 1 13 | 14 | # set prefix 15 | set-option -g prefix C-a 16 | unbind C-b 17 | bind C-a send-prefix 18 | 19 | # split windows with with Ctrl + a | and _ 20 | unbind % 21 | bind | split-window -h -c "#{pane_current_path}" 22 | bind _ split-window -v -c "#{pane_current_path}" 23 | 24 | setw -g mode-keys vi 25 | 26 | # set window list 27 | setw -g window-status-style fg=green 28 | setw -g window-status-style bg=default 29 | setw -g window-status-style dim 30 | 31 | # Set status bar 32 | set -g status-bg colour21 33 | set -g status-fg colour06 34 | set -g status-left '#[fg=green]#H: #[fg=colour08]#S #[fg=green]|' 35 | set -g status-left-length 300 36 | 37 | # set right status bar content 38 | set -g status-right '#[fg=green] | #[fg=colour08]#(date +"%A %F %R")' 39 | 40 | set -g status-interval 60 41 | 42 | # Highlight active window 43 | set-window-option -g window-status-current-style fg=colour21 44 | set-window-option -g window-status-current-style bg=colour18 45 | 46 | # Agressive resize 47 | setw -g aggressive-resize on 48 | 49 | # Activity Monitoring 50 | setw -g monitor-activity on 51 | set -g visual-activity on 52 | 53 | # center the window list 54 | set -g status-justify centre 55 | 56 | bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log" 57 | 58 | # moving between panes 59 | bind h select-pane -L 60 | bind j select-pane -D 61 | bind k select-pane -U 62 | bind l select-pane -R 63 | 64 | bind -n S-F1 select-pane -t 1 65 | bind -n S-F2 select-pane -t 2 66 | bind -n S-F3 select-pane -t 3 67 | bind -n S-F4 select-pane -t 4 68 | bind -n S-F5 select-pane -t 5 69 | bind -n S-F6 select-pane -t 6 70 | bind -n S-F7 select-pane -t 7 71 | bind -n S-F8 select-pane -t 8 72 | 73 | bind -n M-1 select-window -t 1 74 | bind -n M-2 select-window -t 2 75 | bind -n M-3 select-window -t 3 76 | bind -n M-4 select-window -t 4 77 | bind -n M-5 select-window -t 5 78 | bind -n M-6 select-window -t 6 79 | bind -n M-7 select-window -t 7 80 | bind -n M-8 select-window -t 8 81 | bind -n M-9 select-window -t 9 82 | 83 | bind -r C-h select-window -t :- 84 | bind -r C-l select-window -t :+ 85 | 86 | # Pane resizing 87 | bind -r H resize-pane -L 5 88 | bind -r J resize-pane -D 5 89 | bind -r K resize-pane -U 5 90 | bind -r L resize-pane -R 5 91 | 92 | bind O kill-pane -a 93 | 94 | if-shell "[ -f ~/.osx-paste-fix.conf ]" 'source ~/.osx-paste-fix.conf' 95 | 96 | set-option -g history-limit 4000 97 | 98 | # this is set a the session level, not when you attach 99 | set-option -g update-environment 'ITERM_PROFILE COLORFGBG' 100 | 101 | bind C new-session 102 | # 103 | # Fixing bug requring escape to be double pressed. https://github.com/tmux/tmux/issues/131 104 | set -g escape-time 10 105 | 106 | set-option -g focus-events on 107 | -------------------------------------------------------------------------------- /nvimrc.old: -------------------------------------------------------------------------------- 1 | call plug#begin('~/.local/share/nvim/site/plugged') 2 | 3 | Plug 'Shougo/denite.nvim' 4 | Plug 'Shougo/neomru.vim' 5 | Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} 6 | Plug 'vim-airline/vim-airline' 7 | Plug 'vim-airline/vim-airline-themes' 8 | Plug 'chriskempson/base16-vim' 9 | Plug 'ntpeters/vim-better-whitespace' 10 | Plug 'nathanaelkane/vim-indent-guides' 11 | Plug 'duff/vim-bufonly' 12 | 13 | call plug#end() 14 | if filereadable(expand("~/.vimrc_background")) 15 | let base16colorspace=256 16 | source ~/.vimrc_background 17 | endif 18 | "let g:airline#extensions#branch#enabled = 1 19 | "let g:airline#extensions#syntastic#enabled = 1 20 | " enable tabs for buffers at the top 21 | let g:airline#extensions#tabline#enabled = 1 22 | let g:airline#extensions#tabline#buffer_idx_mode = 1 23 | nmap 1 AirlineSelectTab1 24 | nmap 2 AirlineSelectTab2 25 | nmap 3 AirlineSelectTab3 26 | nmap 4 AirlineSelectTab4 27 | nmap 5 AirlineSelectTab5 28 | nmap 6 AirlineSelectTab6 29 | nmap 7 AirlineSelectTab7 30 | nmap 8 AirlineSelectTab8 31 | nmap 9 AirlineSelectTab9 32 | let g:airline_powerline_fonts = 1 33 | let g:airline_symbols = {} 34 | 35 | "set autochdir 36 | " Filenames for the tag command 37 | set tags=./tags;$HOME,./ctags;$HOME,./.vimtags;$HOME 38 | " Do not wrap lines longer than the window's width 39 | set nowrap 40 | set relativenumber 41 | set number 42 | set ts=2 43 | set sw=2 44 | set expandtab 45 | let g:indent_guides_guide_size=1 46 | let g:indent_guides_start_level=2 47 | let mapleader = ',' 48 | 49 | " By default denite uses find 50 | call denite#custom#var('file_rec', 'command', 51 | \ ['ag', '--follow', '--nocolor', '--nogroup', '-g', '']) 52 | call denite#custom#source( 53 | \ 'file_mru', 'matchers', ['matcher_fuzzy', 'matcher_project_files']) 54 | call denite#custom#source('file_mru', 'converters', 55 | \ ['converter_relative_word']) 56 | call denite#custom#alias('source', 'file_rec/git', 'file_rec') 57 | call denite#custom#var('file_rec/git', 'command', 58 | \ ['git', 'ls-files', '-co', '--exclude-standard']) 59 | call denite#custom#map( 60 | \ 'insert', 61 | \ '', 62 | \ '', 63 | \ 'noremap' 64 | \) 65 | call denite#custom#map( 66 | \ 'insert', 67 | \ '', 68 | \ '', 69 | \ 'noremap' 70 | \) 71 | 72 | call denite#custom#var('grep', 'command', ['ag']) 73 | call denite#custom#var('grep', 'default_opts', 74 | \ ['-i', '--vimgrep']) 75 | call denite#custom#var('grep', 'recursive_opts', []) 76 | call denite#custom#var('grep', 'pattern_opt', []) 77 | call denite#custom#var('grep', 'separator', ['--']) 78 | call denite#custom#var('grep', 'final_opts', []) 79 | 80 | nnoremap r :Denite file_old 81 | nnoremap :Denite buffer 82 | nnoremap :Denite file_mru file_rec/git buffer file_rec line 83 | nnoremap f :Denite grep 84 | imap jj 85 | nnoremap sw :StripWhitespace 86 | map m :NERDTreeToggle 87 | nmap n :NERDTreeFind 88 | nmap O :BufOnly 89 | "guicolors 90 | set termguicolors 91 | -------------------------------------------------------------------------------- /fonts/10-powerline-symbols.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | monospace 7 | PowerlineSymbols 8 | 9 | 10 | Droid Sans Mono 11 | PowerlineSymbols 12 | 13 | 14 | Droid Sans Mono Slashed 15 | PowerlineSymbols 16 | 17 | 18 | Droid Sans Mono Dotted 19 | PowerlineSymbols 20 | 21 | 22 | DejaVu Sans Mono 23 | PowerlineSymbols 24 | 25 | 26 | DejaVu Sans Mono 27 | PowerlineSymbols 28 | 29 | 30 | Envy Code R 31 | PowerlineSymbols 32 | 33 | 34 | Inconsolata 35 | PowerlineSymbols 36 | 37 | 38 | Lucida Console 39 | PowerlineSymbols 40 | 41 | 42 | Monaco 43 | PowerlineSymbols 44 | 45 | 46 | Pragmata 47 | PowerlineSymbols 48 | 49 | 50 | PragmataPro 51 | PowerlineSymbols 52 | 53 | 54 | Menlo 55 | PowerlineSymbols 56 | 57 | 58 | Source Code Pro 59 | PowerlineSymbols 60 | 61 | 62 | Consolas 63 | PowerlineSymbols 64 | 65 | 66 | Anonymous pro 67 | PowerlineSymbols 68 | 69 | 70 | Bitstream Vera Sans Mono 71 | PowerlineSymbols 72 | 73 | 74 | Liberation Mono 75 | PowerlineSymbols 76 | 77 | 78 | Ubuntu Mono 79 | PowerlineSymbols 80 | 81 | 82 | Meslo LG L 83 | PowerlineSymbols 84 | 85 | 86 | Meslo LG L DZ 87 | PowerlineSymbols 88 | 89 | 90 | Meslo LG M 91 | PowerlineSymbols 92 | 93 | 94 | Meslo LG M DZ 95 | PowerlineSymbols 96 | 97 | 98 | Meslo LG S 99 | PowerlineSymbols 100 | 101 | 102 | Meslo LG S DZ 103 | PowerlineSymbols 104 | 105 | 106 | -------------------------------------------------------------------------------- /fonts/10-powerline-symbols.conf.1: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | monospace 7 | PowerlineSymbols 8 | 9 | 10 | Droid Sans Mono 11 | PowerlineSymbols 12 | 13 | 14 | Droid Sans Mono Slashed 15 | PowerlineSymbols 16 | 17 | 18 | Droid Sans Mono Dotted 19 | PowerlineSymbols 20 | 21 | 22 | DejaVu Sans Mono 23 | PowerlineSymbols 24 | 25 | 26 | DejaVu Sans Mono 27 | PowerlineSymbols 28 | 29 | 30 | Envy Code R 31 | PowerlineSymbols 32 | 33 | 34 | Inconsolata 35 | PowerlineSymbols 36 | 37 | 38 | Lucida Console 39 | PowerlineSymbols 40 | 41 | 42 | Monaco 43 | PowerlineSymbols 44 | 45 | 46 | Pragmata 47 | PowerlineSymbols 48 | 49 | 50 | PragmataPro 51 | PowerlineSymbols 52 | 53 | 54 | Menlo 55 | PowerlineSymbols 56 | 57 | 58 | Source Code Pro 59 | PowerlineSymbols 60 | 61 | 62 | Consolas 63 | PowerlineSymbols 64 | 65 | 66 | Anonymous pro 67 | PowerlineSymbols 68 | 69 | 70 | Bitstream Vera Sans Mono 71 | PowerlineSymbols 72 | 73 | 74 | Liberation Mono 75 | PowerlineSymbols 76 | 77 | 78 | Ubuntu Mono 79 | PowerlineSymbols 80 | 81 | 82 | Meslo LG L 83 | PowerlineSymbols 84 | 85 | 86 | Meslo LG L DZ 87 | PowerlineSymbols 88 | 89 | 90 | Meslo LG M 91 | PowerlineSymbols 92 | 93 | 94 | Meslo LG M DZ 95 | PowerlineSymbols 96 | 97 | 98 | Meslo LG S 99 | PowerlineSymbols 100 | 101 | 102 | Meslo LG S DZ 103 | PowerlineSymbols 104 | 105 | 106 | -------------------------------------------------------------------------------- /nvim/README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Leader 3 | 4 | Leader key defines how you initiate your custom shortcuts, currently set to space here: 5 | ``` 6 | vim.g.mapleader = " " 7 | ``` 8 | ### TODO, look up what maplocalleader means 9 | vim.g.maplocalleader = "\\" 10 | 11 | ## Telescope plugin 12 | 13 | Typical plugin to identify and work with files and directories. 14 | 15 | ### shortcuts 16 | vim.keymap.set('n', 'ff', builtin.find_files, {}) 17 | vim.keymap.set('n', 'fg', builtin.live_grep, {}) 18 | vim.keymap.set('n', 'fb', builtin.buffers, {}) 19 | vim.keymap.set('n', 'fh', builtin.help_tags, {}) 20 | vim.keymap.set('n', 'fr', builtin.oldfiles, {}) 21 | 22 | 23 | ## Lualine 24 | 25 | Defines the top and bottom line displays 26 | 27 | 28 | { "1", "LualineBuffersJump 1", desc = "Jump to buffer 1" }, 29 | { "2", "LualineBuffersJump 2", desc = "Jump to buffer 2" }, 30 | { "3", "LualineBuffersJump 3", desc = "Jump to buffer 3" }, 31 | { "4", "LualineBuffersJump 4", desc = "Jump to buffer 4" }, 32 | { "5", "LualineBuffersJump 5", desc = "Jump to buffer 5" }, 33 | { "6", "LualineBuffersJump 5", desc = "Jump to buffer 6" }, 34 | { "7", "LualineBuffersJump 7", desc = "Jump to buffer 7" }, 35 | { "8", "LualineBuffersJump 8", desc = "Jump to buffer 8" }, 36 | { "9", "LualineBuffersJump 9", desc = "Jump to buffer 9" }, 37 | 38 | 39 | ## Neotest 40 | Runs configured test framework. 41 | { "t", "", desc = "+test" }, 42 | { "tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, 43 | { "tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" }, 44 | { "tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, 45 | { "tl", function() require("neotest").run.run_last() end, desc = "Run Last" }, 46 | { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, 47 | { "to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" }, 48 | { "tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" }, 49 | { "tS", function() require("neotest").run.stop() end, desc = "Stop" }, 50 | { "tw", function() require("neotest").watch.toggle(vim.fn.expand("%")) end, desc = "Toggle Watch" }, 51 | 52 | ## Neotree 53 | Shows context specific tree view 54 | { ",t", "Neotree toggle", desc = "NeoTree Toggle" }, 55 | { ",r", "Neotree reveal", desc = "NeoTree Reveal" }, 56 | { ",b", "Neotree buffers", desc = "NeoTree buffers" }, 57 | { ",g", "Neotree git_status", desc = "NeoTree Gitstatus" }, 58 | { ",s", "Neotree document_symbols", desc = "NeoTree Symbols" }, 59 | 60 | 61 | ## Not sure what thes shortcuts are 62 | init_selection = 'gi', 63 | scope_incremental = 'gs', 64 | node_incremental = 'gi', 65 | node_decremental = 'gd', 66 | -------------------------------------------------------------------------------- /nvim/old_init.vm: -------------------------------------------------------------------------------- 1 | call plug#begin('~/.local/share/nvim/site/plugged') 2 | 3 | Plug 'vim-airline/vim-airline' 4 | Plug 'vim-airline/vim-airline-themes' 5 | Plug 'chriskempson/base16-vim' 6 | Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} 7 | Plug 'prabirshrestha/vim-lsp' 8 | Plug 'mattn/vim-lsp-settings' 9 | Plug 'tpope/vim-commentary' 10 | Plug 'tpope/vim-eunuch' 11 | Plug 'tpope/vim-repeat' 12 | Plug 'tpope/vim-speeddating' 13 | Plug 'tpope/vim-surround' 14 | Plug 'tpope/vim-vinegar' 15 | Plug 'uarun/vim-protobuf' 16 | Plug 'rust-lang/rust.vim' 17 | Plug 'simrat39/rust-tools.nvim' 18 | Plug 'nvim-neo-tree/neo-tree.nvim' 19 | Plug 'nvim-lua/plenary.nvim' 20 | Plug 'nvim-tree/nvim-web-devicons' 21 | Plug 'MunifTanjim/nui.nvim' 22 | Plug 'antoinemadec/FixCursorHold.nvim' 23 | Plug 'nvim-neotest/nvim-nio' 24 | Plug 'nvim-neotest/neotest' 25 | Plug 'rouge8/neotest-rust' 26 | 27 | call plug#end() 28 | 29 | if filereadable(expand("~/.vimrc_background")) 30 | let base16colorspace=256 31 | source ~/.vimrc_background 32 | endif 33 | " set background=dark 34 | colorscheme base16-default-dark 35 | 36 | "let g:airline#extensions#branch#enabled = 1 37 | "let g:airline#extensions#syntastic#enabled = 1 38 | " enable tabs for buffers at the top 39 | let g:airline#extensions#tabline#enabled = 1 40 | let g:airline#extensions#tabline#buffer_idx_mode = 1 41 | nmap 1 AirlineSelectTab1 42 | nmap 2 AirlineSelectTab2 43 | nmap 3 AirlineSelectTab3 44 | nmap 4 AirlineSelectTab4 45 | nmap 5 AirlineSelectTab5 46 | nmap 6 AirlineSelectTab6 47 | nmap 7 AirlineSelectTab7 48 | nmap 8 AirlineSelectTab8 49 | nmap 9 AirlineSelectTab9 50 | let g:airline_powerline_fonts = 1 51 | let g:airline_symbols = {} 52 | 53 | set nowrap 54 | set relativenumber 55 | set number 56 | set ts=2 57 | set sw=2 58 | set expandtab 59 | let g:indent_guides_guide_size=1 60 | let g:indent_guides_start_level=2 61 | let mapleader = ',' 62 | 63 | " let g:lsp_log_verbose = 1 64 | " let g:lsp_log_file = expand('~/vim-lsp.log') 65 | 66 | " Neotree 67 | nmap ,n :Neotree reveal 68 | nmap ,m :Neotree toggle 69 | nmap ,b :Neotree buffers 70 | nmap ,g :Neotree git_status 71 | 72 | 73 | if executable('pylsp') 74 | " pip install python-lsp-server 75 | au User lsp_setup call lsp#register_server({ 76 | \ 'name': 'pylsp', 77 | \ 'cmd': {server_info->['pylsp']}, 78 | \ 'allowlist': ['python'], 79 | \ }) 80 | endif 81 | 82 | function! s:on_lsp_buffer_enabled() abort 83 | setlocal omnifunc=lsp#complete 84 | setlocal signcolumn=yes 85 | if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif 86 | nmap gd (lsp-definition) 87 | nmap gs (lsp-document-symbol-search) 88 | nmap gS (lsp-workspace-symbol-search) 89 | nmap gr (lsp-references) 90 | nmap gi (lsp-implementation) 91 | nmap gt (lsp-type-definition) 92 | nmap rn (lsp-rename) 93 | nmap [g (lsp-previous-diagnostic) 94 | nmap ]g (lsp-next-diagnostic) 95 | nmap K (lsp-hover) 96 | nnoremap lsp#scroll(+4) 97 | nnoremap lsp#scroll(-4) 98 | " simple code action for normal mode and visual mode 99 | nmap (lsp-code-action) 100 | vmap :LspCodeAction 101 | 102 | " alternative that uses floating window 103 | " nmap f (lsp-code-action-float) 104 | 105 | " mapping for filtered code actions 106 | nmap ri :LspCodeAction refactor.inline 107 | nmap ro :LspCodeAction source.organizeImports 108 | vmap rm :LspCodeAction refactor.extract 109 | nmap rm :LspCodeAction refactor.extract 110 | 111 | let g:lsp_format_sync_timeout = 1000 112 | autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync') 113 | 114 | " refer to doc to add more commands 115 | endfunction 116 | 117 | augroup lsp_install 118 | au! 119 | " call s:on_lsp_buffer_enabled only for languages that has the server registered. 120 | autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() 121 | augroup END 122 | -------------------------------------------------------------------------------- /makesetup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | [[ "$OSTYPE" == "darwin"* ]] && IS_MAC=true 4 | 5 | SCRIPT_DIR=`pwd -P` 6 | DEVELOPMENT=~/Development 7 | 8 | has_brew() { 9 | which brew >/dev/null 10 | } 11 | 12 | link_config_file() { 13 | file=$1 14 | destination=${2-$file} 15 | if [ ! -L ~/.$destination -a ! -f ~/.$destination.keep ]; then 16 | if [ -f ~/.$destination ]; then 17 | echo "creating backup of existing file to .$destination.bak" 18 | mv ~/.$destination ~/.$destination.bak 19 | fi 20 | echo "ln -s $SCRIPT_DIR/$file ~/.$destination" 21 | ln -s $SCRIPT_DIR/$file ~/.$destination 22 | fi 23 | } 24 | 25 | FILES=( 26 | vimrc 27 | nvimrc 28 | bashrc 29 | gemrc 30 | gitconfig 31 | gitignore 32 | tmux.conf 33 | bash_profile 34 | tigrc 35 | my.cnf 36 | pryrc 37 | editrc 38 | inputrc 39 | rspec 40 | jshintrc 41 | smb_mount.sh 42 | ) 43 | for i in ${FILES[@]} 44 | do 45 | link_config_file $i; 46 | done 47 | 48 | # installing irssi customizations 49 | # test -d ~/.irssi || mkdir ~/.irssi 50 | # link_config_file "irssirc" "irssi/config" 51 | # link_config_file "sshconfig" "ssh/config" 52 | # test -d ~/.irssi/irssi-colors-solarized || git clone git://github.com/huyz/irssi-colors-solarized.git ~/.irssi/irssi-colors-solarized 53 | # mkdir -p ~/.irssi/scripts 54 | # if [ ! -L ~/.irssi/scripts/autorun ]; then 55 | # ln -s `pwd`/irssi ~/.irssi/scripts/autorun 56 | # fi 57 | if [ -f ~/.gitignore_global ] && ! [ -L ~/.gitignore_global ] 58 | then 59 | if ! [ -f ~/.gitignore ]; then 60 | mv ~/.gitignore_global ~/.gitignore 61 | else 62 | mv ~/.gitignore_global ~/.gitignore_global.bak 63 | fi 64 | fi 65 | [ -L ~/.gitignore_global ] || ln -s $(readlink -f ~/.gitignore) ~/.gitignore_global 66 | if [ -f ~/.gitignore_global.bak ]; then 67 | echo "move gitignore_globals and delete bak." 68 | diff -u ~/.gitignore_global ~/.gitignore_global.bak 69 | fi 70 | if [ -f ~/.gitignore.bak ]; then 71 | echo "move gitignores and delete bak." 72 | diff -u ~/.gitignore ~/.gitignore.bak 73 | fi 74 | 75 | #installing coreutils to get the latest gnu tools, lscolors, etc. 76 | if [ ! -d /usr/local/opt/coreutils/ ] && has_brew; then 77 | brew install coreutils 78 | fi 79 | 80 | #install tmux themes 81 | if which tmux >/dev/null; then 82 | test -d $DEVELOPMENT/tmux-colors-solarized || git clone https://github.com/seebi/tmux-colors-solarized.git $DEVELOPMENT/tmux-colors-solarized 83 | fi 84 | # install dircolors themes 85 | test -d $DEVELOPMENT/dircolors-solarized || git clone https://github.com/seebi/dircolors-solarized.git $DEVELOPMENT/dircolors-solarized 86 | test -f ~/.dir_colors_dark || ln -s $DEVELOPMENT/dircolors-solarized/dircolors.ansi-dark ~/.dir_colors_dark 87 | test -f ~/.dir_colors_light || ln -s $DEVELOPMENT/dircolors-solarized/dircolors.ansi-light ~/.dir_colors_light 88 | 89 | #Install dupes 90 | if has_brew; then 91 | test -d /usr/local/Library/Taps/homebrew-dupes || brew tap homebrew/dupes 92 | fi 93 | 94 | #brew utils 95 | install_package() { 96 | package=$1 97 | echo "checking for package $i" 98 | if has_brew; then 99 | test -d /usr/local/Cellar/$package || brew install $package 100 | fi 101 | if [ "$(head -n1 /etc/lsb-release | awk -F= '{printf("%s", $2);}')" == "Ubuntu" ]; then 102 | apt-get install $package 103 | fi 104 | if [ -f /etc/redhat-release ]; then 105 | yum install $package 106 | fi 107 | } 108 | PACKAGES=( 109 | tree 110 | tig 111 | pstree 112 | tmux 113 | wget 114 | grep 115 | pv 116 | reattach-to-user-namespace 117 | iojs 118 | bash-completion 119 | jq 120 | ) 121 | for i in ${PACKAGES[*]}; do 122 | install_package $i 123 | done; 124 | # install neovim 125 | if has_brew; then 126 | brew tap neovim/homebrew-neovim 127 | brew install --HEAD neovim 128 | fi 129 | node_packages=( 130 | jscs 131 | jshint 132 | js-yaml 133 | ) 134 | for i in ${node_packages[*]}; do 135 | npm install -g $i 136 | done; 137 | 138 | 139 | if [ ! -d $DEVELOPMENT/base-16/shell ]; then 140 | git clone https://github.com/chriskempson/base16-shell.git $DEVELOPMENT/base-16/shell 141 | fi 142 | 143 | # link in jsc 144 | if [ "$IS_MAC" == "true" ]; then 145 | if [ -x /System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources/jsc ] && ! [ -L /usr/local/bin/jsc ]; then 146 | ln -s /System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources/jsc /usr/local/bin/jsc 147 | fi 148 | 149 | # link vmware's ovftool 150 | if ! [ -L /usr/local/bin/ovftool ]; then 151 | ln -s /Applications/VMware\ Fusion.app/Contents/Library/VMware\ OVF\ Tool/ovftool /usr/local/bin 152 | fi 153 | fi 154 | 155 | -------------------------------------------------------------------------------- /colors/256colors2.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # $XTermId: 256colors2.pl,v 1.15 2012/09/19 23:32:48 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 1999-2009,2012 by Thomas E. Dickey 7 | # Copyright 2002 by Steve Wall 8 | # Copyright 1999 by Todd Larason 9 | # 10 | # All Rights Reserved 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a 13 | # copy of this software and associated documentation files (the 14 | # "Software"), to deal in the Software without restriction, including 15 | # without limitation the rights to use, copy, modify, merge, publish, 16 | # distribute, sublicense, and/or sell copies of the Software, and to 17 | # permit persons to whom the Software is furnished to do so, subject to 18 | # the following conditions: 19 | # 20 | # The above copyright notice and this permission notice shall be included 21 | # in all copies or substantial portions of the Software. 22 | # 23 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 24 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 26 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 27 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 29 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | # 31 | # Except as contained in this notice, the name(s) of the above copyright 32 | # holders shall not be used in advertising or otherwise to promote the 33 | # sale, use or other dealings in this Software without prior written 34 | # authorization. 35 | # ----------------------------------------------------------------------------- 36 | # 37 | # use the resources for colors 0-15 - usually more-or-less a 38 | # reproduction of the standard ANSI colors, but possibly more 39 | # pleasing shades 40 | 41 | use strict; 42 | 43 | use Getopt::Std; 44 | use Encode 'encode_utf8'; 45 | 46 | our ($opt_8, $opt_c, $opt_d, $opt_h, $opt_q, $opt_r, $opt_u); 47 | &getopts('8cdhqru') || die("Usage: $0 [options]"); 48 | die("Usage: $0 [options]\n 49 | Options: 50 | -8 use 8-bit controls 51 | -c use colons for separating parameter values in SGR 38/48 52 | -d use rgb values rather than palette index 53 | -h display this message 54 | -q quieter output by merging all palette initialization 55 | -r display the reverse of the usual palette 56 | -u use UTF-8 when emitting 8-bit controls 57 | ") if ( $opt_h); 58 | 59 | our $cube = 6; 60 | our (@steps); 61 | our ($red, $green, $blue); 62 | our ($gray, $level, $color); 63 | our ($csi, $osc, $sep, $st); 64 | 65 | our @rgb; 66 | 67 | sub map_cube($) { 68 | my $value = $_[0]; 69 | $value = (5 - $value) if defined($opt_r); 70 | return $value; 71 | } 72 | 73 | sub map_gray($) { 74 | my $value = $_[0]; 75 | $value = (23 - $value) if defined($opt_r); 76 | return $value; 77 | } 78 | 79 | sub define_color($$$$) { 80 | my $index = $_[0]; 81 | my $r = $_[1]; 82 | my $g = $_[2]; 83 | my $b = $_[3]; 84 | 85 | printf("%s4", $osc) unless ($opt_q); 86 | printf(";%d;rgb:%2.2x/%2.2x/%2.2x", $index, $r, $g, $b); 87 | printf("%s", $st) unless ($opt_q); 88 | 89 | $rgb[$index] = sprintf "%d%s%d%s%d", $r, $sep, $g, $sep, $b; 90 | } 91 | 92 | sub select_color($) { 93 | my $index = $_[0]; 94 | if ( $opt_d and defined($rgb[$index]) ) { 95 | printf "%s48;2%s%sm ", $csi, $sep, $rgb[$index]; 96 | } else { 97 | printf "%s48;5%s%sm ", $csi, $sep, $index; 98 | } 99 | } 100 | 101 | if ( $opt_8 ) { 102 | $csi = "\x9b"; 103 | $osc = "\x9d"; 104 | $st = "\x9c"; 105 | } else { 106 | $csi = "\x1b["; 107 | $osc = "\x1b]"; 108 | $st = "\x1b\\"; 109 | } 110 | 111 | if ( $opt_c ) { 112 | $sep = ":"; 113 | } else { 114 | $sep = ";"; 115 | } 116 | 117 | if ( $opt_8 and $opt_u ) { 118 | my $lc_ctype=`locale 2>/dev/null | fgrep LC_CTYPE | sed -e 's/^.*=//'`; 119 | if ( $lc_ctype =~ /utf.?8/i ) { 120 | binmode(STDOUT, ":utf8"); 121 | } 122 | } 123 | @steps=(0,95,135,175,215,255); 124 | # colors 16-231 are a 6x6x6 color cube 125 | printf("%s4", $osc) if ($opt_q); 126 | for ($red = 0; $red < $cube; $red++) { 127 | for ($green = 0; $green < $cube; $green++) { 128 | for ($blue = 0; $blue < $cube; $blue++) { 129 | &define_color( 130 | 16 + (map_cube($red) * $cube * $cube) + (map_cube($green) * $cube) + map_cube($blue), 131 | int (@steps[$red]), 132 | int (@steps[$green]), 133 | int (@steps[$blue])); 134 | } 135 | } 136 | } 137 | 138 | # colors 232-255 are a grayscale ramp, intentionally leaving out 139 | # black and white 140 | for ($gray = 0; $gray < 24; $gray++) { 141 | $level = (map_gray($gray) * 10) + 8; 142 | &define_color(232 + $gray, $level, $level, $level); 143 | } 144 | printf("%s", $st) if ($opt_q); 145 | 146 | 147 | # display the colors 148 | 149 | # first the system ones: 150 | print "System colors:\n"; 151 | for ($color = 0; $color < 8; $color++) { 152 | &select_color($color); 153 | } 154 | printf "%s0m\n", $csi; 155 | for ($color = 8; $color < 16; $color++) { 156 | &select_color($color); 157 | } 158 | printf "%s0m\n\n", $csi; 159 | 160 | # now the color cube 161 | print "Color cube, ${cube}x${cube}x${cube}:\n"; 162 | for ($green = 0; $green < $cube; $green++) { 163 | for ($red = 0; $red < $cube; $red++) { 164 | for ($blue = 0; $blue < $cube; $blue++) { 165 | $color = 16 + ($red * $cube * $cube) + ($green * $cube) + $blue; 166 | &select_color($color); 167 | } 168 | printf "%s0m ", $csi; 169 | } 170 | print "\n"; 171 | } 172 | 173 | 174 | # now the grayscale ramp 175 | print "Grayscale ramp:\n"; 176 | for ($color = 232; $color < 256; $color++) { 177 | &select_color($color); 178 | } 179 | printf "%s0m\n", $csi; 180 | -------------------------------------------------------------------------------- /solarized/Solarized Dark.itermcolors: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ansi 0 Color 6 | 7 | Blue Component 8 | 0.19370138645172119 9 | Green Component 10 | 0.15575926005840302 11 | Red Component 12 | 0.0 13 | 14 | Ansi 1 Color 15 | 16 | Blue Component 17 | 0.14145714044570923 18 | Green Component 19 | 0.10840655118227005 20 | Red Component 21 | 0.81926977634429932 22 | 23 | Ansi 10 Color 24 | 25 | Blue Component 26 | 0.38298487663269043 27 | Green Component 28 | 0.35665956139564514 29 | Red Component 30 | 0.27671992778778076 31 | 32 | Ansi 11 Color 33 | 34 | Blue Component 35 | 0.43850564956665039 36 | Green Component 37 | 0.40717673301696777 38 | Red Component 39 | 0.32436618208885193 40 | 41 | Ansi 12 Color 42 | 43 | Blue Component 44 | 0.51685798168182373 45 | Green Component 46 | 0.50962930917739868 47 | Red Component 48 | 0.44058024883270264 49 | 50 | Ansi 13 Color 51 | 52 | Blue Component 53 | 0.72908437252044678 54 | Green Component 55 | 0.33896297216415405 56 | Red Component 57 | 0.34798634052276611 58 | 59 | Ansi 14 Color 60 | 61 | Blue Component 62 | 0.56363654136657715 63 | Green Component 64 | 0.56485837697982788 65 | Red Component 66 | 0.50599193572998047 67 | 68 | Ansi 15 Color 69 | 70 | Blue Component 71 | 0.86405980587005615 72 | Green Component 73 | 0.95794391632080078 74 | Red Component 75 | 0.98943418264389038 76 | 77 | Ansi 2 Color 78 | 79 | Blue Component 80 | 0.020208755508065224 81 | Green Component 82 | 0.54115492105484009 83 | Red Component 84 | 0.44977453351020813 85 | 86 | Ansi 3 Color 87 | 88 | Blue Component 89 | 0.023484811186790466 90 | Green Component 91 | 0.46751424670219421 92 | Red Component 93 | 0.64746475219726562 94 | 95 | Ansi 4 Color 96 | 97 | Blue Component 98 | 0.78231418132781982 99 | Green Component 100 | 0.46265947818756104 101 | Red Component 102 | 0.12754884362220764 103 | 104 | Ansi 5 Color 105 | 106 | Blue Component 107 | 0.43516635894775391 108 | Green Component 109 | 0.10802463442087173 110 | Red Component 111 | 0.77738940715789795 112 | 113 | Ansi 6 Color 114 | 115 | Blue Component 116 | 0.52502274513244629 117 | Green Component 118 | 0.57082360982894897 119 | Red Component 120 | 0.14679534733295441 121 | 122 | Ansi 7 Color 123 | 124 | Blue Component 125 | 0.79781103134155273 126 | Green Component 127 | 0.89001238346099854 128 | Red Component 129 | 0.91611063480377197 130 | 131 | Ansi 8 Color 132 | 133 | Blue Component 134 | 0.15170273184776306 135 | Green Component 136 | 0.11783610284328461 137 | Red Component 138 | 0.0 139 | 140 | Ansi 9 Color 141 | 142 | Blue Component 143 | 0.073530435562133789 144 | Green Component 145 | 0.21325300633907318 146 | Red Component 147 | 0.74176257848739624 148 | 149 | Background Color 150 | 151 | Blue Component 152 | 0.15170273184776306 153 | Green Component 154 | 0.11783610284328461 155 | Red Component 156 | 0.0 157 | 158 | Bold Color 159 | 160 | Blue Component 161 | 0.56363654136657715 162 | Green Component 163 | 0.56485837697982788 164 | Red Component 165 | 0.50599193572998047 166 | 167 | Cursor Color 168 | 169 | Blue Component 170 | 0.51685798168182373 171 | Green Component 172 | 0.50962930917739868 173 | Red Component 174 | 0.44058024883270264 175 | 176 | Cursor Text Color 177 | 178 | Blue Component 179 | 0.19370138645172119 180 | Green Component 181 | 0.15575926005840302 182 | Red Component 183 | 0.0 184 | 185 | Foreground Color 186 | 187 | Blue Component 188 | 0.51685798168182373 189 | Green Component 190 | 0.50962930917739868 191 | Red Component 192 | 0.44058024883270264 193 | 194 | Selected Text Color 195 | 196 | Blue Component 197 | 0.56363654136657715 198 | Green Component 199 | 0.56485837697982788 200 | Red Component 201 | 0.50599193572998047 202 | 203 | Selection Color 204 | 205 | Blue Component 206 | 0.19370138645172119 207 | Green Component 208 | 0.15575926005840302 209 | Red Component 210 | 0.0 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /solarized/Solarized Light.itermcolors: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ansi 0 Color 6 | 7 | Blue Component 8 | 0.19370138645172119 9 | Green Component 10 | 0.15575926005840302 11 | Red Component 12 | 0.0 13 | 14 | Ansi 1 Color 15 | 16 | Blue Component 17 | 0.14145712554454803 18 | Green Component 19 | 0.10840645432472229 20 | Red Component 21 | 0.81926983594894409 22 | 23 | Ansi 10 Color 24 | 25 | Blue Component 26 | 0.38298487663269043 27 | Green Component 28 | 0.35665956139564514 29 | Red Component 30 | 0.27671992778778076 31 | 32 | Ansi 11 Color 33 | 34 | Blue Component 35 | 0.43850564956665039 36 | Green Component 37 | 0.40717673301696777 38 | Red Component 39 | 0.32436618208885193 40 | 41 | Ansi 12 Color 42 | 43 | Blue Component 44 | 0.51685798168182373 45 | Green Component 46 | 0.50962930917739868 47 | Red Component 48 | 0.44058024883270264 49 | 50 | Ansi 13 Color 51 | 52 | Blue Component 53 | 0.72908437252044678 54 | Green Component 55 | 0.33896297216415405 56 | Red Component 57 | 0.34798634052276611 58 | 59 | Ansi 14 Color 60 | 61 | Blue Component 62 | 0.56363654136657715 63 | Green Component 64 | 0.56485837697982788 65 | Red Component 66 | 0.50599193572998047 67 | 68 | Ansi 15 Color 69 | 70 | Blue Component 71 | 0.86405980587005615 72 | Green Component 73 | 0.95794391632080078 74 | Red Component 75 | 0.98943418264389038 76 | 77 | Ansi 2 Color 78 | 79 | Blue Component 80 | 0.020208755508065224 81 | Green Component 82 | 0.54115492105484009 83 | Red Component 84 | 0.44977453351020813 85 | 86 | Ansi 3 Color 87 | 88 | Blue Component 89 | 0.023484811186790466 90 | Green Component 91 | 0.46751424670219421 92 | Red Component 93 | 0.64746475219726562 94 | 95 | Ansi 4 Color 96 | 97 | Blue Component 98 | 0.78231418132781982 99 | Green Component 100 | 0.46265947818756104 101 | Red Component 102 | 0.12754884362220764 103 | 104 | Ansi 5 Color 105 | 106 | Blue Component 107 | 0.43516635894775391 108 | Green Component 109 | 0.10802463442087173 110 | Red Component 111 | 0.77738940715789795 112 | 113 | Ansi 6 Color 114 | 115 | Blue Component 116 | 0.52502274513244629 117 | Green Component 118 | 0.57082360982894897 119 | Red Component 120 | 0.14679534733295441 121 | 122 | Ansi 7 Color 123 | 124 | Blue Component 125 | 0.79781103134155273 126 | Green Component 127 | 0.89001238346099854 128 | Red Component 129 | 0.91611063480377197 130 | 131 | Ansi 8 Color 132 | 133 | Blue Component 134 | 0.15170273184776306 135 | Green Component 136 | 0.11783610284328461 137 | Red Component 138 | 0.0 139 | 140 | Ansi 9 Color 141 | 142 | Blue Component 143 | 0.073530435562133789 144 | Green Component 145 | 0.21325300633907318 146 | Red Component 147 | 0.74176257848739624 148 | 149 | Background Color 150 | 151 | Blue Component 152 | 0.86405980587005615 153 | Green Component 154 | 0.95794391632080078 155 | Red Component 156 | 0.98943418264389038 157 | 158 | Bold Color 159 | 160 | Blue Component 161 | 0.38298487663269043 162 | Green Component 163 | 0.35665956139564514 164 | Red Component 165 | 0.27671992778778076 166 | 167 | Cursor Color 168 | 169 | Blue Component 170 | 0.43850564956665039 171 | Green Component 172 | 0.40717673301696777 173 | Red Component 174 | 0.32436618208885193 175 | 176 | Cursor Text Color 177 | 178 | Blue Component 179 | 0.79781103134155273 180 | Green Component 181 | 0.89001238346099854 182 | Red Component 183 | 0.91611063480377197 184 | 185 | Foreground Color 186 | 187 | Blue Component 188 | 0.43850564956665039 189 | Green Component 190 | 0.40717673301696777 191 | Red Component 192 | 0.32436618208885193 193 | 194 | Selected Text Color 195 | 196 | Blue Component 197 | 0.38298487663269043 198 | Green Component 199 | 0.35665956139564514 200 | Red Component 201 | 0.27671992778778076 202 | 203 | Selection Color 204 | 205 | Blue Component 206 | 0.79781103134155273 207 | Green Component 208 | 0.89001238346099854 209 | Red Component 210 | 0.91611063480377197 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /aws_scripts.sh: -------------------------------------------------------------------------------- 1 | aws_show_cloudfronts () 2 | { 3 | aws cloudfront list-distributions | jq -r '.DistributionList|.Items[]| "\(.Id) \(.DomainName) \(.Origins.Items[0].DomainName) \(.Status)"' 4 | } 5 | aws_show_load_balanacers() 6 | { 7 | aws elb describe-load-balancers | jq '.LoadBalancerDescriptions[]| "\(.DNSName) \(.Instances[]|join(","))"' 8 | } 9 | 10 | aws_show_pending_cloudfronts () 11 | { 12 | aws cloudfront list-distributions | jq -r '.DistributionList|.Items[]|select(.Status=="InProgress")|{Status, Aliases: .Aliases.Items}' 13 | } 14 | 15 | aws_update_ssh_hosts() 16 | { 17 | aws ec2 describe-instances | jq -r '.Reservations[].Instances[]|select(.State.Name == "running")|"\(.PublicDnsName) \(.KeyName) \((((.Tags//[])[]|select(.Key == "Name"))//{}).Value) \(.InstanceId)"' | while read hostname keyfile name instanceid; do 18 | if [ "$name" == "null" ]; then 19 | >&2 echo "$instanceid does not have a tag!!" 20 | continue 21 | fi 22 | name=${name//\//_} 23 | cat < ~/.ssh/config.d/aws 31 | 32 | cat ~/.ssh/config.d/* >~/.ssh/config; 33 | } 34 | 35 | aws_update_ssh_from_home() 36 | { 37 | local sec_group=${1:-ssh_only_from_home} 38 | local newip=$(whatismyip) 39 | local oldip=$(aws ec2 describe-security-groups --group-names $sec_group --filters Name=ip-permission.from-port,Values=22 --query 'SecurityGroups[].IpPermissions[].IpRanges[].CidrIp' | jq -r '.[]' | grep -oE '([0-9]+\.?){4}' |xargs echo -n) 40 | if [ -n "$newip" ] && [ "$newip" != "$oldip" ]; then 41 | echo "Setting $sec_group to '$newip' old ip was '$oldip'" 42 | if [ -n "$oldip" ]; then 43 | aws ec2 revoke-security-group-ingress --group-name ${sec_group} --protocol tcp --port 22 44 | fi 45 | aws ec2 authorize-security-group-ingress --group-name ${sec_group} --protocol tcp --port 22 --cidr ${newip}/32 46 | else 47 | echo "Security group already set to $newip" 48 | fi 49 | } 50 | 51 | aws_get_running_instances() 52 | { 53 | aws ec2 describe-instances | jq '.Reservations[].Instances[]|{State: .State.Name,instance: .InstanceId, Name: (((.Tags//[])[]|select(.Key == "Name"))//{}).Value} | select(.State=="running")' 54 | } 55 | aws_show_instance() 56 | { 57 | instance_id=$1 58 | if [ -z $instance_id ]; then 59 | echo "Must provide an instance id" 60 | return 61 | fi 62 | aws ec2 describe-instances --instance-ids $instance_id | jq '.Reservations[].Instances[]' 63 | } 64 | aws_show_instances() 65 | { 66 | aws ec2 describe-instances | jq '.Reservations[]|.Instances[]|{PublicDnsName,KeyName,InstanceId,Name: (((.Tags//[])[]|select(.Key == "Name"))//{}).Value}' 67 | } 68 | aws_show_instance_security_groups() 69 | { 70 | instance_id=$1 71 | if [ -z $instance_id ]; then 72 | echo "Must provide an instance id" 73 | return 74 | fi 75 | aws ec2 describe-instances --instance-ids $instance_id | jq '[.Reservations[].Instances[].SecurityGroups[]]' 76 | } 77 | aws_show_pending_spot_instances() 78 | { 79 | aws ec2 describe-spot-instance-requests | jq '.SpotInstanceRequests[]|select(.Status.Code != "fulfilled")|{Status: .Status.Message, SpotInstanceRequestId }' 80 | } 81 | aws_show_spot_instance_requests() 82 | { 83 | aws ec2 describe-spot-instance-requests | jq '.SpotInstanceRequests[]|{Status: .Status.Message, SpotInstanceRequestId }' 84 | } 85 | aws_copy_security_groups_to_instance() 86 | { 87 | local instance_id=$1 88 | local to_instance=$2 89 | if [ -z $instance_id ]; then 90 | echo "Must provide an instance id" 91 | return 92 | fi 93 | if [ -z $to_instance ]; then 94 | echo "Must provide an instance id to copy to" 95 | return 96 | fi 97 | local groups=$(aws ec2 describe-instances --instance-ids $instance_id | jq '{ Groups: [.Reservations[].Instances[].SecurityGroups[].GroupId] }') 98 | aws ec2 modify-instance-attribute --instance-id $to_instance --cli-input-json "$groups" 99 | } 100 | 101 | aws_attach_security_group() 102 | { 103 | local instance_id=$1 104 | local security_group_desc=$2 105 | if [ -z $instance_id ]; then 106 | echo "Must provide an instance id" 107 | return 108 | fi 109 | if ! [ -f $security_group_desc ]; then 110 | echo "Must provide a security group file" 111 | return 112 | fi 113 | aws ec2 modify-instance-attribute --instance-id $instance_id --cli-input-json "$(cat $security_group_desc)" 114 | } 115 | 116 | aws_set_instance_name() 117 | { 118 | local instance_id=$1 119 | if [ -z $instance_id ]; then 120 | echo "Must provide an instance id" 121 | return 122 | fi 123 | local name=$2 124 | aws ec2 create-tags --resources $instance_id --tags "Key=Name,Value=$name" 125 | } 126 | aws_show_security_group() 127 | { 128 | local security_group_name=$1 129 | if [ -z $security_group_name ]; then 130 | aws ec2 describe-security-groups | jq '.SecurityGroups[]|{GroupName,IpPermissions,IpPermissionsEgress}' 131 | return 132 | fi 133 | aws ec2 describe-security-groups | jq ".SecurityGroups[]|{GroupName,IpPermissions,IpPermissionsEgress}|select(.GroupName == \"$security_group_name\")" 134 | } 135 | 136 | aws_show_security_groups() 137 | { 138 | aws ec2 describe-security-groups | jq '.SecurityGroups[]|"\(.GroupId) \(.GroupName) \(.Description)"' 139 | } 140 | 141 | aws_show_vpcs() 142 | { 143 | aws ec2 describe-vpcs 144 | } 145 | 146 | aws_terminate_instances() 147 | { 148 | aws ec2 terminate-instances --instance-ids "$@" 149 | } 150 | 151 | aws_show_policies() 152 | { 153 | aws iam list-policies | jq '.Policies[]|(.Arn|select(startswith("arn:aws:iam::")))' 154 | } 155 | 156 | aws_set_profile() 157 | { 158 | local profile_id=$1 159 | if [ -z $profile_id ] && [ -f ~/.aws_current_profile ]; then 160 | profile_id=$(cat ~/.aws_current_profile) 161 | fi 162 | if [ -z $profile_id ]; then 163 | echo "Must provide on of the following profile ids: " 164 | cat ~/.aws/credentials | awk '/^\[/ { gsub(/\[|\]/, "", $1); print $1 }' 165 | return 166 | fi 167 | local profile=$(grep -E "\[.*$profile_id.*\]" ~/.aws/credentials | sed -e 's/\[//' -e 's/\]//' -e '/^$/d') 168 | if [ -n "$profile" ] && [ $(echo -n "$profile" | wc -l) -ne 0 ]; then 169 | echo "Could not validate profile id, found '$profile'" 170 | return 171 | else 172 | echo $profile > ~/.aws_current_profile 173 | fi 174 | [[ -n $PS1 ]] && echo export AWS_DEFAULT_PROFILE=$profile 175 | export AWS_DEFAULT_PROFILE=$profile 176 | export AWS_EB_PROFILE=$profile 177 | keys=$(grep -A2 $profile ~/.aws/credentials | tail -n2 | awk '{ printf("export %s=%s\n", toupper($1), $3) }') 178 | #echo "$keys" 179 | eval "$keys" 180 | } 181 | -------------------------------------------------------------------------------- /irssi/trackbar.pl: -------------------------------------------------------------------------------- 1 | # trackbar.pl 2 | # 3 | # This little script will do just one thing: it will draw a line each time you 4 | # switch away from a window. This way, you always know just upto where you've 5 | # been reading that window :) It also removes the previous drawn line, so you 6 | # don't see double lines. 7 | # 8 | # Usage: 9 | # 10 | # The script works right out of the box, but if you want you can change 11 | # the working by /set'ing the following variables: 12 | # 13 | # trackbar_string The characters to repeat to draw the bar 14 | # trackbar_style The style for the bar, %r is red for example 15 | # See formats.txt that came with irssi 16 | # 17 | # /mark is a command that will redraw the line at the bottom. However! This 18 | # requires irssi version after 20021228. otherwise you'll get the error 19 | # redraw: unknown command, and your screen is all goofed up :) 20 | # 21 | # /upgrade & buf.pl notice: This version tries to remove the trackbars before 22 | # the upgrade is done, so buf.pl does not restore them, as they are not removeable 23 | # afterwards by trackbar. Unfortiounatly, to make this work, trackbar and buf.pl 24 | # need to be loaded in a specific order. Please experiment to see which order works 25 | # for you (strangely, it differs from configuration to configuration, something I will 26 | # try to fix in a next version) 27 | # 28 | # Authors: 29 | # - Main maintainer & author: Peter 'kinlo' Leurs 30 | # - Many thanks to Timo 'cras' Sirainen for placing me on my way 31 | # - on-upgrade-remove-line patch by Uwe Dudenhoeffer 32 | # 33 | # Version history: 34 | # 1.4: - Changed our's by my's so the irssi script header is valid 35 | # - Removed utf-8 support. In theory, the script should work w/o any 36 | # problems for utf-8, just set trackbar_string to a valid utf-8 character 37 | # and everything *should* work. However, this script is being plagued by 38 | # irssi internal bugs. The function Irssi::settings_get_str does NOT handle 39 | # unicode strings properly, hence you will notice problems when setting the bar 40 | # to a unicode char. For changing your bar to utf-8 symbols, read the line sub. 41 | # 1.3: - Upgrade now removes the trackbars. 42 | # - Some code cleanups, other defaults 43 | # - /mark sets the line to the bottom 44 | # 1.2: - Support for utf-8 45 | # - How the bar looks can now be configured with trackbar_string 46 | # and trackbar_style 47 | # 1.1: - Fixed bug when closing window 48 | # 1.0: - Initial release 49 | # 50 | # 51 | # Call for help! 52 | # 53 | # There is a trackbar version 2.0 that properly handles resizes and immediate config change 54 | # activation. However, there is/are some bug(s) in irssi's main buffer/window code that causes 55 | # irssi to 'forget' lines, which is ofcourse completly unaccepteable. I haven't found the time 56 | # nor do I know the irssi's internals enough to find and fix this bug, if you want to help, please 57 | # contact me, I'll give you a copy of the 2.0 version that will immediatly show you the problems. 58 | # 59 | # Known bugs: 60 | # - if you /clear a window, it will be uncleared when returning to the window 61 | # - UTF-8 characters in the trackbar_string doesnt work. This is an irssi bug. 62 | # - if you resize your irssi (in xterm or so) the bar is not resized 63 | # - changing the trackbar style is only visible after returning to a window 64 | # however, changing style/resize takes in effect after you left the window. 65 | # 66 | # Whishlist/todo: 67 | # - instead of drawing a line, just invert timestamp or something, 68 | # to save a line (but I don't think this is possible with current irssi) 69 | # - some pageup keybinding possibility, to scroll up upto the trackbar 70 | # - <@coekie> kinlo: if i switch to another window, in another split window, i 71 | # want the trackbar to go down in the previouswindow in that splitwindow :) 72 | # - < bob_2> anyway to clear the line once the window is read? 73 | # - < elho> kinlo: wishlist item: a string that gets prepended to the repeating pattern 74 | # - < elho> an option to still have the timestamp in front of the bar 75 | # - < elho> oh and an option to not draw it in the status window :P 76 | # 77 | # BTW: when you have feature requests, mailing a patch that works is the fastest way 78 | # to get it added :p 79 | 80 | use strict; 81 | use 5.6.1; 82 | use Irssi; 83 | use Irssi::TextUI; 84 | 85 | my $VERSION = "1.4"; 86 | 87 | my %IRSSI = ( 88 | authors => "Peter 'kinlo' Leurs", 89 | contact => "peter\@pfoe.be", 90 | name => "trackbar", 91 | description => "Shows a bar where you've last read a window", 92 | license => "GPLv2", 93 | url => "http://www.pfoe.be/~peter/trackbar/", 94 | changed => "Thu Feb 20 16:18:08 2003", 95 | ); 96 | 97 | my %config; 98 | 99 | Irssi::settings_add_str('trackbar', 'trackbar_string' => '-'); 100 | $config{'trackbar_string'} = Irssi::settings_get_str('trackbar_string'); 101 | 102 | Irssi::settings_add_str('trackbar', 'trackbar_style' => '%K'); 103 | $config{'trackbar_style'} = Irssi::settings_get_str('trackbar_style'); 104 | 105 | Irssi::signal_add( 106 | 'setup changed' => sub { 107 | $config{'trackbar_string'} = Irssi::settings_get_str('trackbar_string'); 108 | $config{'trackbar_style'} = Irssi::settings_get_str('trackbar_style'); 109 | if ($config{'trackbar_style'} =~ /(? sub { 120 | my (undef, $oldwindow) = @_; 121 | 122 | if ($oldwindow) { 123 | my $line = $oldwindow->view()->get_bookmark('trackbar'); 124 | $oldwindow->view()->remove_line($line) if defined $line; 125 | $oldwindow->print(line($oldwindow->{'width'}), MSGLEVEL_NEVER); 126 | $oldwindow->view()->set_bookmark_bottom('trackbar'); 127 | } 128 | } 129 | ); 130 | 131 | sub line { 132 | my $width = shift; 133 | my $string = $config{'trackbar_string'}; 134 | $string = '-' unless defined $string; 135 | 136 | # There is a bug in irssi's utf-8 handling on config file settings, as you 137 | # can reproduce/see yourself by the following code sniplet: 138 | # 139 | # my $quake = pack 'U*', 8364; # EUR symbol 140 | # Irssi::settings_add_str 'temp', 'temp_foo' => $quake; 141 | # Irssi::print length $quake; 142 | # # prints 1 143 | # Irssi::print length Irssi::settings_get_str 'temp_foo'; 144 | # # prints 3 145 | # 146 | # 147 | # Trackbar used to have a workaround, but on recent versions of perl/irssi 148 | # it does no longer work. Therefore, if you want your trackbar to contain 149 | # unicode characters, uncomment the line below for a nice full line, or set 150 | # the string to whatever char you want. 151 | 152 | # $string = pack('U*', 0x2500); 153 | 154 | 155 | my $length = length $string; 156 | 157 | if ($length == 0) { 158 | $string = '-'; 159 | $length = 1; 160 | } 161 | 162 | my $times = $width / $length; 163 | $times = int(1 + $times) if $times != int($times); 164 | $string =~ s/%/%%/g; 165 | return $config{'trackbar_style'} . substr($string x $times, 0, $width); 166 | } 167 | 168 | # Remove trackbars on upgrade - but this doesn't really work if the scripts are not loaded in the correct order... watch out! 169 | 170 | Irssi::signal_add_first( 'session save' => sub { 171 | for my $window (Irssi::windows) { 172 | next unless defined $window; 173 | my $line = $window->view()->get_bookmark('trackbar'); 174 | $window->view()->remove_line($line) if defined $line; 175 | } 176 | } 177 | ); 178 | 179 | sub cmd_mark { 180 | my $window = Irssi::active_win(); 181 | # return unless defined $window; 182 | my $line = $window->view()->get_bookmark('trackbar'); 183 | $window->view()->remove_line($line) if defined $line; 184 | $window->print(line($window->{'width'}), MSGLEVEL_NEVER); 185 | $window->view()->set_bookmark_bottom('trackbar'); 186 | Irssi::command("redraw"); 187 | } 188 | 189 | Irssi::command_bind('mark', 'cmd_mark'); 190 | -------------------------------------------------------------------------------- /irssirc: -------------------------------------------------------------------------------- 1 | servers = ( 2 | { address = "eu.irc6.net"; chatnet = "IRCnet"; port = "6667"; }, 3 | { address = "open.ircnet.net"; chatnet = "IRCnet"; port = "6667"; }, 4 | { address = "irc.efnet.org"; chatnet = "EFNet"; port = "6667"; }, 5 | { 6 | address = "irc.undernet.org"; 7 | chatnet = "Undernet"; 8 | port = "6667"; 9 | }, 10 | { address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; }, 11 | { 12 | address = "irc.quakenet.org"; 13 | chatnet = "QuakeNet"; 14 | port = "6667"; 15 | }, 16 | { address = "irc.oftc.net"; chatnet = "OFTC"; port = "6667"; }, 17 | { 18 | address = "irc.gamesurge.net"; 19 | chatnet = "GameSurge"; 20 | port = "6667"; 21 | }, 22 | { address = "irc.webchat.org"; chatnet = "WebChat"; port = "6667"; }, 23 | { address = "irc.rizon.net"; chatnet = "Rizon"; port = "6667"; }, 24 | { address = "irc.link-net.org"; chatnet = "LinkNet"; port = "6667"; }, 25 | { address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; }, 26 | { 27 | address = "irc.freenode.net"; 28 | chatnet = "freenode"; 29 | port = "6667"; 30 | use_ssl = "no"; 31 | ssl_verify = "no"; 32 | }, 33 | { 34 | address = "irc.us.hackint.org"; 35 | chatnet = "DN42"; 36 | port = "6667"; 37 | use_tls = "no"; 38 | tls_verify = "no"; 39 | } 40 | ); 41 | 42 | chatnets = { 43 | IRCnet = { 44 | type = "IRC"; 45 | max_kicks = "4"; 46 | max_msgs = "5"; 47 | max_whois = "4"; 48 | max_query_chans = "5"; 49 | }; 50 | EFNet = { 51 | type = "IRC"; 52 | max_kicks = "4"; 53 | max_msgs = "3"; 54 | max_whois = "1"; 55 | }; 56 | Undernet = { 57 | type = "IRC"; 58 | max_kicks = "1"; 59 | max_msgs = "3"; 60 | max_whois = "30"; 61 | }; 62 | DALnet = { 63 | type = "IRC"; 64 | max_kicks = "4"; 65 | max_msgs = "3"; 66 | max_whois = "30"; 67 | }; 68 | QuakeNet = { 69 | type = "IRC"; 70 | max_kicks = "1"; 71 | max_msgs = "3"; 72 | max_whois = "30"; 73 | }; 74 | OFTC = { 75 | type = "IRC"; 76 | max_kicks = "1"; 77 | max_msgs = "3"; 78 | max_whois = "30"; 79 | }; 80 | GameSurge = { 81 | type = "IRC"; 82 | max_kicks = "1"; 83 | max_msgs = "3"; 84 | max_whois = "30"; 85 | }; 86 | WebChat = { 87 | type = "IRC"; 88 | max_kicks = "1"; 89 | max_msgs = "3"; 90 | max_whois = "30"; 91 | }; 92 | Rizon = { 93 | type = "IRC"; 94 | max_kicks = "1"; 95 | max_msgs = "3"; 96 | max_whois = "30"; 97 | }; 98 | LinkNet = { 99 | type = "IRC"; 100 | max_kicks = "1"; 101 | max_msgs = "3"; 102 | max_whois = "30"; 103 | }; 104 | SILC = { type = "SILC"; }; 105 | freenode = { 106 | type = "IRC"; 107 | sasl_mechanism = "PLAIN"; 108 | sasl_username = "jmo"; 109 | sasl_password = "ZXDmP4dWBrY6gH"; 110 | }; 111 | help = { type = "IRC"; }; 112 | DN42 = { 113 | type = "IRC"; 114 | sasl_mechanism = "plain"; 115 | sasl_username = "jmo"; 116 | sasl_password = "noodle-impute-forehead"; 117 | }; 118 | }; 119 | 120 | channels = ( 121 | { name = "#irssi"; chatnet = "ircnet"; autojoin = "No"; }, 122 | { name = "silc"; chatnet = "silc"; autojoin = "No"; } 123 | ); 124 | 125 | aliases = { 126 | J = "join"; 127 | WJOIN = "join -window"; 128 | WQUERY = "query -window"; 129 | LEAVE = "part"; 130 | BYE = "quit"; 131 | EXIT = "quit"; 132 | SIGNOFF = "quit"; 133 | DESCRIBE = "action"; 134 | DATE = "time"; 135 | HOST = "userhost"; 136 | LAST = "lastlog"; 137 | SAY = "msg *"; 138 | WI = "whois"; 139 | WII = "whois $0 $0"; 140 | WW = "whowas"; 141 | W = "who"; 142 | N = "names"; 143 | M = "msg"; 144 | T = "topic"; 145 | C = "clear"; 146 | CL = "clear"; 147 | K = "kick"; 148 | KB = "kickban"; 149 | KN = "knockout"; 150 | BANS = "ban"; 151 | B = "ban"; 152 | MUB = "unban *"; 153 | UB = "unban"; 154 | IG = "ignore"; 155 | UNIG = "unignore"; 156 | SB = "scrollback"; 157 | UMODE = "mode $N"; 158 | WC = "window close"; 159 | WN = "window new hide"; 160 | SV = "say Irssi $J ($V) - http://irssi.org/"; 161 | GOTO = "sb goto"; 162 | CHAT = "dcc chat"; 163 | RUN = "SCRIPT LOAD"; 164 | CALC = "exec - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi"; 165 | SBAR = "STATUSBAR"; 166 | INVITELIST = "mode $C +I"; 167 | Q = "QUERY"; 168 | "MANUAL-WINDOWS" = "set use_status_window off;set autocreate_windows off;set autocreate_query_level none;set autoclose_windows off;set reuse_unused_windows on;save"; 169 | EXEMPTLIST = "mode $C +e"; 170 | ATAG = "WINDOW SERVER"; 171 | UNSET = "set -clear"; 172 | RESET = "set -default"; 173 | }; 174 | 175 | statusbar = { 176 | # formats: 177 | # when using {templates}, the template is shown only if it's argument isn't 178 | # empty unless no argument is given. for example {sb} is printed always, 179 | # but {sb $T} is printed only if $T isn't empty. 180 | 181 | items = { 182 | # start/end text in statusbars 183 | barstart = "{sbstart}"; 184 | barend = "{sbend}"; 185 | 186 | topicbarstart = "{topicsbstart}"; 187 | topicbarend = "{topicsbend}"; 188 | 189 | # treated "normally", you could change the time/user name to whatever 190 | time = "{sb $Z}"; 191 | user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}"; 192 | 193 | # treated specially .. window is printed with non-empty windows, 194 | # window_empty is printed with empty windows 195 | window = "{sb $winref:$tag/$itemname{sbmode $M}}"; 196 | window_empty = "{sb $winref{sbservertag $tag}}"; 197 | prompt = "{prompt $[.15]itemname}"; 198 | prompt_empty = "{prompt $winname}"; 199 | topic = " $topic"; 200 | topic_empty = " Irssi v$J - http://www.irssi.org"; 201 | 202 | # all of these treated specially, they're only displayed when needed 203 | lag = "{sb Lag: %m$0-%n}"; 204 | act = "{sb Act: $0-}"; 205 | more = "%k%3-- more --%n"; 206 | }; 207 | 208 | # there's two type of statusbars. root statusbars are either at the top 209 | # of the screen or at the bottom of the screen. window statusbars are at 210 | # the top/bottom of each split window in screen. 211 | default = { 212 | # the "default statusbar" to be displayed at the bottom of the window. 213 | # contains all the normal items. 214 | window = { 215 | disabled = "no"; 216 | 217 | # window, root 218 | type = "window"; 219 | # top, bottom 220 | placement = "bottom"; 221 | # number 222 | position = "1"; 223 | # active, inactive, always 224 | visible = "active"; 225 | 226 | # list of items in statusbar in the display order 227 | items = { 228 | barstart = { priority = "100"; }; 229 | time = { }; 230 | user = { }; 231 | window = { }; 232 | window_empty = { }; 233 | lag = { priority = "-1"; }; 234 | act = { priority = "10"; }; 235 | more = { priority = "-1"; alignment = "right"; }; 236 | barend = { priority = "100"; alignment = "right"; }; 237 | }; 238 | }; 239 | 240 | # statusbar to use in inactive split windows 241 | window_inact = { 242 | type = "window"; 243 | placement = "bottom"; 244 | position = "1"; 245 | visible = "inactive"; 246 | items = { 247 | barstart = { priority = "100"; }; 248 | window = { }; 249 | window_empty = { }; 250 | more = { priority = "-1"; alignment = "right"; }; 251 | barend = { priority = "100"; alignment = "right"; }; 252 | }; 253 | }; 254 | 255 | # we treat input line as yet another statusbar :) It's possible to 256 | # add other items before or after the input line item. 257 | prompt = { 258 | type = "root"; 259 | placement = "bottom"; 260 | # we want to be at the bottom always 261 | position = "100"; 262 | visible = "always"; 263 | items = { 264 | prompt = { priority = "-1"; }; 265 | prompt_empty = { priority = "-1"; }; 266 | # treated specially, this is the real input line. 267 | input = { priority = "10"; }; 268 | }; 269 | }; 270 | 271 | # topicbar 272 | topic = { 273 | type = "root"; 274 | placement = "top"; 275 | position = "1"; 276 | visible = "always"; 277 | items = { 278 | topicbarstart = { priority = "100"; }; 279 | topic = { }; 280 | topic_empty = { }; 281 | topicbarend = { priority = "100"; alignment = "right"; }; 282 | }; 283 | }; 284 | awl_0 = { 285 | items = { 286 | barstart = { priority = "100"; }; 287 | awl_0 = { }; 288 | barend = { priority = "100"; alignment = "right"; }; 289 | }; 290 | }; 291 | }; 292 | }; 293 | settings = { 294 | core = { real_name = "JMo"; user_name = "jmo"; nick = "jmo"; }; 295 | "fe-text" = { actlist_sort = "refnum"; }; 296 | "fe-common/core" = { 297 | # Solarized 298 | theme = "irssi-colors-solarized/solarized-universal"; 299 | hilight_color = "= %R"; 300 | }; 301 | }; 302 | windows = { 303 | 1 = { immortal = "yes"; name = "(status)"; level = "ALL"; }; 304 | 2 = { name = "hilight"; sticky = "yes"; }; 305 | }; 306 | mainwindows = { 307 | 1 = { first_line = "8"; lines = "27"; }; 308 | 2 = { first_line = "1"; lines = "7"; }; 309 | }; 310 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | call plug#begin() 2 | 3 | " List your plugins here 4 | Plug 'tpope/vim-sensible' 5 | Plug 'neoclide/coc.nvim', {'branch': 'release'} 6 | Plug 'vim-airline/vim-airline' 7 | Plug 'vim-airline/vim-airline-themes' 8 | Plug 'chriskempson/base16-vim' 9 | Plug 'altercation/vim-colors-solarized' 10 | Plug 'preservim/nerdtree' 11 | 12 | call plug#end() 13 | 14 | " https://raw.githubusercontent.com/neoclide/coc.nvim/master/doc/coc-example-config.vim 15 | 16 | " May need for Vim (not Neovim) since coc.nvim calculates byte offset by count 17 | " utf-8 byte sequence 18 | set encoding=utf-8 19 | " Some servers have issues with backup files, see #649 20 | set nobackup 21 | set nowritebackup 22 | 23 | " Having longer updatetime (default is 4000 ms = 4s) leads to noticeable 24 | " delays and poor user experience 25 | set updatetime=300 26 | 27 | " Always show the signcolumn, otherwise it would shift the text each time 28 | " diagnostics appear/become resolved 29 | set signcolumn=yes 30 | 31 | " Use tab for trigger completion with characters ahead and navigate 32 | " NOTE: There's always complete item selected by default, you may want to enable 33 | " no select by `"suggest.noselect": true` in your configuration file 34 | " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by 35 | " other plugin before putting this into your config 36 | inoremap 37 | \ coc#pum#visible() ? coc#pum#next(1) : 38 | \ CheckBackspace() ? "\" : 39 | \ coc#refresh() 40 | inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" 41 | 42 | " Make to accept selected completion item or notify coc.nvim to format 43 | " u breaks current undo, please make your own choice 44 | inoremap coc#pum#visible() ? coc#pum#confirm() 45 | \: "\u\\=coc#on_enter()\" 46 | 47 | function! CheckBackspace() abort 48 | let col = col('.') - 1 49 | return !col || getline('.')[col - 1] =~# '\s' 50 | endfunction 51 | 52 | " Use to trigger completion 53 | if has('nvim') 54 | inoremap coc#refresh() 55 | else 56 | inoremap coc#refresh() 57 | endif 58 | 59 | " Use `[g` and `]g` to navigate diagnostics 60 | " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list 61 | nmap [g (coc-diagnostic-prev) 62 | nmap ]g (coc-diagnostic-next) 63 | 64 | " GoTo code navigation 65 | nmap gd (coc-definition) 66 | nmap gy (coc-type-definition) 67 | nmap gi (coc-implementation) 68 | nmap gr (coc-references) 69 | 70 | " Use K to show documentation in preview window 71 | nnoremap K :call ShowDocumentation() 72 | 73 | function! ShowDocumentation() 74 | if CocAction('hasProvider', 'hover') 75 | call CocActionAsync('doHover') 76 | else 77 | call feedkeys('K', 'in') 78 | endif 79 | endfunction 80 | 81 | " Highlight the symbol and its references when holding the cursor 82 | autocmd CursorHold * silent call CocActionAsync('highlight') 83 | 84 | " Symbol renaming 85 | nmap rn (coc-rename) 86 | 87 | " Formatting selected code 88 | xmap f (coc-format-selected) 89 | nmap f (coc-format-selected) 90 | 91 | augroup mygroup 92 | autocmd! 93 | " Setup formatexpr specified filetype(s) 94 | autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') 95 | " Update signature help on jump placeholder 96 | autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') 97 | augroup end 98 | 99 | " Applying code actions to the selected code block 100 | " Example: `aap` for current paragraph 101 | xmap a (coc-codeaction-selected) 102 | nmap a (coc-codeaction-selected) 103 | 104 | " Remap keys for applying code actions at the cursor position 105 | nmap ac (coc-codeaction-cursor) 106 | " Remap keys for apply code actions affect whole buffer 107 | nmap as (coc-codeaction-source) 108 | " Apply the most preferred quickfix action to fix diagnostic on the current line 109 | nmap qf (coc-fix-current) 110 | 111 | " Remap keys for applying refactor code actions 112 | nmap re (coc-codeaction-refactor) 113 | xmap r (coc-codeaction-refactor-selected) 114 | nmap r (coc-codeaction-refactor-selected) 115 | 116 | " Run the Code Lens action on the current line 117 | nmap cl (coc-codelens-action) 118 | 119 | " Map function and class text objects 120 | " NOTE: Requires 'textDocument.documentSymbol' support from the language server 121 | xmap if (coc-funcobj-i) 122 | omap if (coc-funcobj-i) 123 | xmap af (coc-funcobj-a) 124 | omap af (coc-funcobj-a) 125 | xmap ic (coc-classobj-i) 126 | omap ic (coc-classobj-i) 127 | xmap ac (coc-classobj-a) 128 | omap ac (coc-classobj-a) 129 | 130 | " Remap and to scroll float windows/popups 131 | if has('nvim-0.4.0') || has('patch-8.2.0750') 132 | nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" 133 | nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" 134 | inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" 135 | inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" 136 | vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" 137 | vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" 138 | endif 139 | 140 | " Use CTRL-S for selections ranges 141 | " Requires 'textDocument/selectionRange' support of language server 142 | nmap (coc-range-select) 143 | xmap (coc-range-select) 144 | 145 | " Add `:Format` command to format current buffer 146 | command! -nargs=0 Format :call CocActionAsync('format') 147 | 148 | " Add `:Fold` command to fold current buffer 149 | command! -nargs=? Fold :call CocAction('fold', ) 150 | 151 | " Add `:OR` command for organize imports of the current buffer 152 | command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport') 153 | 154 | " Add (Neo)Vim's native statusline support 155 | " NOTE: Please see `:h coc-status` for integrations with external plugins that 156 | " provide custom statusline: lightline.vim, vim-airline 157 | set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} 158 | 159 | " Mappings for CoCList 160 | " Show all diagnostics 161 | nnoremap a :CocList diagnostics 162 | " Manage extensions 163 | nnoremap e :CocList extensions 164 | " Show commands 165 | nnoremap c :CocList commands 166 | " Find symbol of current document 167 | nnoremap o :CocList outline 168 | " Search workspace symbols 169 | nnoremap s :CocList -I symbols 170 | " Do default action for next item 171 | nnoremap j :CocNext 172 | " Do default action for previous item 173 | nnoremap k :CocPrev 174 | " Resume latest coc list 175 | nnoremap p :CocListResume 176 | 177 | 178 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 179 | " airline 180 | " 181 | " 182 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 183 | let g:airline_theme='base16_default' 184 | let g:airline#extensions#branch#enabled = 1 185 | let g:airline#extensions#syntastic#enabled = 1 186 | " enable tabs for buffers at the top 187 | let g:airline#extensions#tabline#enabled = 1 188 | let g:airline#extensions#tabline#buffer_idx_mode = 1 189 | nmap 1 AirlineSelectTab1 190 | nmap 2 AirlineSelectTab2 191 | nmap 3 AirlineSelectTab3 192 | nmap 4 AirlineSelectTab4 193 | nmap 5 AirlineSelectTab5 194 | nmap 6 AirlineSelectTab6 195 | nmap 7 AirlineSelectTab7 196 | nmap 8 AirlineSelectTab8 197 | nmap 9 AirlineSelectTab9 198 | let g:airline_powerline_fonts = 1 199 | let g:airline_symbols = {} 200 | " unicode symbols 201 | " let g:airline_left_sep = '»' 202 | " let g:airline_left_sep = '▶' 203 | " let g:airline_right_sep = '«' 204 | " let g:airline_right_sep = '◀' 205 | " let g:airline_symbols.linenr = '␊' 206 | " let g:airline_symbols.linenr = '␤' 207 | " let g:airline_symbols.linenr = '¶' 208 | " let g:airline_symbols.branch = '⎇' 209 | " let g:airline_symbols.paste = 'ρ' 210 | " let g:airline_symbols.paste = 'Þ' 211 | " let g:airline_symbols.paste = '∥' 212 | " let g:airline_symbols.whitespace = 'Ξ' 213 | 214 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 215 | " end airline 216 | " 217 | " 218 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 219 | set number 220 | set relativenumber 221 | let g:solarized_termcolors=256 222 | syntax enable 223 | set background=dark 224 | colorscheme base16-solarized-dark 225 | 226 | 227 | " Neotree 228 | nmap ,n :NERDTreeFind 229 | nmap ,m :NERDTreeToggle 230 | " 231 | -------------------------------------------------------------------------------- /nvim/lua/plugins/neotree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-neo-tree/neo-tree.nvim", 3 | branch = "v3.x", 4 | dependencies = { 5 | "nvim-lua/plenary.nvim", 6 | "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended 7 | "MunifTanjim/nui.nvim", 8 | -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information 9 | }, 10 | opts = { 11 | close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab 12 | popup_border_style = "rounded", 13 | enable_git_status = true, 14 | enable_diagnostics = true, 15 | open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes 16 | sort_case_insensitive = false, -- used when sorting files and directories in the tree 17 | sort_function = nil , -- use a custom function for sorting files and directories in the tree 18 | -- sort_function = function (a,b) 19 | -- if a.type == b.type then 20 | -- return a.path > b.path 21 | -- else 22 | -- return a.type > b.type 23 | -- end 24 | -- end , -- this sorts files and directories descendantly 25 | default_component_configs = { 26 | container = { 27 | enable_character_fade = true 28 | }, 29 | indent = { 30 | indent_size = 2, 31 | padding = 1, -- extra padding on left hand side 32 | -- indent guides 33 | with_markers = true, 34 | indent_marker = "│", 35 | last_indent_marker = "└", 36 | highlight = "NeoTreeIndentMarker", 37 | -- expander config, needed for nesting files 38 | with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders 39 | expander_collapsed = "", 40 | expander_expanded = "", 41 | expander_highlight = "NeoTreeExpander", 42 | }, 43 | icon = { 44 | folder_closed = "", 45 | folder_open = "", 46 | folder_empty = "󰜌", 47 | -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there 48 | -- then these will never be used. 49 | default = "*", 50 | highlight = "NeoTreeFileIcon" 51 | }, 52 | modified = { 53 | symbol = "[+]", 54 | highlight = "NeoTreeModified", 55 | }, 56 | name = { 57 | trailing_slash = false, 58 | use_git_status_colors = true, 59 | highlight = "NeoTreeFileName", 60 | }, 61 | git_status = { 62 | symbols = { 63 | -- Change type 64 | added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name 65 | modified = "", -- or "", but this is redundant info if you use git_status_colors on the name 66 | deleted = "✖",-- this can only be used in the git_status source 67 | renamed = "󰁕",-- this can only be used in the git_status source 68 | -- Status type 69 | untracked = "", 70 | ignored = "", 71 | unstaged = "󰄱", 72 | staged = "", 73 | conflict = "", 74 | } 75 | }, 76 | -- If you don't want to use these columns, you can set `enabled = false` for each of them individually 77 | file_size = { 78 | enabled = true, 79 | required_width = 64, -- min width of window required to show this column 80 | }, 81 | type = { 82 | enabled = true, 83 | required_width = 122, -- min width of window required to show this column 84 | }, 85 | last_modified = { 86 | enabled = true, 87 | required_width = 88, -- min width of window required to show this column 88 | }, 89 | created = { 90 | enabled = true, 91 | required_width = 110, -- min width of window required to show this column 92 | }, 93 | symlink_target = { 94 | enabled = false, 95 | }, 96 | }, 97 | -- A list of functions, each representing a global custom command 98 | -- that will be available in all sources (if not overridden in `opts[source_name].commands`) 99 | -- see `:h neo-tree-custom-commands-global` 100 | commands = {}, 101 | window = { 102 | position = "left", 103 | width = 40, 104 | mapping_options = { 105 | noremap = true, 106 | nowait = true, 107 | }, 108 | mappings = { 109 | [""] = { 110 | "toggle_node", 111 | nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use 112 | }, 113 | ["<2-LeftMouse>"] = "open", 114 | [""] = "open", 115 | [""] = "cancel", -- close preview or floating neo-tree window 116 | ["P"] = { "toggle_preview", config = { use_float = true, use_image_nvim = true } }, 117 | -- Read `# Preview Mode` for more information 118 | ["l"] = "focus_preview", 119 | ["S"] = "open_split", 120 | ["s"] = "open_vsplit", 121 | -- ["S"] = "split_with_window_picker", 122 | -- ["s"] = "vsplit_with_window_picker", 123 | ["t"] = "open_tabnew", 124 | -- [""] = "open_drop", 125 | -- ["t"] = "open_tab_drop", 126 | ["w"] = "open_with_window_picker", 127 | --["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing 128 | ["C"] = "close_node", 129 | -- ['C'] = 'close_all_subnodes', 130 | ["z"] = "close_all_nodes", 131 | --["Z"] = "expand_all_nodes", 132 | ["a"] = { 133 | "add", 134 | -- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details 135 | -- some commands may take optional config options, see `:h neo-tree-mappings` for details 136 | config = { 137 | show_path = "none" -- "none", "relative", "absolute" 138 | } 139 | }, 140 | ["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion. 141 | ["d"] = "delete", 142 | ["r"] = "rename", 143 | ["y"] = "copy_to_clipboard", 144 | ["x"] = "cut_to_clipboard", 145 | ["p"] = "paste_from_clipboard", 146 | ["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add": 147 | -- ["c"] = { 148 | -- "copy", 149 | -- config = { 150 | -- show_path = "none" -- "none", "relative", "absolute" 151 | -- } 152 | --} 153 | ["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add". 154 | ["q"] = "close_window", 155 | ["R"] = "refresh", 156 | ["?"] = "show_help", 157 | ["<"] = "prev_source", 158 | [">"] = "next_source", 159 | ["i"] = "show_file_details", 160 | } 161 | }, 162 | nesting_rules = {}, 163 | filesystem = { 164 | filtered_items = { 165 | visible = false, -- when true, they will just be displayed differently than normal items 166 | hide_dotfiles = true, 167 | hide_gitignored = true, 168 | hide_hidden = true, -- only works on Windows for hidden files/directories 169 | hide_by_name = { 170 | --"node_modules" 171 | }, 172 | hide_by_pattern = { -- uses glob style patterns 173 | --"*.meta", 174 | --"*/src/*/tsconfig.json", 175 | }, 176 | always_show = { -- remains visible even if other settings would normally hide it 177 | --".gitignored", 178 | }, 179 | always_show_by_pattern = { -- uses glob style patterns 180 | --".env*", 181 | }, 182 | never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show 183 | --".DS_Store", 184 | --"thumbs.db" 185 | }, 186 | never_show_by_pattern = { -- uses glob style patterns 187 | --".null-ls_*", 188 | }, 189 | }, 190 | follow_current_file = { 191 | enabled = false, -- This will find and focus the file in the active buffer every time 192 | -- -- the current file is changed while the tree is open. 193 | leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` 194 | }, 195 | group_empty_dirs = false, -- when true, empty folders will be grouped together 196 | hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree 197 | -- in whatever position is specified in window.position 198 | -- "open_current", -- netrw disabled, opening a directory opens within the 199 | -- window like netrw would, regardless of window.position 200 | -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs 201 | use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes 202 | -- instead of relying on nvim autocmd events. 203 | window = { 204 | mappings = { 205 | [""] = "navigate_up", 206 | ["."] = "set_root", 207 | ["H"] = "toggle_hidden", 208 | ["/"] = "fuzzy_finder", 209 | ["D"] = "fuzzy_finder_directory", 210 | ["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm 211 | -- ["D"] = "fuzzy_sorter_directory", 212 | ["f"] = "filter_on_submit", 213 | [""] = "clear_filter", 214 | ["[g"] = "prev_git_modified", 215 | ["]g"] = "next_git_modified", 216 | ["o"] = { "show_help", nowait=false, config = { title = "Order by", prefix_key = "o" }}, 217 | ["oc"] = { "order_by_created", nowait = false }, 218 | ["od"] = { "order_by_diagnostics", nowait = false }, 219 | ["og"] = { "order_by_git_status", nowait = false }, 220 | ["om"] = { "order_by_modified", nowait = false }, 221 | ["on"] = { "order_by_name", nowait = false }, 222 | ["os"] = { "order_by_size", nowait = false }, 223 | ["ot"] = { "order_by_type", nowait = false }, 224 | -- [''] = function(state) ... end, 225 | }, 226 | fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode 227 | [""] = "move_cursor_down", 228 | [""] = "move_cursor_down", 229 | [""] = "move_cursor_up", 230 | [""] = "move_cursor_up", 231 | -- [''] = function(state, scroll_padding) ... end, 232 | }, 233 | }, 234 | 235 | commands = {} -- Add a custom command or override a global one using the same function name 236 | }, 237 | buffers = { 238 | follow_current_file = { 239 | enabled = true, -- This will find and focus the file in the active buffer every time 240 | -- -- the current file is changed while the tree is open. 241 | leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` 242 | }, 243 | group_empty_dirs = true, -- when true, empty folders will be grouped together 244 | show_unloaded = true, 245 | window = { 246 | mappings = { 247 | ["bd"] = "buffer_delete", 248 | [""] = "navigate_up", 249 | ["."] = "set_root", 250 | ["o"] = { "show_help", nowait=false, config = { title = "Order by", prefix_key = "o" }}, 251 | ["oc"] = { "order_by_created", nowait = false }, 252 | ["od"] = { "order_by_diagnostics", nowait = false }, 253 | ["om"] = { "order_by_modified", nowait = false }, 254 | ["on"] = { "order_by_name", nowait = false }, 255 | ["os"] = { "order_by_size", nowait = false }, 256 | ["ot"] = { "order_by_type", nowait = false }, 257 | } 258 | }, 259 | }, 260 | git_status = { 261 | window = { 262 | position = "float", 263 | mappings = { 264 | ["A"] = "git_add_all", 265 | ["gu"] = "git_unstage_file", 266 | ["ga"] = "git_add_file", 267 | ["gr"] = "git_revert_file", 268 | ["gc"] = "git_commit", 269 | ["gp"] = "git_push", 270 | ["gg"] = "git_commit_and_push", 271 | ["o"] = { "show_help", nowait=false, config = { title = "Order by", prefix_key = "o" }}, 272 | ["oc"] = { "order_by_created", nowait = false }, 273 | ["od"] = { "order_by_diagnostics", nowait = false }, 274 | ["om"] = { "order_by_modified", nowait = false }, 275 | ["on"] = { "order_by_name", nowait = false }, 276 | ["os"] = { "order_by_size", nowait = false }, 277 | ["ot"] = { "order_by_type", nowait = false }, 278 | } 279 | } 280 | } 281 | }, 282 | keys = { 283 | { ",t", "Neotree toggle", desc = "NeoTree Toggle" }, 284 | { ",r", "Neotree reveal", desc = "NeoTree Reveal" }, 285 | { ",b", "Neotree buffers", desc = "NeoTree buffers" }, 286 | { ",g", "Neotree git_status", desc = "NeoTree Gitstatus" }, 287 | { ",s", "Neotree document_symbols", desc = "NeoTree Symbols" }, 288 | } 289 | } 290 | 291 | -------------------------------------------------------------------------------- /bashrc: -------------------------------------------------------------------------------- 1 | ############################################## 2 | # TERMINAL 3 | # 4 | ############################################## 5 | # Using screen doesn't allow base16-shell to work 6 | #export TERM=screen-256color 7 | ############################################## 8 | # Vim 9 | # 10 | ############################################## 11 | set -o vi 12 | export EDITOR=vim 13 | alias vim=nvim 14 | 15 | #### 16 | # tmux history 17 | # make sure history shows up in all tmux windows 18 | #### 19 | export HISTSIZE=9000 20 | export HISTCONTROL=ignoredups:erasedups #don't write duplicate entries. 21 | shopt -s histappend # append to the history file, instead of the default which is to overwrite 22 | # don't write history on every command 23 | # export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" # add and reload the history file. 24 | [ -d ~/.history ] || mkdir ~/.history 25 | export HISTFILE=~/.history/$(date +'%Y-%m-%d').log 26 | 27 | ############################################## 28 | # Path 29 | # 30 | ############################################## 31 | export PATH="/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:/usr/local/sbin:./bin:~/bin:$PATH" 32 | MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH" 33 | 34 | export PATH=$HOME/.toolbox/bin:$PATH 35 | export PATH=/opt/homebrew/bin:$PATH 36 | ############################################## 37 | # Android SDK 38 | # 39 | ############################################## 40 | export PATH="$PATH:~/Library/Android/sdk/platform-tools" 41 | 42 | 43 | ############################################## 44 | # GO 45 | # 46 | ############################################## 47 | 48 | #Note that this must not be the same path as your Go installation. 49 | export GOPATH=~/Development/go 50 | export PATH=$PATH:$GOPATH/bin 51 | ############################################## 52 | # Ruby 53 | # 54 | ############################################## 55 | if [ "$(type -t rbenv)" == "file" ]; then 56 | eval "$(rbenv init -)" 57 | fi 58 | 59 | ############################################## 60 | # Aliases 61 | # 62 | ############################################## 63 | alias vms='VBoxManage list runningvms' # See virtualbox running machines. 64 | alias lls='ls -lph --color' 65 | alias ls='ls --color' 66 | alias t2='tree -Fth -L 2 --du |less' #see tree with size up to 2 levels deep 67 | alias rgrep="grep -r --exclude-dir=.git --exclude=*.swp" #common grep excludes when searching a project. 68 | alias cgrep="grep --color=always" 69 | alias clear_dns="sudo killall -HUP mDNSResponder" 70 | alias vi=vim 71 | alias be="bundle exec" # When running a command and forcing bundled gems 72 | alias whatismyip="curl -s https://domains.google.com/checkip;echo" 73 | alias tigbm="tig HEAD ^master --first-parent" # show only the commits until master, without commits in merges 74 | alias tigb="tig HEAD ^master --first-parent --no-merges" # show only the commits until master, without merges 75 | if [ -f ~/.aliases ]; then 76 | . ~/.aliases 77 | fi 78 | 79 | 80 | if [ -f ~/.smb_creds ]; then 81 | alias smbclient="smbclient -A ~/.smb_creds" 82 | fi 83 | 84 | ############################################## 85 | # Functions 86 | # 87 | ############################################## 88 | grep_history() { 89 | local term="$@" 90 | grep $term -r ~/.history/ | tail 91 | } 92 | power_down_vms() { 93 | VMS=$(VBoxManage list runningvms |grep -v boot2docker | awk '{ x=$1;gsub("\"", "", x);print x }') 94 | for i in $VMS 95 | do 96 | echo "Shutting down $i" 97 | VBoxManage controlvm $i poweroff 2> /dev/null 98 | done 99 | } 100 | power_down_vm() { 101 | VM=$1 102 | echo "Shutting down $VM" 103 | VBoxManage controlvm $VM poweroff 2> /dev/null 104 | } 105 | git_pending() { 106 | show_diff=$1 107 | directories=$(find . -type d -depth 1 | grep -v '^\./\.') 108 | for i in $directories; 109 | do 110 | #echo "checking $i" 111 | if [ ! -d "$i/.git" ]; then 112 | continue 113 | fi 114 | (cd $i 115 | STATUS=$(git status) 116 | if [[ "$STATUS" =~ "Your branch is ahead of" ]]; then 117 | echo "$i pending push" 118 | if [[ "$show_diff" != "" ]] 119 | then 120 | git status && git diff 121 | fi 122 | fi 123 | ) 124 | done 125 | } 126 | git_dirty() { 127 | show_diff=$1 128 | directories=$(find . -type d -depth 1 | grep -v '^\./\.') 129 | for i in $directories; 130 | do 131 | #echo "checking $i" 132 | if [ ! -d "$i/.git" ]; then 133 | continue 134 | fi 135 | cd $i 136 | STATUS=$(git status) 137 | if [[ ! "$STATUS" =~ "working directory clean" ]]; then 138 | echo "$i dirty" 139 | if [[ "$show_diff" != "" ]] 140 | then 141 | git status && git diff 142 | fi 143 | fi 144 | cd .. 145 | done 146 | } 147 | create_local_gemset() { 148 | echo './.gems' > .rbenv-gemsets 149 | } 150 | recompile_ycm() { 151 | (cd ~/.vim/bundle/YouCompleteMe; ./install.py --clang-completer) 152 | } 153 | ycm_init() { 154 | if [ -f .ycm_extra_conf.py ]; then 155 | echo ".ycm_extra_conf.py already exists, remove to install default" 156 | return 157 | fi 158 | [ -d ~/.cache ] || mkdir ~/.cache 159 | curl -sL https://raw.githubusercontent.com/Valloric/ycmd/master/cpp/ycm/.ycm_extra_conf.py -o /tmp/.ycm_extra_conf.py 160 | if [ $? -ne 0 ]; then 161 | cp ~/.cache /tmp/.ycm_extra_conf.py 162 | else 163 | cp /tmp/.ycm_extra_conf.py ~/.cache 164 | fi 165 | cp /tmp/.ycm_extra_conf.py . 166 | echo "Installed default .ycm_extra_conf.py" 167 | } 168 | alias init_ycm=ycm_init 169 | tmux_light() { 170 | tmux source-file ~/Development/tmux-colors-solarized/tmuxcolors-light.conf 171 | } 172 | tmux_dark() { 173 | tmux source-file ~/Development/tmux-colors-solarized/tmuxcolors-dark.conf 174 | } 175 | man() { 176 | env LESS_TERMCAP_mb=$'\E[01;31m' \ 177 | LESS_TERMCAP_md=$'\E[01;38;5;74m' \ 178 | LESS_TERMCAP_me=$'\E[0m' \ 179 | LESS_TERMCAP_se=$'\E[0m' \ 180 | LESS_TERMCAP_so=$'\E[38;5;246m' \ 181 | LESS_TERMCAP_ue=$'\E[0m' \ 182 | LESS_TERMCAP_us=$'\E[04;38;5;146m' \ 183 | man "$@" 184 | } 185 | semver_bump() { 186 | local file=$1 187 | local bumper=$2 188 | local awk_script=$(cat <<'SCRIPT' 189 | { 190 | v=$2 191 | gsub("'", "", v); 192 | split(v, p, "."); 193 | major=p[1]; 194 | minor=p[2]; 195 | patch=p[3]; 196 | print major "." minor "." patch 197 | bumper; 198 | print major "." minor "." patch 199 | } 200 | SCRIPT 201 | ) 202 | 203 | local versions=$(awk -f <(echo "${awk_script/bumper/$bumper}") <(grep version $file)) 204 | local cur_ver=$(echo "$versions" | head -n1 ) 205 | local new_version=$(echo "$versions" | tail -n1) 206 | sed -e "/version/s/${cur_ver}/${new_version}/" -i '' $file 207 | git diff $file 208 | } 209 | patch_bump() { 210 | semver_bump metadata.rb "patch++" 211 | } 212 | minor_bump() { 213 | semver_bump metadata.rb "minor++;patch=0;" 214 | } 215 | major_bump() { 216 | semver_bump metadata.rb "major++;minor=0;patch=0;" 217 | } 218 | 219 | # open vim in the gem directory 220 | gem_edit() { 221 | gem=$1 222 | gem_dir=$(bundle show $gem) 223 | exit_status=$? 224 | if [ $exit_status -ne 0 ]; then 225 | gem_dir=$(dirname $(dirname $(gem which $gem))) 226 | fi; 227 | #echo "dir: " $gem_dir 228 | (cd $gem_dir; vim) 229 | } 230 | show_vms_on_host() 231 | { 232 | echo "Running vms:" 233 | if [ -n "$1" ]; then 234 | ssh $1 "ps aux | grep VBoxHeadless | grep -v grep | grep -o 'comment [^ ]*' | awk '{print \$2}'" 235 | echo "Defined vms:" 236 | ssh $1 "find /home/vm -type d 2>/dev/null | grep Logs | awk 'FS=\"/\" { print \$5 }' " 237 | else 238 | if [ -f ~/.vm_host_domain ]; then 239 | local host_domain=$(cat ~/.vm_host_domain) 240 | for i in gum mint beast fudge candy; do 241 | echo "$i.$host_domain" 242 | echo "-------------------------" 243 | show_vms_on_host ${i}.$host_domain 244 | done 245 | fi 246 | fi 247 | } 248 | 249 | true_color() 250 | { 251 | printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n" 252 | } 253 | 254 | # mimic linux service name start|stop|restart 255 | service() { 256 | local service_name=$1 257 | local action=${2:-restart} 258 | local launch_agent_config="$(find ~/Library/LaunchAgents /System/Library/LaunchAgents/ /System/Library/LaunchDaemons/ -iregex ".*$service_name.*")" 259 | if [ $(echo "$launch_agent_config" | wc -l) -gt 1 ]; then 260 | printf "Found more than 1 configuration, please be more specific:\n$launch_agent_config\n" 261 | return 1 262 | fi 263 | if [ -z $launch_agent_config ]; then 264 | echo "No service found for $service_name" 265 | return 1; 266 | fi 267 | echo -n "$action on $launch_agent_config..." 268 | case $action in 269 | restart) 270 | launchctl unload "$launch_agent_config" 271 | return_code=$? 272 | if [ $return_code -eq 0 ]; then 273 | launchctl load "$launch_agent_config" 274 | return_code=$? 275 | fi; 276 | ;; 277 | stop) 278 | launchctl unload "$launch_agent_config" 279 | return_code=$? 280 | ;; 281 | start) 282 | launchctl load "$launch_agent_config" 283 | return_code=$? 284 | ;; 285 | esac 286 | if [ $return_code -eq 0 ]; then 287 | echo "OK" 288 | else 289 | echo "Failed" 290 | fi; 291 | } 292 | 293 | show_cookbook_git_status() { 294 | for i in ~/Development/chef/cookbooks/*; do 295 | [ -d $i ] && (cd $i; if [ -d .git ] && [ "$(git status -s 2>/dev/null| wc -l )" -ne 0 ]; then 296 | echo i; 297 | git status -s ; 298 | fi 299 | ) 300 | done; 301 | } 302 | # Get the version of the cookbook on the chef server 303 | chef_compare_server_version() { 304 | local cookbook=$(basename $(pwd)) 305 | server_version=$(knife cookbook list | grep $cookbook | awk '{ print $2 }') 306 | local_version=$(grep version metadata.rb | awk '{ print $2 }') 307 | echo "local version $local_version, server version $server_version" 308 | } 309 | ## quickly create a site to view html content 310 | pow_make_site() 311 | { 312 | # if no site_name is provided use the current directory (remove /app to assume bower sites) 313 | site_name=${1:-$(basename ${PWD%%/app})} 314 | if [ -z "$site_name" ]; then 315 | echo "Must provide site_name" 316 | return 317 | fi 318 | if [ -f config.ru ]; then 319 | local site=$(readlink -f .) 320 | else 321 | local site=~/sites/$site_name 322 | fi 323 | read -n1 -p "Create site at $site? " response 324 | echo "" 325 | if [ "$response" == "y" ]; then 326 | echo "Creating $site_name" 327 | mkdir -p $site 328 | local public_dir=${site}/public 329 | [ -d $public_dir ] && rm $public_dir 330 | ln -s $(readlink -f .) $public_dir 331 | [ -L ~/.pow/$site_name ] || ln -s $site ~/.pow/$site_name 332 | echo "site located at http://${site_name}.dev/" 333 | else 334 | echo "Not creating site." 335 | fi 336 | 337 | 338 | } 339 | 340 | pow_show_sites() 341 | { 342 | for i in `/bin/ls ~/.pow`; 343 | do printf "%-50s" http://${i}.dev/; 344 | dir=~/.pow/$i/ 345 | if [ -d $dir/public ]; then 346 | dir=$dir/public 347 | fi; 348 | readlink -f $dir; 349 | done 350 | } 351 | 352 | pow_make_index() 353 | { 354 | for p in `/bin/ls`; do printf '%s
' $p $p >> index.html; done 355 | } 356 | 357 | pow_rm_site() 358 | { 359 | local site_name=${1:-$(basename ${PWD%%/app})} 360 | if [ -z "$site_name" ]; then 361 | echo "Must provide site_name" 362 | return 363 | fi 364 | local site=~/sites/$site_name 365 | echo "Checking if we can remove ${site}" 366 | local public_dir=${site}/public 367 | [ -L ~/.pow/$site_name ] && rm ~/.pow/$site_name 368 | [ -d $site ] && rm -r $site 369 | } 370 | 371 | show_yaml_key() { 372 | local key_name=$1 373 | local file_name=$2 374 | sed -n "/^$key_name:/, /^[[:alpha:]]/ p" $file_name | head -n -1 375 | } 376 | 377 | update_profile() { 378 | if [ "$TMUX" ] && [ "$(tmux showenv ITERM_PROFILE)" ]; then 379 | eval $(tmux showenv ITERM_PROFILE) 380 | fi 381 | } 382 | # Ideally, this would not be needed if you open a proper iterm session, 383 | # i.e. use command-o instead of command-i (command-i will use the same profile value as the original profile, even though you've switched) 384 | # unfornuately the update-environment setting in tmux is for new sessions not attaching to existing sessions. 385 | # Currently I have to manually call this every time I switch to a new profile 386 | set_tmux_profile() { 387 | if [ "$TMUX" ]; then 388 | tmux setenv -g ITERM_PROFILE $ITERM_PROFILE 389 | fi 390 | } 391 | show_tmux_panes() { 392 | for session in $(tmux list-sessions -F '#{session_name}'); do 393 | tmux list-windows -t "$session" -F '#{window_index} "#{window_name}"' | while read win_index window; do 394 | tmux list-panes -t "$session:$win_index" -F"#{pane_index} #{pane_tty} #{pane_pid}" | while read pane tty pid; do 395 | printf "%-30s %30s\n" "Pane Addr: $session:$win_index:$pane (Window $window, Pane: $pane)" $tty 396 | pstree $pid 397 | printf "\n\n" 398 | done 399 | done 400 | done 401 | 402 | } 403 | show_function_keys() { 404 | printf "%-5s%5s\n" "key" "value"; infocmp -1 | awk -F= '/kf/ { key=$1; sub("kf", "", key); printf("%-5d %s\n", key, $2) }' | sort -n 405 | } 406 | 407 | unset_aws() { 408 | eval $(set | grep ^RDS | awk -F'=' '{ printf("unset %s\n", $1); }') 409 | } 410 | 411 | ## Samba functions 412 | [ -f ~/.smb_mount.sh ] && . ~/.smb_mount.sh 413 | 414 | 415 | ############################################## 416 | # Colors 417 | # 418 | ############################################## 419 | export CLICOLOR=1 #Enable colors on a mac 420 | if [ -d ~/.dircolors ]; then 421 | eval $(dircolors ~/.dircolors/dircolors.ansi-dark) 422 | fi 423 | BASE16_SHELL="$HOME/.config/base16-shell/" 424 | if [ -n "$PS1" ]; then 425 | [ -s "$BASE16_SHELL/profile_helper.sh" ] && \ 426 | . "$BASE16_SHELL/profile_helper.sh" && \ 427 | base16_default-dark 428 | fi 429 | ############################################## 430 | # Externals 431 | # 432 | ############################################## 433 | 434 | # if which brew &>/dev/null &&[ -f $(brew --prefix)/share/bash-completion/bash_completion ]; then 435 | # #echo "bashcompletions2 installed" 436 | # . $(brew --prefix)/share/bash-completion/bash_completion 437 | # elif which brew &>/dev/null && [ -f $(brew --prefix)/etc/bash_completion ]; then 438 | # echo "Using slow bash-completion v1, switch to bash-completion 2" 439 | # . $(brew --prefix)/etc/bash_completion 440 | # elif [ -z "$BASH_COMPLETION" ] && [ -f /etc/bash_completion ]; then 441 | # . /etc/bash_completion 442 | # elif [ -z "$BASH_COMPLETION" ]; then 443 | # echo "Missing bash completion, brew install bash-completion@2 or /etc/bash_completion" 444 | # fi 445 | 446 | 447 | 448 | update_docker_host_addr() { 449 | local docker_host=$(ping -c1 docker.local | awk '{ getline; sub(/:/,"", $4); print $4;exit }') 450 | sed -i'' -e "s/DOCKER_HOST_ADDR=.*/DOCKER_HOST_ADDR=$docker_host/" ~/.dockerrc 451 | } 452 | if [ -f ~/.dockerrc ]; then 453 | . ~/.dockerrc 454 | fi 455 | 456 | if [ -f ~/.cdpath ]; then 457 | . ~/.cdpath 458 | fi; 459 | 460 | ############################################## 461 | # Git prompt 462 | # 463 | ############################################## 464 | 465 | #Customizing git prompt 466 | # removing the newline. 467 | #GIT_PROMPT_END_USER=" ${White}${Time12a}${ResetColor}$ " 468 | if [[ "$HOSTNAME" =~ home\.moralesva\.com$ ]]; then 469 | GIT_PROMPT_END=" \n\u@${White}\h${ResetColor}:\$ " 470 | else 471 | GIT_PROMPT_END=" \n\u@${White}\H${ResetColor}:\$ " 472 | fi 473 | 474 | #[ -f ~/.bash-git-prompt/gitprompt.sh ] && . ~/.bash-git-prompt/gitprompt.sh || echo "Missing git prompt, please run 'brew install bash-git-prompt'" 475 | if [ -n "$PS1" ] && [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then 476 | __GIT_PROMPT_DIR="$(brew --prefix bash-git-prompt)/share" 477 | source "$__GIT_PROMPT_DIR/gitprompt.sh" 478 | fi 479 | 480 | # airline prompt 481 | [ -f ~/.shell_prompt.sh ] && . ~/.shell_prompt.sh 482 | 483 | ############################################## 484 | # AWS settings 485 | # 486 | ############################################## 487 | export EC2_AMITOOL_HOME="/usr/local/Cellar/ec2-ami-tools/1.5.2/libexec" 488 | export EC2_HOME="/usr/local/Cellar/ec2-api-tools/1.6.13.0/libexec" 489 | complete -C aws_completer aws 490 | 491 | if [ -f ~/.aws_scripts ]; then 492 | . ~/.aws_scripts 493 | aws_set_profile 494 | fi 495 | 496 | ############################################## 497 | # JAVA settings 498 | # 499 | ############################################## 500 | [ -f ~/.java_home ] && . ~/.java_home 501 | 502 | ### Added by the Heroku Toolbelt 503 | export PATH="/usr/local/heroku/bin:$PATH" 504 | 505 | ### nvm 506 | export NVM_DIR="$HOME/.nvm" 507 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 508 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 509 | export PATH="/opt/homebrew/opt/node@18/bin:$PATH" 510 | 511 | 512 | ## Add binstubs 513 | export PATH=./bin:$PATH 514 | 515 | PATH="/Users/jmorales/perl5/bin${PATH:+:${PATH}}"; export PATH; 516 | PERL5LIB="/Users/jmorales/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; 517 | PERL_LOCAL_LIB_ROOT="/Users/jmorales/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; 518 | PERL_MB_OPT="--install_base \"/Users/jmorales/perl5\""; export PERL_MB_OPT; 519 | PERL_MM_OPT="INSTALL_BASE=/Users/jmorales/perl5"; export PERL_MM_OPT; 520 | . "$HOME/.cargo/env" 521 | export PYENV_ROOT="$HOME/.pyenv" 522 | command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" 523 | # eval "$(pyenv init -)" 524 | eval "$(brew shellenv)" 525 | if [ -f ~/.paths ]; then 526 | . ~/.paths 527 | fi 528 | 529 | -------------------------------------------------------------------------------- /irssi/nicklist.pl: -------------------------------------------------------------------------------- 1 | # for documentation: see http://wouter.coekaerts.be/site/irssi/nicklist 2 | 3 | use Irssi; 4 | use strict; 5 | use IO::Handle; # for (auto)flush 6 | use Fcntl; # for sysopen 7 | use vars qw($VERSION %IRSSI); 8 | $VERSION = '0.4.6'; 9 | %IRSSI = ( 10 | authors => 'Wouter Coekaerts', 11 | contact => 'coekie@irssi.org', 12 | name => 'nicklist', 13 | description => 'draws a nicklist to another terminal, or at the right of your irssi in the same terminal', 14 | license => 'GPLv2', 15 | url => 'http://wouter.coekaerts.be/irssi', 16 | changed => '29/06/2004' 17 | ); 18 | 19 | sub cmd_help { 20 | print ( < 24 | NICKLIST SCREEN 25 | NICKLIST FIFO 26 | NICKLIST OFF 27 | NICKLIST UPDATE 28 | 29 | For help see: http://wouter.coekaerts.be/site/irssi/nicklist 30 | 31 | in short: 32 | 33 | 1. FIFO MODE 34 | - in irssi: /NICKLIST FIFO (only the first time, to create the fifo) 35 | - in a shell, in a window where you want the nicklist: cat ~/.irssi/nicklistfifo 36 | - back in irssi: 37 | /SET nicklist_heigth 38 | /SET nicklist_width 39 | /NICKLIST FIFO 40 | 41 | 2. SCREEN MODE 42 | - start irssi inside screen ("screen irssi") 43 | - /NICKLIST SCREEN 44 | EOF 45 | ); 46 | } 47 | 48 | my $prev_lines = 0; # number of lines in previous written nicklist 49 | my $scroll_pos = 0; # scrolling position 50 | my $cursor_line; # line the cursor is currently on 51 | my ($OFF, $SCREEN, $FIFO) = (0,1,2); # modes 52 | my $mode = $OFF; # current mode 53 | my $need_redraw = 0; # nicklist needs redrawing 54 | my $screen_resizing = 0; # terminal is being resized 55 | my $active_channel; # (REC) 56 | 57 | my @nicklist=(); # array of hashes, containing the internal nicklist of the active channel 58 | # nick => realnick 59 | # mode => 60 | my ($MODE_OP, $MODE_HALFOP, $MODE_VOICE, $MODE_NORMAL) = (0,1,2,3); 61 | # status => 62 | my ($STATUS_NORMAL, $STATUS_JOINING, $STATUS_PARTING, $STATUS_QUITING, $STATUS_KICKED, $STATUS_SPLIT) = (0,1,2,3,4,5); 63 | # text => text to be printed 64 | # cmp => text used to compare (sort) nicks 65 | 66 | 67 | # 'cached' settings 68 | my ($screen_prefix, $irssi_width, @prefix_mode, @prefix_status, $height, $nicklist_width); 69 | 70 | sub read_settings { 71 | ($screen_prefix = Irssi::settings_get_str('nicklist_screen_prefix')) =~ s/\\e/\033/g; 72 | 73 | ($prefix_mode[$MODE_OP] = Irssi::settings_get_str('nicklist_prefix_mode_op')) =~ s/\\e/\033/g; 74 | ($prefix_mode[$MODE_HALFOP] = Irssi::settings_get_str('nicklist_prefix_mode_halfop')) =~ s/\\e/\033/g; 75 | ($prefix_mode[$MODE_VOICE] = Irssi::settings_get_str('nicklist_prefix_mode_voice')) =~ s/\\e/\033/g; 76 | ($prefix_mode[$MODE_NORMAL] = Irssi::settings_get_str('nicklist_prefix_mode_normal')) =~ s/\\e/\033/g; 77 | 78 | if ($mode != $SCREEN) { 79 | $height = Irssi::settings_get_int('nicklist_height'); 80 | } 81 | my $new_nicklist_width = Irssi::settings_get_int('nicklist_width'); 82 | if ($new_nicklist_width != $nicklist_width && $mode == $SCREEN) { 83 | sig_terminal_resized(); 84 | } 85 | $nicklist_width = $new_nicklist_width; 86 | } 87 | 88 | sub update { 89 | read_settings(); 90 | make_nicklist(); 91 | } 92 | 93 | ################## 94 | ##### OUTPUT ##### 95 | ################## 96 | 97 | ### off ### 98 | 99 | sub cmd_off { 100 | if ($mode == $SCREEN) { 101 | screen_stop(); 102 | } elsif ($mode == $FIFO) { 103 | fifo_stop(); 104 | } 105 | } 106 | 107 | ### fifo ### 108 | 109 | sub cmd_fifo_start { 110 | read_settings(); 111 | my $path = Irssi::settings_get_str('nicklist_fifo_path'); 112 | unless (-p $path) { # not a pipe 113 | if (-e _) { # but a something else 114 | die "$0: $path exists and is not a pipe, please remove it\n"; 115 | } else { 116 | require POSIX; 117 | POSIX::mkfifo($path, 0666) or die "can\'t mkfifo $path: $!"; 118 | Irssi::print("Fifo created. Start reading it (\"cat $path\") and try again."); 119 | return; 120 | } 121 | } 122 | if (!sysopen(FIFO, $path, O_WRONLY | O_NONBLOCK)) { # or die "can't write $path: $!"; 123 | Irssi::print("Couldn\'t write to the fifo ($!). Please start reading the fifo (\"cat $path\") and try again."); 124 | return; 125 | } 126 | FIFO->autoflush(1); 127 | print FIFO "\033[2J\033[1;1H"; # erase screen & jump to 0,0 128 | $cursor_line = 0; 129 | if ($mode == $SCREEN) { 130 | screen_stop(); 131 | } 132 | $mode = $FIFO; 133 | make_nicklist(); 134 | } 135 | 136 | sub fifo_stop { 137 | close FIFO; 138 | $mode = $OFF; 139 | Irssi::print("Fifo closed."); 140 | } 141 | 142 | ### screen ### 143 | 144 | sub cmd_screen_start { 145 | if (!defined($ENV{'STY'})) { 146 | Irssi::print 'screen not detected, screen mode only works inside screen'; 147 | return; 148 | } 149 | read_settings(); 150 | if ($mode == $SCREEN) {return;} 151 | if ($mode == $FIFO) { 152 | fifo_stop(); 153 | } 154 | $mode = $SCREEN; 155 | Irssi::signal_add_last('gui print text finished', \&sig_gui_print_text_finished); 156 | Irssi::signal_add_last('gui page scrolled', \&sig_page_scrolled); 157 | Irssi::signal_add('terminal resized', \&sig_terminal_resized); 158 | screen_size(); 159 | make_nicklist(); 160 | } 161 | 162 | sub screen_stop { 163 | $mode = $OFF; 164 | Irssi::signal_remove('gui print text finished', \&sig_gui_print_text_finished); 165 | Irssi::signal_remove('gui page scrolled', \&sig_page_scrolled); 166 | Irssi::signal_remove('terminal resized', \&sig_terminal_resized); 167 | system 'screen -x '.$ENV{'STY'}.' -X fit'; 168 | } 169 | 170 | sub screen_size { 171 | if ($mode != $SCREEN) { 172 | return; 173 | } 174 | $screen_resizing = 1; 175 | # fit screen 176 | system 'screen -x '.$ENV{'STY'}.' -X fit'; 177 | # get size (from perldoc -q size) 178 | my ($winsize, $row, $col, $xpixel, $ypixel); 179 | eval 'use Term::ReadKey; ($col, $row, $xpixel, $ypixel) = GetTerminalSize'; 180 | # require Term::ReadKey 'GetTerminalSize'; 181 | # ($col, $row, $xpixel, $ypixel) = Term::ReadKey::GetTerminalSize; 182 | #}; 183 | if ($@) { # no Term::ReadKey, try the ugly way 184 | eval { 185 | require 'sys/ioctl.ph'; 186 | # without this reloading doesn't work. workaround for some unknown bug 187 | do 'asm/ioctls.ph'; 188 | }; 189 | 190 | # ugly way not working, let's try something uglier, the dg-hack(tm) (constant for linux only?) 191 | if($@) { no strict 'refs'; *TIOCGWINSZ = sub { return 0x5413 } } 192 | 193 | unless (defined &TIOCGWINSZ) { 194 | die "Term::ReadKey not found, and ioctl 'workaround' failed. Install the Term::ReadKey perl module to use screen mode.\n"; 195 | } 196 | open(TTY, "+{'nick'}) =~ s/^(.{$tmp})..+$/$1\033[34m~\033[m/; 264 | $nick->{'text'} = $prefix_mode[$nick->{'mode'}] . $text . (' ' x ($nicklist_width-length($nick->{'nick'})-1)); 265 | $nick->{'cmp'} = $nick->{'mode'}.lc($nick->{'nick'}); 266 | } 267 | 268 | # redraw the given nick (nr) if it is visible 269 | sub redraw_nick_nr { 270 | my ($nr) = @_; 271 | my $line = $nr - $scroll_pos; 272 | if ($line >= 0 && $line < $height) { 273 | nicklist_write_line($line, $nicklist[$nr]->{'text'}); 274 | } 275 | } 276 | 277 | # nick was inserted, redraw area if necessary 278 | sub draw_insert_nick_nr { 279 | my ($nr) = @_; 280 | my $line = $nr - $scroll_pos; 281 | if ($line < 0) { # nick is inserted above visible area 282 | $scroll_pos++; # 'scroll' down :) 283 | } elsif ($line < $height) { # line is visible 284 | if ($mode == $SCREEN) { 285 | need_redraw(); 286 | } elsif ($mode == $FIFO) { 287 | my $data = "\033[m\033[L". $nicklist[$nr]->{'text'}; # reset color & insert line & write nick 288 | if ($line == $cursor_line) { 289 | $data = "\033[1G".$data; # back to beginning of line 290 | } else { 291 | $data = "\033[".($line+1).";1H".$data; # jump 292 | } 293 | $cursor_line=$line; 294 | print(FIFO $data) or fifo_stop(); 295 | if ($prev_lines < $height) { 296 | $prev_lines++; # the nicklist has one line more 297 | } 298 | } 299 | } 300 | } 301 | 302 | sub draw_remove_nick_nr { 303 | my ($nr) = @_; 304 | my $line = $nr - $scroll_pos; 305 | if ($line < 0) { # nick removed above visible area 306 | $scroll_pos--; # 'scroll' up :) 307 | } elsif ($line < $height) { # line is visible 308 | if ($mode == $SCREEN) { 309 | need_redraw(); 310 | } elsif ($mode == $FIFO) { 311 | #my $data = "\033[m\033[L[i$line]". $nicklist[$nr]->{'text'}; # reset color & insert line & write nick 312 | my $data = "\033[M"; # delete line 313 | if ($line != $cursor_line) { 314 | $data = "\033[".($line+1)."d".$data; # jump 315 | } 316 | $cursor_line=$line; 317 | print(FIFO $data) or fifo_stop(); 318 | if (@nicklist-$scroll_pos >= $height) { 319 | redraw_nick_nr($scroll_pos+$height-1); 320 | } 321 | } 322 | } 323 | } 324 | 325 | # redraw the whole nicklist 326 | sub redraw { 327 | $need_redraw = 0; 328 | #make_nicklist(); 329 | nicklist_write_start(); 330 | my $line = 0; 331 | ### draw nicklist ### 332 | for (my $i=$scroll_pos;$line < $height && $i < @nicklist; $i++) { 333 | nicklist_write_line($line++, $nicklist[$i]->{'text'}); 334 | } 335 | 336 | ### clean up other lines ### 337 | my $real_lines = $line; 338 | while($line < $prev_lines) { 339 | nicklist_write_line($line++,' ' x $nicklist_width); 340 | } 341 | $prev_lines = $real_lines; 342 | nicklist_write_end(); 343 | } 344 | 345 | # redraw (with little delay to avoid redrawing to much) 346 | sub need_redraw { 347 | if(!$need_redraw) { 348 | $need_redraw = 1; 349 | Irssi::timeout_add_once(10,\&redraw,[]); 350 | } 351 | } 352 | 353 | sub sig_page_scrolled { 354 | $prev_lines = $height; # we'll need to redraw everything if he scrolled up 355 | need_redraw; 356 | } 357 | 358 | # redraw (with delay) if the window is visible (only in screen mode) 359 | sub sig_gui_print_text_finished { 360 | if ($need_redraw) { # there's already a redraw 'queued' 361 | return; 362 | } 363 | my $window = @_[0]; 364 | if ($window->{'refnum'} == Irssi::active_win->{'refnum'} || Irssi::settings_get_str('nicklist_screen_split_windows') eq '*') { 365 | need_redraw; 366 | return; 367 | } 368 | foreach my $win (split(/[ ,]/, Irssi::settings_get_str('nicklist_screen_split_windows'))) { 369 | if ($window->{'refnum'} == $win || $window->{'name'} eq $win) { 370 | need_redraw; 371 | return; 372 | } 373 | } 374 | } 375 | 376 | #################### 377 | ##### NICKLIST ##### 378 | #################### 379 | 380 | # returns the position of the given nick(as string) in the (internal) nicklist 381 | sub find_nick { 382 | my ($nick) = @_; 383 | for (my $i=0;$i < @nicklist; $i++) { 384 | if ($nicklist[$i]->{'nick'} eq $nick) { 385 | return $i; 386 | } 387 | } 388 | return -1; 389 | } 390 | 391 | # find position where nick should be inserted into the list 392 | sub find_insert_pos { 393 | my ($cmp)= @_; 394 | for (my $i=0;$i < @nicklist; $i++) { 395 | if ($nicklist[$i]->{'cmp'} gt $cmp) { 396 | return $i; 397 | } 398 | } 399 | return scalar(@nicklist); #last 400 | } 401 | 402 | # make the (internal) nicklist (@nicklist) 403 | sub make_nicklist { 404 | @nicklist = (); 405 | $scroll_pos = 0; 406 | 407 | ### get & check channel ### 408 | my $channel = Irssi::active_win->{active}; 409 | 410 | if (!$channel || (ref($channel) ne 'Irssi::Irc::Channel' && ref($channel) ne 'Irssi::Silc::Channel') || $channel->{'type'} ne 'CHANNEL' || ($channel->{chat_type} ne 'SILC' && !$channel->{'names_got'}) ) { 411 | $active_channel = undef; 412 | # no nicklist 413 | } else { 414 | $active_channel = $channel; 415 | ### make nicklist ### 416 | my $thisnick; 417 | foreach my $nick (sort {(($a->{'op'}?'1':$a->{'halfop'}?'2':$a->{'voice'}?'3':'4').lc($a->{'nick'})) 418 | cmp (($b->{'op'}?'1':$b->{'halfop'}?'2':$b->{'voice'}?'3':'4').lc($b->{'nick'}))} $channel->nicks()) { 419 | $thisnick = {'nick' => $nick->{'nick'}, 'mode' => ($nick->{'op'}?$MODE_OP:$nick->{'halfop'}?$MODE_HALFOP:$nick->{'voice'}?$MODE_VOICE:$MODE_NORMAL)}; 420 | calc_text($thisnick); 421 | push @nicklist, $thisnick; 422 | } 423 | } 424 | need_redraw(); 425 | } 426 | 427 | # insert nick(as hash) into nicklist 428 | # pre: cmp has to be calculated 429 | sub insert_nick { 430 | my ($nick) = @_; 431 | my $nr = find_insert_pos($nick->{'cmp'}); 432 | splice @nicklist, $nr, 0, $nick; 433 | draw_insert_nick_nr($nr); 434 | } 435 | 436 | # remove nick(as nr) from nicklist 437 | sub remove_nick { 438 | my ($nr) = @_; 439 | splice @nicklist, $nr, 1; 440 | draw_remove_nick_nr($nr); 441 | } 442 | 443 | ################### 444 | ##### ACTIONS ##### 445 | ################### 446 | 447 | # scroll the nicklist, arg = number of lines to scroll, positive = down, negative = up 448 | sub cmd_scroll { 449 | if (!$active_channel) { # not a channel active 450 | return; 451 | } 452 | my @nicks=Irssi::active_win->{active}->nicks; 453 | my $nick_count = scalar(@nicks)+0; 454 | my $channel = Irssi::active_win->{active}; 455 | if (!$channel || $channel->{type} ne 'CHANNEL' || !$channel->{names_got} || $nick_count <= Irssi::settings_get_int('nicklist_height')) { 456 | return; 457 | } 458 | $scroll_pos += @_[0]; 459 | 460 | if ($scroll_pos > $nick_count - $height) { 461 | $scroll_pos = $nick_count - $height; 462 | } 463 | if ($scroll_pos <= 0) { 464 | $scroll_pos = 0; 465 | } 466 | need_redraw(); 467 | } 468 | 469 | sub is_active_channel { 470 | my ($server,$channel) = @_; # (channel as string) 471 | return ($server && $server->{'tag'} eq $active_channel->{'server'}->{'tag'} && $server->channel_find($channel) && $active_channel && $server->channel_find($channel)->{'name'} eq $active_channel->{'name'}); 472 | } 473 | 474 | sub sig_channel_wholist { # this is actualy a little late, when the names are received would be better 475 | my ($channel) = @_; 476 | if (Irssi::active_win->{'active'} && Irssi::active_win->{'active'}->{'name'} eq $channel->{'name'}) { # the channel joined is active 477 | make_nicklist 478 | } 479 | } 480 | 481 | sub sig_join { 482 | my ($server,$channel,$nick,$address) = @_; 483 | if (!is_active_channel($server,$channel)) { 484 | return; 485 | } 486 | my $newnick = {'nick' => $nick, 'mode' => $MODE_NORMAL}; 487 | calc_text($newnick); 488 | insert_nick($newnick); 489 | } 490 | 491 | sub sig_kick { 492 | my ($server, $channel, $nick, $kicker, $address, $reason) = @_; 493 | if (!is_active_channel($server,$channel)) { 494 | return; 495 | } 496 | my $nr = find_nick($nick); 497 | if ($nr == -1) { 498 | Irssi::print("nicklist warning: $nick was kicked from $channel, but not found in nicklist"); 499 | } else { 500 | remove_nick($nr); 501 | } 502 | } 503 | 504 | sub sig_part { 505 | my ($server,$channel,$nick,$address, $reason) = @_; 506 | if (!is_active_channel($server,$channel)) { 507 | return; 508 | } 509 | my $nr = find_nick($nick); 510 | if ($nr == -1) { 511 | Irssi::print("nicklist warning: $nick has parted $channel, but was not found in nicklist"); 512 | } else { 513 | remove_nick($nr); 514 | } 515 | 516 | } 517 | 518 | sub sig_quit { 519 | my ($server,$nick,$address, $reason) = @_; 520 | if ($server->{'tag'} ne $active_channel->{'server'}->{'tag'}) { 521 | return; 522 | } 523 | my $nr = find_nick($nick); 524 | if ($nr != -1) { 525 | remove_nick($nr); 526 | } 527 | } 528 | 529 | sub sig_nick { 530 | my ($server, $newnick, $oldnick, $address) = @_; 531 | if ($server->{'tag'} ne $active_channel->{'server'}->{'tag'}) { 532 | return; 533 | } 534 | my $nr = find_nick($oldnick); 535 | if ($nr != -1) { # if nick was found (nickchange is in current channel) 536 | my $nick = $nicklist[$nr]; 537 | remove_nick($nr); 538 | $nick->{'nick'} = $newnick; 539 | calc_text($nick); 540 | insert_nick($nick); 541 | } 542 | } 543 | 544 | sub sig_mode { 545 | my ($channel, $nick, $setby, $mode, $type) = @_; # (nick and channel as rec) 546 | if ($channel->{'server'}->{'tag'} ne $active_channel->{'server'}->{'tag'} || $channel->{'name'} ne $active_channel->{'name'}) { 547 | return; 548 | } 549 | my $nr = find_nick($nick->{'nick'}); 550 | if ($nr == -1) { 551 | Irssi::print("nicklist warning: $nick->{'nick'} had mode set on $channel->{'name'}, but was not found in nicklist"); 552 | } else { 553 | my $nicklist_item = $nicklist[$nr]; 554 | remove_nick($nr); 555 | $nicklist_item->{'mode'} = ($nick->{'op'}?$MODE_OP:$nick->{'halfop'}?$MODE_HALFOP:$nick->{'voice'}?$MODE_VOICE:$MODE_NORMAL); 556 | calc_text($nicklist_item); 557 | insert_nick($nicklist_item); 558 | } 559 | } 560 | 561 | ##### command binds ##### 562 | Irssi::command_bind 'nicklist' => sub { 563 | my ( $data, $server, $item ) = @_; 564 | $data =~ s/\s+$//g; 565 | Irssi::command_runsub ('nicklist', $data, $server, $item ) ; 566 | }; 567 | Irssi::signal_add_first 'default command nicklist' => sub { 568 | # gets triggered if called with unknown subcommand 569 | cmd_help(); 570 | }; 571 | Irssi::command_bind('nicklist update',\&update); 572 | Irssi::command_bind('nicklist help',\&cmd_help); 573 | Irssi::command_bind('nicklist scroll',\&cmd_scroll); 574 | Irssi::command_bind('nicklist fifo',\&cmd_fifo_start); 575 | Irssi::command_bind('nicklist screen',\&cmd_screen_start); 576 | Irssi::command_bind('nicklist screensize',\&screen_size); 577 | Irssi::command_bind('nicklist off',\&cmd_off); 578 | 579 | ##### signals ##### 580 | Irssi::signal_add_last('window item changed', \&make_nicklist); 581 | Irssi::signal_add_last('window changed', \&make_nicklist); 582 | Irssi::signal_add_last('channel wholist', \&sig_channel_wholist); 583 | Irssi::signal_add_first('message join', \&sig_join); # first, to be before ignores 584 | Irssi::signal_add_first('message part', \&sig_part); 585 | Irssi::signal_add_first('message kick', \&sig_kick); 586 | Irssi::signal_add_first('message quit', \&sig_quit); 587 | Irssi::signal_add_first('message nick', \&sig_nick); 588 | Irssi::signal_add_first('message own_nick', \&sig_nick); 589 | Irssi::signal_add_first('nick mode changed', \&sig_mode); 590 | 591 | Irssi::signal_add('setup changed', \&read_settings); 592 | 593 | ##### settings ##### 594 | Irssi::settings_add_str('nicklist', 'nicklist_screen_prefix', '\e[m '); 595 | Irssi::settings_add_str('nicklist', 'nicklist_prefix_mode_op', '\e[32m@\e[39m'); 596 | Irssi::settings_add_str('nicklist', 'nicklist_prefix_mode_halfop', '\e[34m%\e[39m'); 597 | Irssi::settings_add_str('nicklist', 'nicklist_prefix_mode_voice', '\e[33m+\e[39m'); 598 | Irssi::settings_add_str('nicklist', 'nicklist_prefix_mode_normal', ' '); 599 | 600 | Irssi::settings_add_int('nicklist', 'nicklist_width',11); 601 | Irssi::settings_add_int('nicklist', 'nicklist_height',24); 602 | Irssi::settings_add_str('nicklist', 'nicklist_fifo_path', Irssi::get_irssi_dir . '/nicklistfifo'); 603 | Irssi::settings_add_str('nicklist', 'nicklist_screen_split_windows', ''); 604 | Irssi::settings_add_str('nicklist', 'nicklist_automode', ''); 605 | 606 | read_settings(); 607 | if (uc(Irssi::settings_get_str('nicklist_automode')) eq 'SCREEN') { 608 | cmd_screen_start(); 609 | } elsif (uc(Irssi::settings_get_str('nicklist_automode')) eq 'FIFO') { 610 | cmd_fifo_start(); 611 | } 612 | -------------------------------------------------------------------------------- /colors/colortest.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # by entheon, do whatever the hell you want with this file 4 | 5 | print "\n"; 6 | print "**************************\n"; 7 | print "*XTERM 256Color Test Chart\n"; 8 | print "**************************\n"; 9 | print "* 16 = black\n"; 10 | print "* 255 = white\n"; 11 | print "*\n"; 12 | print "* Usage:\n"; 13 | print "* colortest -w\n"; 14 | print "* wide display\n"; 15 | print "*\n"; 16 | print "* colortest -w -r\n"; 17 | print "* wide display reversed\n"; 18 | print "*\n"; 19 | print "* colortest -w -s\n"; 20 | print "* extra spaces padding\n"; 21 | print "*\n"; 22 | print "* colortest -w -r -s\n"; 23 | print "* available combination\n"; 24 | print "*\n"; 25 | print "**************************\n"; 26 | 27 | if( $ARGV[0] eq "-w" || $ARGV[1] eq "-w" || $ARGV[2] eq "-w" ) { 28 | push(@arr, [( " 16: 00/00/00", " 17: 00/00/5f", " 18: 00/00/87", " 19: 00/00/af", " 20: 00/00/d7", " 21: 00/00/ff")] ); 29 | push(@arr, [( " 22: 00/5f/00", " 23: 00/5f/5f", " 24: 00/5f/87", " 25: 00/5f/af", " 26: 00/5f/d7", " 27: 00/5f/ff")] ); 30 | push(@arr, [( " 28: 00/87/00", " 29: 00/87/5f", " 30: 00/87/87", " 31: 00/87/af", " 32: 00/87/d7", " 33: 00/87/ff")] ); 31 | push(@arr, [( " 34: 00/af/00", " 35: 00/af/5f", " 36: 00/af/87", " 37: 00/af/af", " 38: 00/af/d7", " 39: 00/af/ff")] ); 32 | push(@arr, [( " 40: 00/d7/00", " 41: 00/d7/5f", " 42: 00/d7/87", " 43: 00/d7/af", " 44: 00/d7/d7", " 45: 00/d7/ff")] ); 33 | push(@arr, [( " 46: 00/ff/00", " 47: 00/ff/5f", " 48: 00/ff/87", " 49: 00/ff/af", " 50: 00/ff/d7", " 51: 00/ff/ff")] ); 34 | push(@arr, [( " 52: 5f/00/00", " 53: 5f/00/5f", " 54: 5f/00/87", " 55: 5f/00/af", " 56: 5f/00/d7", " 57: 5f/00/ff")] ); 35 | push(@arr, [( " 58: 5f/5f/00", " 59: 5f/5f/5f", " 60: 5f/5f/87", " 61: 5f/5f/af", " 62: 5f/5f/d7", " 63: 5f/5f/ff")] ); 36 | push(@arr, [( " 64: 5f/87/00", " 65: 5f/87/5f", " 66: 5f/87/87", " 67: 5f/87/af", " 68: 5f/87/d7", " 69: 5f/87/ff")] ); 37 | push(@arr, [( " 70: 5f/af/00", " 71: 5f/af/5f", " 72: 5f/af/87", " 73: 5f/af/af", " 74: 5f/af/d7", " 75: 5f/af/ff")] ); 38 | push(@arr, [( " 76: 5f/d7/00", " 77: 5f/d7/5f", " 78: 5f/d7/87", " 79: 5f/d7/af", " 80: 5f/d7/d7", " 81: 5f/d7/ff")] ); 39 | push(@arr, [( " 82: 5f/ff/00", " 83: 5f/ff/5f", " 84: 5f/ff/87", " 85: 5f/ff/af", " 86: 5f/ff/d7", " 87: 5f/ff/ff")] ); 40 | push(@arr, [( " 88: 87/00/00", " 89: 87/00/5f", " 90: 87/00/87", " 91: 87/00/af", " 92: 87/00/d7", " 93: 87/00/ff")] ); 41 | push(@arr, [( " 94: 87/5f/00", " 95: 87/5f/5f", " 96: 87/5f/87", " 97: 87/5f/af", " 98: 87/5f/d7", " 99: 87/5f/ff")] ); 42 | push(@arr, [( " 100: 87/87/00", " 101: 87/87/5f", " 102: 87/87/87", " 103: 87/87/af", " 104: 87/87/d7", " 105: 87/87/ff")] ); 43 | push(@arr, [( " 106: 87/af/00", " 107: 87/af/5f", " 108: 87/af/87", " 109: 87/af/af", " 110: 87/af/d7", " 111: 87/af/ff")] ); 44 | push(@arr, [( " 112: 87/d7/00", " 113: 87/d7/5f", " 114: 87/d7/87", " 115: 87/d7/af", " 116: 87/d7/d7", " 117: 87/d7/ff")] ); 45 | push(@arr, [( " 118: 87/ff/00", " 119: 87/ff/5f", " 120: 87/ff/87", " 121: 87/ff/af", " 122: 87/ff/d7", " 123: 87/ff/ff")] ); 46 | push(@arr, [( " 124: af/00/00", " 125: af/00/5f", " 126: af/00/87", " 127: af/00/af", " 128: af/00/d7", " 129: af/00/ff")] ); 47 | push(@arr, [( " 130: af/5f/00", " 131: af/5f/5f", " 132: af/5f/87", " 133: af/5f/af", " 134: af/5f/d7", " 135: af/5f/ff")] ); 48 | push(@arr, [( " 136: af/87/00", " 137: af/87/5f", " 138: af/87/87", " 139: af/87/af", " 140: af/87/d7", " 141: af/87/ff")] ); 49 | push(@arr, [( " 142: af/af/00", " 143: af/af/5f", " 144: af/af/87", " 145: af/af/af", " 146: af/af/d7", " 147: af/af/ff")] ); 50 | push(@arr, [( " 148: af/d7/00", " 149: af/d7/5f", " 150: af/d7/87", " 151: af/d7/af", " 152: af/d7/d7", " 153: af/d7/ff")] ); 51 | push(@arr, [( " 154: af/ff/00", " 155: af/ff/5f", " 156: af/ff/87", " 157: af/ff/af", " 158: af/ff/d7", " 159: af/ff/ff")] ); 52 | push(@arr, [( " 160: d7/00/00", " 161: d7/00/5f", " 162: d7/00/87", " 163: d7/00/af", " 164: d7/00/d7", " 165: d7/00/ff")] ); 53 | push(@arr, [( " 166: d7/5f/00", " 167: d7/5f/5f", " 168: d7/5f/87", " 169: d7/5f/af", " 170: d7/5f/d7", " 171: d7/5f/ff")] ); 54 | push(@arr, [( " 172: d7/87/00", " 173: d7/87/5f", " 174: d7/87/87", " 175: d7/87/af", " 176: d7/87/d7", " 177: d7/87/ff")] ); 55 | push(@arr, [( " 178: d7/af/00", " 179: d7/af/5f", " 180: d7/af/87", " 181: d7/af/af", " 182: d7/af/d7", " 183: d7/af/ff")] ); 56 | push(@arr, [( " 184: d7/d7/00", " 185: d7/d7/5f", " 186: d7/d7/87", " 187: d7/d7/af", " 188: d7/d7/d7", " 189: d7/d7/ff")] ); 57 | push(@arr, [( " 190: d7/ff/00", " 191: d7/ff/5f", " 192: d7/ff/87", " 193: d7/ff/af", " 194: d7/ff/d7", " 195: d7/ff/ff")] ); 58 | push(@arr, [( " 196: ff/00/00", " 197: ff/00/5f", " 198: ff/00/87", " 199: ff/00/af", " 200: ff/00/d7", " 201: ff/00/ff")] ); 59 | push(@arr, [( " 202: ff/5f/00", " 203: ff/5f/5f", " 204: ff/5f/87", " 205: ff/5f/af", " 206: ff/5f/d7", " 207: ff/5f/ff")] ); 60 | push(@arr, [( " 208: ff/87/00", " 209: ff/87/5f", " 210: ff/87/87", " 211: ff/87/af", " 212: ff/87/d7", " 213: ff/87/ff")] ); 61 | push(@arr, [( " 214: ff/af/00", " 215: ff/af/5f", " 216: ff/af/87", " 217: ff/af/af", " 218: ff/af/d7", " 219: ff/af/ff")] ); 62 | push(@arr, [( " 220: ff/d7/00", " 221: ff/d7/5f", " 222: ff/d7/87", " 223: ff/d7/af", " 224: ff/d7/d7", " 225: ff/d7/ff")] ); 63 | push(@arr, [( " 226: ff/ff/00", " 227: ff/ff/5f", " 228: ff/ff/87", " 229: ff/ff/af", " 230: ff/ff/d7", " 231: ff/ff/ff")] ); 64 | push(@arr, [( " 232: 08/08/08", " 233: 12/12/12", " 234: 1c/1c/1c", " 235: 26/26/26", " 236: 30/30/30", " 237: 3a/3a/3a")] ); 65 | push(@arr, [( " 238: 44/44/44", " 239: 4e/4e/4e", " 240: 58/58/58", " 241: 62/62/62", " 242: 6c/6c/6c", " 243: 76/76/76")] ); 66 | push(@arr, [( " 244: 80/80/80", " 245: 8a/8a/8a", " 246: 94/94/94", " 247: 9e/9e/9e", " 248: a8/a8/a8", " 249: b2/b2/b2")] ); 67 | push(@arr, [( " 250: bc/bc/bc", " 251: c6/c6/c6", " 252: d0/d0/d0", " 253: da/da/da", " 254: e4/e4/e4", " 255: ee/ee/ee")] ); 68 | 69 | if( $ARGV[0] eq "-s" || $ARGV[1] eq "-s" || $ARGV[2] eq "-s" ){ 70 | $padding = " "; 71 | } 72 | else { 73 | 74 | } 75 | 76 | # display in reverse order 77 | if( $ARGV[0] eq "-r" || $ARGV[1] eq "-r" || $ARGV[2] eq "-r" ){ 78 | for( $dimone = 0; $dimone < scalar @arr; $dimone++ ) { 79 | 80 | $seed = ($dimone % 6) * -1; 81 | for( $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) { 82 | 83 | $movone = $seed; 84 | $movtwo = $seed * -1; 85 | 86 | print $arr[$dimone][$dimtwo] . $padding; 87 | 88 | $seed = $seed+1; 89 | } 90 | 91 | print "\n"; 92 | } 93 | } 94 | else { 95 | for( $dimone = 0; $dimone < scalar @arr; $dimone++ ) { 96 | 97 | $seed = ($dimone % 6) * -1; 98 | for( $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) { 99 | 100 | $movone = $seed; 101 | $movtwo = $seed * -1; 102 | 103 | $newone = $dimone+$movone; 104 | $newtwo = $dimtwo+$movtwo; 105 | 106 | if( $newone < scalar @arr ){ 107 | print $arr[$newone][$newtwo] . $padding; 108 | } 109 | 110 | $seed = $seed+1; 111 | } 112 | 113 | print "\n"; 114 | } 115 | } 116 | print "\n"; 117 | print "\n"; 118 | 119 | } 120 | else { 121 | print " 16: 00/00/00\n"; 122 | print " 17: 00/00/5f\n"; 123 | print " 18: 00/00/87\n"; 124 | print " 19: 00/00/af\n"; 125 | print " 20: 00/00/d7\n"; 126 | print " 21: 00/00/ff\n"; 127 | print " 22: 00/5f/00\n"; 128 | print " 23: 00/5f/5f\n"; 129 | print " 24: 00/5f/87\n"; 130 | print " 25: 00/5f/af\n"; 131 | print " 26: 00/5f/d7\n"; 132 | print " 27: 00/5f/ff\n"; 133 | print " 28: 00/87/00\n"; 134 | print " 29: 00/87/5f\n"; 135 | print " 30: 00/87/87\n"; 136 | print " 31: 00/87/af\n"; 137 | print " 32: 00/87/d7\n"; 138 | print " 33: 00/87/ff\n"; 139 | print " 34: 00/af/00\n"; 140 | print " 35: 00/af/5f\n"; 141 | print " 36: 00/af/87\n"; 142 | print " 37: 00/af/af\n"; 143 | print " 38: 00/af/d7\n"; 144 | print " 39: 00/af/ff\n"; 145 | print " 40: 00/d7/00\n"; 146 | print " 41: 00/d7/5f\n"; 147 | print " 42: 00/d7/87\n"; 148 | print " 43: 00/d7/af\n"; 149 | print " 44: 00/d7/d7\n"; 150 | print " 45: 00/d7/ff\n"; 151 | print " 46: 00/ff/00\n"; 152 | print " 47: 00/ff/5f\n"; 153 | print " 48: 00/ff/87\n"; 154 | print " 49: 00/ff/af\n"; 155 | print " 50: 00/ff/d7\n"; 156 | print " 51: 00/ff/ff\n"; 157 | print " 52: 5f/00/00\n"; 158 | print " 53: 5f/00/5f\n"; 159 | print " 54: 5f/00/87\n"; 160 | print " 55: 5f/00/af\n"; 161 | print " 56: 5f/00/d7\n"; 162 | print " 57: 5f/00/ff\n"; 163 | print " 58: 5f/5f/00\n"; 164 | print " 59: 5f/5f/5f\n"; 165 | print " 60: 5f/5f/87\n"; 166 | print " 61: 5f/5f/af\n"; 167 | print " 62: 5f/5f/d7\n"; 168 | print " 63: 5f/5f/ff\n"; 169 | print " 64: 5f/87/00\n"; 170 | print " 65: 5f/87/5f\n"; 171 | print " 66: 5f/87/87\n"; 172 | print " 67: 5f/87/af\n"; 173 | print " 68: 5f/87/d7\n"; 174 | print " 69: 5f/87/ff\n"; 175 | print " 70: 5f/af/00\n"; 176 | print " 71: 5f/af/5f\n"; 177 | print " 72: 5f/af/87\n"; 178 | print " 73: 5f/af/af\n"; 179 | print " 74: 5f/af/d7\n"; 180 | print " 75: 5f/af/ff\n"; 181 | print " 76: 5f/d7/00\n"; 182 | print " 77: 5f/d7/5f\n"; 183 | print " 78: 5f/d7/87\n"; 184 | print " 79: 5f/d7/af\n"; 185 | print " 80: 5f/d7/d7\n"; 186 | print " 81: 5f/d7/ff\n"; 187 | print " 82: 5f/ff/00\n"; 188 | print " 83: 5f/ff/5f\n"; 189 | print " 84: 5f/ff/87\n"; 190 | print " 85: 5f/ff/af\n"; 191 | print " 86: 5f/ff/d7\n"; 192 | print " 87: 5f/ff/ff\n"; 193 | print " 88: 87/00/00\n"; 194 | print " 89: 87/00/5f\n"; 195 | print " 90: 87/00/87\n"; 196 | print " 91: 87/00/af\n"; 197 | print " 92: 87/00/d7\n"; 198 | print " 93: 87/00/ff\n"; 199 | print " 94: 87/5f/00\n"; 200 | print " 95: 87/5f/5f\n"; 201 | print " 96: 87/5f/87\n"; 202 | print " 97: 87/5f/af\n"; 203 | print " 98: 87/5f/d7\n"; 204 | print " 99: 87/5f/ff\n"; 205 | print " 100 :87/87/00\n"; 206 | print " 101 :87/87/5f\n"; 207 | print " 102 :87/87/87\n"; 208 | print " 103 :87/87/af\n"; 209 | print " 104 :87/87/d7\n"; 210 | print " 105 :87/87/ff\n"; 211 | print " 106 :87/af/00\n"; 212 | print " 107 :87/af/5f\n"; 213 | print " 108 :87/af/87\n"; 214 | print " 109 :87/af/af\n"; 215 | print " 110 :87/af/d7\n"; 216 | print " 111 :87/af/ff\n"; 217 | print " 112 :87/d7/00\n"; 218 | print " 113 :87/d7/5f\n"; 219 | print " 114 :87/d7/87\n"; 220 | print " 115 :87/d7/af\n"; 221 | print " 116 :87/d7/d7\n"; 222 | print " 117 :87/d7/ff\n"; 223 | print " 118 :87/ff/00\n"; 224 | print " 119 :87/ff/5f\n"; 225 | print " 120 :87/ff/87\n"; 226 | print " 121 :87/ff/af\n"; 227 | print " 122 :87/ff/d7\n"; 228 | print " 123 :87/ff/ff\n"; 229 | print " 124 :af/00/00\n"; 230 | print " 125 :af/00/5f\n"; 231 | print " 126 :af/00/87\n"; 232 | print " 127 :af/00/af\n"; 233 | print " 128 :af/00/d7\n"; 234 | print " 129 :af/00/ff\n"; 235 | print " 130 :af/5f/00\n"; 236 | print " 131 :af/5f/5f\n"; 237 | print " 132 :af/5f/87\n"; 238 | print " 133 :af/5f/af\n"; 239 | print " 134 :af/5f/d7\n"; 240 | print " 135 :af/5f/ff\n"; 241 | print " 136 :af/87/00\n"; 242 | print " 137 :af/87/5f\n"; 243 | print " 138 :af/87/87\n"; 244 | print " 139 :af/87/af\n"; 245 | print " 140 :af/87/d7\n"; 246 | print " 141 :af/87/ff\n"; 247 | print " 142 :af/af/00\n"; 248 | print " 143 :af/af/5f\n"; 249 | print " 144 :af/af/87\n"; 250 | print " 145 :af/af/af\n"; 251 | print " 146 :af/af/d7\n"; 252 | print " 147 :af/af/ff\n"; 253 | print " 148 :af/d7/00\n"; 254 | print " 149 :af/d7/5f\n"; 255 | print " 150 :af/d7/87\n"; 256 | print " 151 :af/d7/af\n"; 257 | print " 152 :af/d7/d7\n"; 258 | print " 153 :af/d7/ff\n"; 259 | print " 154 :af/ff/00\n"; 260 | print " 155 :af/ff/5f\n"; 261 | print " 156 :af/ff/87\n"; 262 | print " 157 :af/ff/af\n"; 263 | print " 158 :af/ff/d7\n"; 264 | print " 159 :af/ff/ff\n"; 265 | print " 160 :d7/00/00\n"; 266 | print " 161 :d7/00/5f\n"; 267 | print " 162 :d7/00/87\n"; 268 | print " 163 :d7/00/af\n"; 269 | print " 164 :d7/00/d7\n"; 270 | print " 165 :d7/00/ff\n"; 271 | print " 166 :d7/5f/00\n"; 272 | print " 167 :d7/5f/5f\n"; 273 | print " 168 :d7/5f/87\n"; 274 | print " 169 :d7/5f/af\n"; 275 | print " 170 :d7/5f/d7\n"; 276 | print " 171 :d7/5f/ff\n"; 277 | print " 172 :d7/87/00\n"; 278 | print " 173 :d7/87/5f\n"; 279 | print " 174 :d7/87/87\n"; 280 | print " 175 :d7/87/af\n"; 281 | print " 176 :d7/87/d7\n"; 282 | print " 177 :d7/87/ff\n"; 283 | print " 178 :d7/af/00\n"; 284 | print " 179 :d7/af/5f\n"; 285 | print " 180 :d7/af/87\n"; 286 | print " 181 :d7/af/af\n"; 287 | print " 182 :d7/af/d7\n"; 288 | print " 183 :d7/af/ff\n"; 289 | print " 184 :d7/d7/00\n"; 290 | print " 185 :d7/d7/5f\n"; 291 | print " 186 :d7/d7/87\n"; 292 | print " 187 :d7/d7/af\n"; 293 | print " 188 :d7/d7/d7\n"; 294 | print " 189 :d7/d7/ff\n"; 295 | print " 190 :d7/ff/00\n"; 296 | print " 191 :d7/ff/5f\n"; 297 | print " 192 :d7/ff/87\n"; 298 | print " 193 :d7/ff/af\n"; 299 | print " 194 :d7/ff/d7\n"; 300 | print " 195 :d7/ff/ff\n"; 301 | print " 196 :ff/00/00\n"; 302 | print " 197 :ff/00/5f\n"; 303 | print " 198 :ff/00/87\n"; 304 | print " 199 :ff/00/af\n"; 305 | print " 200 :ff/00/d7\n"; 306 | print " 201 :ff/00/ff\n"; 307 | print " 202 :ff/5f/00\n"; 308 | print " 203 :ff/5f/5f\n"; 309 | print " 204 :ff/5f/87\n"; 310 | print " 205 :ff/5f/af\n"; 311 | print " 206 :ff/5f/d7\n"; 312 | print " 207 :ff/5f/ff\n"; 313 | print " 208 :ff/87/00\n"; 314 | print " 209 :ff/87/5f\n"; 315 | print " 210 :ff/87/87\n"; 316 | print " 211 :ff/87/af\n"; 317 | print " 212 :ff/87/d7\n"; 318 | print " 213 :ff/87/ff\n"; 319 | print " 214 :ff/af/00\n"; 320 | print " 215 :ff/af/5f\n"; 321 | print " 216 :ff/af/87\n"; 322 | print " 217 :ff/af/af\n"; 323 | print " 218 :ff/af/d7\n"; 324 | print " 219 :ff/af/ff\n"; 325 | print " 220 :ff/d7/00\n"; 326 | print " 221 :ff/d7/5f\n"; 327 | print " 222 :ff/d7/87\n"; 328 | print " 223 :ff/d7/af\n"; 329 | print " 224 :ff/d7/d7\n"; 330 | print " 225 :ff/d7/ff\n"; 331 | print " 226 :ff/ff/00\n"; 332 | print " 227 :ff/ff/5f\n"; 333 | print " 228 :ff/ff/87\n"; 334 | print " 229 :ff/ff/af\n"; 335 | print " 230 :ff/ff/d7\n"; 336 | print " 231 :ff/ff/ff\n"; 337 | print " 232 :08/08/08\n"; 338 | print " 233 :12/12/12\n"; 339 | print " 234 :1c/1c/1c\n"; 340 | print " 235 :26/26/26\n"; 341 | print " 236 :30/30/30\n"; 342 | print " 237 :3a/3a/3a\n"; 343 | print " 238 :44/44/44\n"; 344 | print " 239 :4e/4e/4e\n"; 345 | print " 240 :58/58/58\n"; 346 | print " 241 :62/62/62\n"; 347 | print " 242 :6c/6c/6c\n"; 348 | print " 243 :76/76/76\n"; 349 | print " 244 :80/80/80\n"; 350 | print " 245 :8a/8a/8a\n"; 351 | print " 246 :94/94/94\n"; 352 | print " 247 :9e/9e/9e\n"; 353 | print " 248 :a8/a8/a8\n"; 354 | print " 249 :b2/b2/b2\n"; 355 | print " 250 :bc/bc/bc\n"; 356 | print " 251 :c6/c6/c6\n"; 357 | print " 252 :d0/d0/d0\n"; 358 | print " 253 :da/da/da\n"; 359 | print " 254 :e4/e4/e4\n"; 360 | print " 255 :ee/ee/ee\n"; 361 | print "\n"; 362 | print "\n"; 363 | } 364 | print "0m"; 365 | exit; 366 | --------------------------------------------------------------------------------