Skip to content

Commit

Permalink
1st
Browse files Browse the repository at this point in the history
  • Loading branch information
randrini committed Mar 8, 2017
0 parents commit 4925fe5
Show file tree
Hide file tree
Showing 50 changed files with 2,380 additions and 0 deletions.
30 changes: 30 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

#Essential packages
#sudo pacman -Syyu
sudo pacman --needed --noconfirm -S zsh tmux the_silver_searcher terminator neovim python-pip python-setuptools ttf-hack

#Fonts
yaourt --needed --noconfirm -S fira-code-git

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

# Install Neovim for python
sudo pip3 install neovim

#Set ZSH as default shell
sudo chsh -s $(which zsh)

#Set configs
rm -rf ~/.vim ~/.vimrc ~/.zshrc ~/.tmux ~/.tmux.conf ~/.config/nvim 2> /dev/null

mkdir -p ~/.config ~/.config/nvim

# Sym link dots
ln -s ~/dotfiles/zshrc ~/.zshrc
ln -s ~/dotfiles/tmux.conf ~/.tmux.conf
ln -s ~/dotfiles/vimrc ~/.config/nvim/init.vim

#----------------------- END OF Preconfig ----------------------------
50 changes: 50 additions & 0 deletions tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Change default prefix C-b to C-a
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

# Shell?
set -g default-shell $SHELL

# Reload config
bind r source-file ~/.tmux.conf
# Configure tabs
# Start with window 1 and pane 1
set -g base-index 1
set -g pane-base-index 1
# Status bar position
set -g status-position top
# Auto renumber
set -g renumber-windows on

# Window
bind-key -n C-t new-window
bind-key -n C-T new-window -c "#{pane_current_path}"
bind-key -n C-w kill-pane

# Create panes
bind \ split-window -h
bind | split-window -h -c '#{pane_current_path}'
bind - split-window
bind _ split-window -c '#{pane_current_path}'

# (N)vim like
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+

# PLUGINS GO HERE
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'jimeh/tmux-themepack'

# Theme
set -g @themepack 'block/yellow'

# THIS MUST BE AT THE END
run '~/dotfiles/tpm/tpm'
9 changes: 9 additions & 0 deletions tpm/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Force text files to have unix eols, so Windows/Cygwin does not break them
*.* eol=lf

# These files are unfortunately not recognized as text files so
# explicitly listing them here
tpm eol=lf
bin/* eol=lf
bindings/* eol=lf
tests/* eol=lf
4 changes: 4 additions & 0 deletions tpm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/.vagrant/
run_tests
tests/run_tests_in_isolation
tests/helpers/helpers.sh
3 changes: 3 additions & 0 deletions tpm/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/tmux-test"]
path = lib/tmux-test
url = https://github.com/tmux-plugins/tmux-test.git
19 changes: 19 additions & 0 deletions tpm/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# generic packages and tmux
before_install:
- sudo apt-get update
- sudo apt-get install -y git-core expect
- sudo apt-get install -y python-software-properties software-properties-common
- sudo apt-get install -y libevent-dev libncurses-dev
- git clone https://github.com/tmux/tmux.git
- cd tmux
- git checkout 2.0
- sh autogen.sh
- ./configure && make && sudo make install

install:
- git fetch --unshallow --recurse-submodules || git fetch --recurse-submodules
# manual `git clone` required for testing `tmux-test` plugin itself
- git clone https://github.com/tmux-plugins/tmux-test lib/tmux-test; true
- lib/tmux-test/setup

script: ./tests/run_tests_in_isolation
83 changes: 83 additions & 0 deletions tpm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Changelog

### master
- upgrade to new version of `tmux-test`
- bug: when using `emacs` copy mode, Enter does not quit screen after tpm
installation/update. Fix by making `Escape` the key for emacs mode.
- add a doc with troubleshooting instructions
- add `.gitattributes` file that forces linefeed characters (classic `\n`) as
line endings - helps with misconfigured git on windows/cygwin
- readme update: announce Cygwin support
- un-deprecate old plugin definition syntax: `set -g @tpm_plugins`

### v3.0.0, 2015-08-03
- refactor `shared_set_tpm_path_constant` function
- move all instructions to `docs/` dir
- add `bin/install_plugins` cli executable script
- improved test runner function
- switch to using [tmux-test](https://github.com/tmux-plugins/tmux-test)
framework
- add `bin/update_plugins` cli executable script
- refactor test `expect` scripts, make them simpler and ensure they properly
assert expectations
- refactor code that sets 'TMUX_PLUGIN_MANAGER_PATH' global env var
- stop using global variable for 'tpm path'
- support defining plugins via `set -g @plugin` in sourced files as well

### v2.0.0, 2015-07-07
- enable overriding default key bindings
- start using `C-c` to clear screen
- add uninstall/clean procedure and keybinding (prefix+alt+u) (@chilicuil)
- add new `set @plugin 'repo'` plugin defintion syntax (@chilicuil)
- revert back to using `-g` flag in new plugin definition syntax
- permit leading whitespace with new plugin definition syntax (thanks @chilicuil)
- make sure `TMUX_PLUGIN_MANAGER_PATH` always has trailng slash
- ensure old/deprecated plugin syntax `set -g @tpm_plugins` works alongside new
`set -g @plugin` syntax

### v1.2.2, 2015-02-08
- set GIT_TERMINAL_PROMPT=0 when doing `git clone`, `pull` or `submodule update`
to ensure git does not prompt for username/password in any case

### v1.2.1, 2014-11-21
- change the way plugin name is expanded. It now uses the http username
and password by default, like this: `https://git::@github.com/`. This prevents
username and password prompt (and subsequently tmux install hanging) with old
git versions. Fixes #7.

### v1.2.0, 2014-11-20
- refactor tests so they can be used on travis
- add travis.yml, add travis badge to the readme

### v1.1.0, 2014-11-19
- if the plugin is not downloaded do not source it
- remove `PLUGINS.md`, an obsolete list of plugins
- update readme with instructions about uninstalling plugins
- tilde char and `$HOME` in `TMUX_SHARED_MANAGER_PATH` couldn't be used because
they are just plain strings. Fixing the problem by manually expanding them.
- bugfix: fragile `*.tmux` file globbing (@majutsushi)

### v1.0.0, 2014-08-05
- update readme because of github organization change to
[tmux-plugins](https://github.com/tmux-plugins)
- update tests to pass
- update README to suggest different first plugin
- update list of plugins in the README
- remove README 'about' section
- move key binding to the main file. Delete `key_binding.sh`.
- rename `display_message` -> `echo_message`
- installing plugins installs just new plugins. Already installed plugins aren't
updated.
- add 'update plugin' binding and functionality
- add test for updating a plugin

### v0.0.2, 2014-07-17
- run all *.tmux plugin files as executables
- fix all redirects to /dev/null
- fix bug: TPM shared path is created before sync (cloning plugins from github
is done)
- add test suite running in Vagrant
- add Tmux version check. `TPM` won't run if Tmux version is less than 1.9.

### v0.0.1, 2014-05-21
- get TPM up and running
2 changes: 2 additions & 0 deletions tpm/HOW_TO_PLUGIN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Instructions moved to
[docs/how_to_create_plugin.md](docs/how_to_create_plugin.md).
20 changes: 20 additions & 0 deletions tpm/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MIT license
Copyright (C) 2014 Bruno Sutic

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
107 changes: 107 additions & 0 deletions tpm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Tmux Plugin Manager

[![Build Status](https://travis-ci.org/tmux-plugins/tpm.png?branch=master)](https://travis-ci.org/tmux-plugins/tpm)

Installs and loads TMUX plugins.

Tested and working on Linux, OSX, and Cygwin.

### Installation

Requirements: `tmux` version 1.9 (or higher), `git`, `bash`.

Clone TPM:

$ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

Put this at the bottom of `.tmux.conf`:

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

Reload TMUX environment so TPM is sourced:

# type this in terminal if tmux is already running
$ tmux source ~/.tmux.conf

That's it!

### Installing plugins

1. Add new plugin to `~/.tmux.conf` with `set -g @plugin '...'`
2. Press `prefix + I` (capital I, as in **I**nstall) to fetch the plugin.

You're good to go! The plugin was cloned to `~/.tmux/plugins/` dir and sourced.

### Uninstalling plugins

1. Remove (or comment out) plugin from the list.
2. Press `prefix + alt + u` (lowercase u as in **u**ninstall) to remove the plugin.

All the plugins are installed to `~/.tmux/plugins/` so alternatively you can
find plugin directory there and remove it.

### Key bindings

`prefix + I`
- Installs new plugins from GitHub or any other git repository
- Refreshes TMUX environment

`prefix + U`
- updates plugin(s)

`prefix + alt + u`
- remove/uninstall plugins not on the plugin list

### More plugins

For more plugins, check [here](https://github.com/tmux-plugins).

### Docs

- [Help, tpm not working](docs/tpm_not_working.md) - problem solutions

More advanced features and instructions, regular users probably do not need
this:

- [How to create a plugin](docs/how_to_create_plugin.md). It's easy.
- [Managing plugins via the command line](docs/managing_plugins_via_cmd_line.md)
- [Changing plugins install dir](docs/changing_plugins_install_dir.md)
- [Automatic TPM installation on a new machine](docs/automatic_tpm_installation.md)

### Tests

Tests for this project run on [travis](https://travis-ci.org/tmux-plugins/tpm).

When run locally, [vagrant](https://www.vagrantup.com/) is required.
Run tests with:

# within project directory
$ ./run_tests

### Other goodies

- [tmux-copycat](https://github.com/tmux-plugins/tmux-copycat) - a plugin for
regex searches in tmux and fast match selection
- [tmux-yank](https://github.com/tmux-plugins/tmux-yank) - enables copying
highlighted text to system clipboard
- [tmux-open](https://github.com/tmux-plugins/tmux-open) - a plugin for quickly
opening highlighted file or a url
- [tmux-continuum](https://github.com/tmux-plugins/tmux-continuum) - automatic
restoring and continuous saving of tmux env

You might want to follow [@brunosutic](https://twitter.com/brunosutic) on
twitter if you want to hear about new tmux plugins or feature updates.

### License

[MIT](LICENSE.md)
14 changes: 14 additions & 0 deletions tpm/bin/clean_plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# Script intended for use via the command line.
#
# `.tmux.conf` needs to be set for TPM. Tmux has to be installed on the system,
# but does not need to be started in order to run this script.

CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR="$CURRENT_DIR/../scripts"

main() {
"$SCRIPTS_DIR/clean_plugins.sh" # has correct exit code
}
main
14 changes: 14 additions & 0 deletions tpm/bin/install_plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# Script intended for use via the command line.
#
# `.tmux.conf` needs to be set for TPM. Tmux has to be installed on the system,
# but does not need to be started in order to run this script.

CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR="$CURRENT_DIR/../scripts"

main() {
"$SCRIPTS_DIR/install_plugins.sh" # has correct exit code
}
main
24 changes: 24 additions & 0 deletions tpm/bin/update_plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

# Script intended for use via the command line.
#
# `.tmux.conf` needs to be set for TPM. Tmux has to be installed on the system,
# but does not need to be started in order to run this script.

CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR="$CURRENT_DIR/../scripts"
PROGRAM_NAME="$0"

if [ $# -eq 0 ]; then
echo "usage:"
echo " $PROGRAM_NAME all update all plugins"
echo " $PROGRAM_NAME tmux-foo update plugin 'tmux-foo'"
echo " $PROGRAM_NAME tmux-bar tmux-baz update multiple plugins"
exit 1
fi

main() {
"$SCRIPTS_DIR/update_plugin.sh" --shell-echo "$*" # has correct exit code
}
main "$*"

Loading

0 comments on commit 4925fe5

Please sign in to comment.