Giter VIP home page Giter VIP logo

dotfiles-2's Introduction

dotfiles

My setup for MacOSX and Linux, with a focus on terminal, editor, shell, programming environments etc.

Screenshot on MacOSX

Screenshot: MacOSX

Screenshot on Ubuntu

Screenshot: Ubuntu

Introduction

The goal of this project is to provide a single command which will setup key features of the system. Each feature should be orthogonal and not depend on other features.

The following is set up:

  • zsh as the default shell
  • tmux for terminal multiplexing, with my preferred theme and settings
  • vim as the default editor, with my preferred theme and settings
  • ~/.private as a folder excluded from version control, the contents of which are always loaded on shell startup (ideal for project specific secrets etc)
  • ~/.profile as a version controlled folder, the contents of which are always loaded on shell startup

Quick Start - Clean MacOSX Machine

On a completely clean Mac, run the following commands in a terminal.

# Install commandline tools (so that we have git).
xcode-select --install

# Create a working environment, in my standard format.
cd ~
mkdir -p repos/github/dwmkerr
cd repos/github/dwmkerr

# Clone the dotfiles - note that a new machine will not have my SSH key
# so this is over https.
git clone https://github.com/dwmkerr/dotfiles.git
cd dotfiles
./setup.sh

Manual Steps

There are a number of manual post-install steps:

  1. Restore GPG keys from a backup.
  2. Setup SSH keys for GitHub.
  3. Load the iTerm and Terminal 'One Dark' colour schemes from the terminal folder.
  4. Restore Parallels virtual machines from backup.
  5. Actually install tmux plugins, using <leader> Ctrl+I (otherwise things like tmux-yank won't work).
  6. Restore the ~/.private/ folder from a secure backup, to bring back project specific secrets.
  7. Restore the AWS CLI credentials to bring back project access.
  8. Setup SSH keys for GitHub.
  9. Load the iTerm and Terminal 'One Dark' colour schemes from the terminal folder.
  10. Restore Parallels virtual machines from backup.
  11. Configure ~/.gitconfig from ./git/gitconfig.
  12. Setup Vim NGINX syntax: https://arian.io/vim-syntax-highlighting-for-nginx/

Ubuntu Terminal Configuration

Set the OneDark Theme with:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/denysdovhan/gnome-terminal-one/master/one-dark.sh)"

iTerm 2 Configuration

I've not yet been able to script this configuration. Here are the settings which are non-default:

  • General: Selection - [X] Applications in terminal may access clipboard
  • General: Window - [ ] Native full screen windows
  • Profiles: Text - [X] Blinking cursor
  • Profiles: Text - Font: 16 pt Hack
  • Profiles: Window - Transparency: ~15%
  • Profiles: Window - Style: Fullscreen
  • Profiles: Terminal - [X] Silence bell
  • Profiles: Keys - Left ⌥ key 'Esc+'
  • Keys: HotKey - [X] Show/hide all windows with a system-wide hotkey (⌥ +Space)

Shell Commands

The following shell commands are setup:

Command Usage
serve Serve the current folder over HTTP on port 3000.
restart-shell Restart the current shell, reloading ~/.private, ~/.profile etc.

Cheat Sheet - TMux

Command Usage
Ctrl + h/j/k/l Navigate splits (vim aware)
move-window -r Re-order the tab numbers (useful if there are gaps).
<leader> / Ctrl+S Save Tmux Session
<leader> / Ctrl+R Restore Tmux Session
<leader> / Last split
<leader> h Move window left
<leader> l Move window right
<leader> { Swap pane left
<leader> } Swap pane right

Cheat Sheet - Vim

Here's a quick reference. My <Leader> is \, so I've written shortcuts as \x rather than <Leader>x for brevity. I still need to port the above to the structure below.

Command Usage
\[<Space> blank line above
]<Space> blank line below
sj Splitjoin down (i.e. split a line downwards).
sk Splitjoin up (i.e. join a line upwards).
<leader>r Open current file in NERDTree.
<leader>w Write buffer.
<leader>\\ Open buffer in new tab.
<leader>d Open word under cursor in Dash.
<leader>t Show current buffer in NERDTree.
:Tabularize /= Line up selection, using '='
gd where possible, will go to a local definition.
<leader>f Toggle focus mode.
Navigation
gx Open link or address under cursor.
Spelling
]s and [s Next/Previous spelling error.
z= and zg Check dictionary / add to dictionary.
Markdown Provided by vim-markdown
]] and [[ Next and previous headers.
gx Open link in standard editor.
Focus From vim-goyo and vim-limelight
:Goyo Enter focus mode.
:Limelight 0.8 and :Limelight! Go into limelight, 80% ultra focus, and toggle limelight.
let g:limelight_paragraph_span = 1 Span more paragraphs in limelight.
Markdown Tables
\tm Enter/Exit 'table mode', which will dynamically format markdown tables.
ci| Example of the motion for cells - i.e. 'change-in-cell'.

Note: including the vertical pipe | in the table above would cause rendering issues. So instead, the unicode character is used to illustrate the commands. Do not use the unicode character, use the normal ASCII 0x7C character.

Plugins

This is a new list, it'll take some time to bring others up to date.

Tooling Choices

Vim

Why Vim Plug over Vundle?

I was impressed enough with the comments on this post to make the switch, particularly as coc doesn't support Vundle, meaning I had to give Plug a try.

TODO

  • Autocomplete for docker/k8s is still not properly setup.

dotfiles-2's People

Contributors

dwmkerr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.