carylwyatt / dotfiles

so I won't be sad when I lose this later

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dotfiles

set up fresh vim:

  1. check the version of vim: vim --version
    • if <8, upgrade!
    • brew install vim did the trick on macOS
    • ubuntu:
      • had to add add-apt-repository ability: sudo apt-get install -y software-properties-common
      • sudo add-apt-repository ppa:jonathonf/vim
      • sudo apt-get update
      • sudo apt-get install vim
  2. clone repo into working directory git clone https://github.com/carylwyatt/dotfiles.git
  3. copy .vimrc to user directory cp .vimrc ~/.vimrc
  4. install Vundle git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  5. launch vim and run :PluginInstall

neovim settings

live at ~/.config/nvim/init.vim -- which you'll probably have to create

Neovim uses vim-plug instead of Vundle, so install that like this:

curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

then:

nvim
:PlugInstall

if you want all the magic of my bash setup

  1. cp .bash_profile ~/.bash_profile
  2. cp .git-prompt.sh ~/.git-prompt.sh
  3. brew install git bash-completion

if ubuntu, you'll need to add this line to the bottom of ~/.bashrc:

  • . ~/.bash_profile
  • if you're still getting a bash error about PS1, try: sudo apt-get install git-core bash-completion to double check git-completion installed properly

iterm settings

  • follow instrcutions at dracula for iterm for setting iterm theme
  • key remaps:
    • change right command key to control
    • change "to switch panes" to opt-number
  • once you've installed powerline fonts and symbols, head to preferenes > profiles > text and change font under Font to source code pro and Non-ASCII Font to PowerlineSymbols

powerline fonts and symbols

2022 UPDATE Just use nerd fonts. Easiest choice is to set iTerm2 fonts to "Hack Nerd Font Mono", 13 pt, use the ligatures. It's easy, and it's fine.

For whatever reason, great fonts and symbols are automagically included in ubuntu 18.04, so no need to install any of these powerline fonts unless you really want them! However, you'll probably want emoji support for your unicorn, so sudo apt-get install fonts-emojione

Mostly followed these instructions:

symbols

  1. wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf
  2. wget https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf
  3. sudo mv PowerlineSymbols.otf /usr/share/fonts/
  4. sudo fc-cache -vf
  5. sudo mv 10-powerline-symbols.conf /etc/fonts/conf.d/
  6. restart terminal

fonts

This took me forever to figure out, but it was as simple as cloning the powerline fonts repo and moving folders around šŸ¤·

  1. git clone https://github.com/powerline/fonts.git
  2. mv fonts/SourceCodePro /usr/share/fonts/
  3. sudo fc-cache -vf
  4. restart terminal
  5. open terminal preferences: Edit > Preferences
  6. on the appearance tab, use dropdown to select font
  7. while you have preferences open, on the advanced tab, change the default character encoding to utf-8 (unicode)

oh-my-zsh

macOS

Since macOS Catalina will be changing the default shell from bash to zsh, I've started working on tricking out my zsh setup. Of course I'm using oh my zsh, so head to their homepage for install instructions. Then:

  1. cp .zshrc ~/.zshrc
  2. cp agnoster.zsh-theme ~/.oh-my-zsh/themes/agnoster.zsh-theme

I spent a few hours trying to figure out why my agnoster symbols didn't match their README images... turns out the agnoster file shipped with the oh my zsh install is out of date. Mine is the latest (as of June 2019).

One other change I made in iTerm is under Preferences > Profiles > Colors: change Black to 20% Gray (you can choose this options when you click on the black square under "Normal") so it's not so starkly black behind the unicorn emoji.

On macOS, I had issues with the stupid ^M carriage returns in the zsh files and got a "parse error". See parse errors issue in the oh my zsh repo for the workaround.

linux

Getting powerline fonts and symbols set up for oh-my-zsh was a whole thing, and I finally figured out why: I had all my font config stuff "installed" in my /home/caryl (user) files but for zsh, they needed to be installed/configured in the ~ (root) files.

Oy. All of the above is still valid, it just needs to go in two places??

Can't really believe it's working, but it is! Here's the installation I followed:

256 colors

I've been struggling to get the xfce4-terminal to use 256 colors. This did the trick: [set $TERM to xterm-256color](https://bbs.archlinux.org/viewtopic.php?id=175581)

I had to create the application folder in the .local directory, but other than that, this worked! Now to figure out how to create a keyboard shortcut to launch this terminal instead of the default version.

Update (Jan 2019): Found a new way, and this legit works: add if statement to end of ~/.bashrc

if [ "$COLORTERM" == "xfce4-terminal" ] ; then
  export TERM=xterm-256color
fi

f#@%-ing ^M issues

DOS and UNIX files don't get along. I've had many issues in the past with the stupid LF vs CRLF line endings/carriage returns. Here's the official Github statement on it: Dealing with line endings.

I have two settings globally:

git config --global core.autocrlf input
git config --global core.safecrlf false

You can check these settings in any git-enabled directory with git config --list.

Most recently, these stupid ^M errors threw off my entire vim setup after I decided it was a good idea to update all my plugins. I'm basically obsessed with my vim settings, so this was not only a pain in the ass but kind of terrifying. What ended up fixing it was deleting the plugins that were causing the issue (they live in ~/.vim/bundle, use rm -Rf [name of plugin directory]) then re-installing the plugin via Vundle (vim +PluginInstall +qall).

docker

if docker is giving you the docker deamon connection error, try:

  • sudo service docker start # Ubuntu/Debian

About

so I won't be sad when I lose this later


Languages

Language:Shell 70.0%Language:Vim Script 30.0%