dotfiles

$HOME is where the <3 is
git clone git://git.alexkarle.com/dotfiles.git
Log | Files | Refs | Submodules | README

commit b9324d1735120dc978d675821c0ed2d1140ac3d7 (patch)
parent 78dfb81d829fd06ce01a9394a0c8519cb4c92c67
Author: Alexander Karle <akarle@umass.edu>
Date:   Tue, 13 Mar 2018 15:35:40 -0400

Italics in tmux and vim and iTerm2

This may break some things...

Diffstat:
Aterminfo/README.md | 7+++++++
Aterminfo/tmux-256color.terminfo | 6++++++
Aterminfo/xterm-256color-italic.terminfo | 14++++++++++++++
Mtmux.conf | 5+++--
Mvim/theme.vim | 3++-
Mzshrc | 6++++++
6 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/terminfo/README.md b/terminfo/README.md @@ -0,0 +1,7 @@ +# Terminfo Dotfiles + +At the time of adding, the sole purpose of these files is to add italics support to iTerm2, tmux, and vim. + +For the setup instructions, see this [link](https://alexpearce.me/2014/05/italics-in-iterm2-vim-tmux/). + +Also check out [this link](https://medium.com/@dubistkomisch/how-to-actually-get-italics-and-true-colour-to-work-in-iterm-tmux-vim-9ebe55ebc2be) for the tmux parts that got it working for me. diff --git a/terminfo/tmux-256color.terminfo b/terminfo/tmux-256color.terminfo @@ -0,0 +1,6 @@ +# A tmux-256color based TERMINFO that adds the escape sequences for italic. +# CREDIT: https://medium.com/@dubistkomisch/how-to-actually-get-italics-and-true-colour-to-work-in-iterm-tmux-vim-9ebe55ebc2be +tmux-256color|tmux with 256 colors, + ritm=\E[23m, rmso=\E[27m, sitm=\E[3m, smso=\E[7m, Ms@, + khome=\E[1~, kend=\E[4~, + use=xterm-256color, use=screen-256color, diff --git a/terminfo/xterm-256color-italic.terminfo b/terminfo/xterm-256color-italic.terminfo @@ -0,0 +1,14 @@ +# A xterm-256color based TERMINFO that adds the escape sequences for italic. +# +# Install: +# +# tic xterm-256color-italic.terminfo +# +# Usage: +# +# export TERM=xterm-256color-italic +# +# CREDIT: https://gist.github.com/sos4nt/3187620 +xterm-256color-italic|xterm with 256 colors and italic, + sitm=\E[3m, ritm=\E[23m, + use=xterm-256color, diff --git a/tmux.conf b/tmux.conf @@ -16,9 +16,10 @@ bind c new-window -c "#{pane_current_path}" bind r source-file ~/.tmux.conf; display "reloaded" # Add truecolor support -set-option -ga terminal-overrides ",xterm-256color:Tc" +# set-option -ga terminal-overrides ",xterm-256color:Tc" # Default terminal is 256 colors -set -g default-terminal "screen-256color" +set -g default-terminal 'tmux-256color' +set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m' # switch panes using vim keys bind C-h select-pane -L diff --git a/vim/theme.vim b/vim/theme.vim @@ -23,13 +23,14 @@ if (has("termguicolors")) " load colorscheme if plugins installed if filereadable(expand("~/.vim/bundle/vim-one/colors/one.vim")) + let g:one_allow_italics = 1 colorscheme one " reverse one-dark's fold colors highlight Folded guibg=#282c34 guifg=#5c6370 endif " Needed for termgui in tmux--&term begins w screen-... - if &term =~# '^screen' + if &term =~# '^tmux' " Set the terminal foreground+background colors " See :h xterm-true-color let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum" diff --git a/zshrc b/zshrc @@ -15,6 +15,9 @@ export DEFAULT_USER="$(whoami)" # prevent zsh from renaming tmux windows DISABLE_AUTO_TITLE="true" +# export editor for tmuxinator +# export EDITOR="vim" + # vi keymap in terminal # credit: Doug Black (https://dougblack.io/words/zsh-vi-mode.html) bindkey -v @@ -38,5 +41,8 @@ zle -N zle-keymap-select # alias vim='nvim' alias dps="docker ps -a" +# ITALICS UPDATE: may break ssh? +# alias ssh='TERM=xterm-256color ssh' + # cd to a parent directory function pcd { cd ${PWD%/$1/*}/$1; }