aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bashrc32
-rw-r--r--.gdbinit1
-rw-r--r--.ghci1
-rw-r--r--.gitconfig8
-rw-r--r--.pluggins.vim4
-rw-r--r--.vimrc21
-rw-r--r--.zshrc14
-rw-r--r--Makefile31
8 files changed, 73 insertions, 39 deletions
diff --git a/.bashrc b/.bashrc
index f895cc5..9f2f3d0 100644
--- a/.bashrc
+++ b/.bashrc
@@ -1,13 +1,3 @@
-# ~/.bashrc: executed by bash(1) for non-login shells.
-# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
-# for examples
-
-# If not running interactively, don't do anything
-case $- in
- *i*) ;;
- *) return;;
-esac
-
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
@@ -23,13 +13,6 @@ HISTFILESIZE=2000
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
-# If set, the pattern "**" used in a pathname expansion context will
-# match all files and zero or more directories and subdirectories.
-#shopt -s globstar
-
-# make less more friendly for non-text input files, see lesspipe(1)
-#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
-
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
@@ -40,11 +23,6 @@ case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
-# uncomment for a colored prompt, if the terminal has the capability; turned
-# off by default to not distract the user: the focus in a terminal window
-# should be on the output of commands, not on the prompt
-#force_color_prompt=yes
-
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
@@ -84,18 +62,8 @@ if [ -x /usr/bin/dircolors ]; then
alias egrep='egrep --color=auto'
fi
-# colored GCC warnings and errors
-#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
-
-# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
-#alias l='ls -CF'
-
-# Alias definitions.
-# You may want to put all your additions into a separate file like
-# ~/.bash_aliases, instead of adding them here directly.
-# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
diff --git a/.gdbinit b/.gdbinit
new file mode 100644
index 0000000..9422460
--- /dev/null
+++ b/.gdbinit
@@ -0,0 +1 @@
+set disassembly-flavor intel
diff --git a/.ghci b/.ghci
new file mode 100644
index 0000000..ec73138
--- /dev/null
+++ b/.ghci
@@ -0,0 +1 @@
+:set prompt λ>
diff --git a/.gitconfig b/.gitconfig
new file mode 100644
index 0000000..577206f
--- /dev/null
+++ b/.gitconfig
@@ -0,0 +1,8 @@
+[user]
+ name = Charles
+ email = sircharlesaze@gmail.com
+[credential]
+ helper = cache
+ username = HappyTramp
+[log]
+ decorate = full
diff --git a/.pluggins.vim b/.pluggins.vim
index 518a631..6e2f7a2 100644
--- a/.pluggins.vim
+++ b/.pluggins.vim
@@ -18,6 +18,7 @@ call plug#begin()
Plug 'vim-scripts/awk.vim'
Plug 'sheerun/vim-polyglot' " better syntax highlighting
Plug 'neovimhaskell/haskell-vim' " vim haskell highlighting
+ Plug 'haya14busa/incsearch.vim' " better incsearch
" themes
@@ -32,7 +33,8 @@ call plug#begin()
Plug 'connorholyday/vim-snazzy'
Plug 'chriskempson/base16-vim'
- Plug 'tpope/vim-commentary' " minimalistic commenter
+ Plug 'tomtom/tcomment_vim' " other min commenter
+ " Plug 'tpope/vim-commentary' " minimalistic commenter
Plug 'tpope/vim-surround' " surround stuff
Plug 'tpope/vim-eunuch' " command in vim
diff --git a/.vimrc b/.vimrc
index 91a1c5d..9d7a85e 100644
--- a/.vimrc
+++ b/.vimrc
@@ -11,13 +11,12 @@ let mapleader = ' '
syntax enable
set hidden
set noswapfile
-filetype plugin on " add specific rules for certain file type
-filetype plugin indent on
+set nocompatible
+filetype plugin indent on " add specific rules for certain file type
set number relativenumber
" browse list with tab
set wildmode=longest,list,full
set wildmenu
-set nocompatible
set path+=** " for recursive :find
" more intuitif split opening
set splitbelow
@@ -52,6 +51,9 @@ set scrolloff=2 " 2 line above scroll
set showcmd
set cursorline " highlight current line
set noshowmode " unnecessary with status bar"
+
+set autoread " reload files when changes happen outside vim
+
" where to place the .swp files
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,~/var/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,~/var/tmp
@@ -119,3 +121,16 @@ imap jj <ESC>
" remove visual mode keybinding
map Q <ESC>
+
+" c source and header files comment formats for vim-commentary
+" autocmd Filetype c setlocal commentstring=// %s
+" autocmd Filetype h setlocal commentstring=// %s
+
+set encoding=utf-8
+
+set textwidth=89 " when line wrap occurs
+
+" incsearch mapping
+map / <Plug>(incsearch-forward)
+map ? <Plug>(incsearch-backward)
+map g/ <Plug>(incsearch-stay)
diff --git a/.zshrc b/.zshrc
index 26fdd5d..54925c4 100644
--- a/.zshrc
+++ b/.zshrc
@@ -5,15 +5,16 @@ HYPHEN_INSENSITIVE="true"
DISABLE_MAGIC_FUNCTIONS=true
HIST_STAMPS="dd/mm/yyyy"
-plugins=(colorize command-not-found git)
+plugins=(colorize command-not-found git zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
-export KEYTIMEOUT=1
bindkey -v
+export KEYTIMEOUT=1
setopt auto_cd
setopt pushd_ignore_dups
setopt list_rows_first
+setopt extendedglob
# alias expansion
bindkey "^ " _expand_alias # ctrl+space to expand
@@ -27,6 +28,7 @@ bindkey -M isearch " " magic-space
alias -g G='| grep'
alias -g L='| less'
alias -g LO='192.168.0.'
+alias -g HUB="https://github.com/HappyTramp/"
alias rr='rm -r'
alias ll="ls -lFh"
alias la="ls -a"
@@ -47,6 +49,7 @@ alias info="info --vi-keys"
alias moula="gcc -Wall -Wextra -Werror"
alias list-c-includes-paths="echo | gcc -E -Wp,-v -"
alias yoump3='youtube-dl --extract-audio --audio-format mp3'
+alias adg="sudo apt update && sudo apt upgrade"
function chpwd() {
file_count=$(ls | wc -w)
@@ -63,6 +66,13 @@ alias vimrc="vim $DOTFILES/.vimrc"
alias vimplugrc="vim $DOTFILES/.vimrc -c 'vsp $DOTFILES/.pluggins.vim'"
alias tmuxrc="vim $DOTFILES/.tmux.conf && tmux source-file $DOTFILES/.tmux.conf"
+# vim keys in tab completion menu (https://www.youtube.com/watch?v=eLEo4OQ-cuQ)
+bindkey -M menuselect 'h' vi-backward-char
+bindkey -M menuselect 'k' vi-up-line-or-history
+bindkey -M menuselect 'l' vi-forward-char
+bindkey -M menuselect 'j' vi-down-line-or-history
+bindkey -v '^?' backward-delete-char
+
# add command-not-found package suggestion
source /etc/zsh_command_not_found
diff --git a/Makefile b/Makefile
index 1550bc4..6a759c0 100644
--- a/Makefile
+++ b/Makefile
@@ -5,8 +5,12 @@ TMUXCONF = .tmux.conf
BASHRC = .bashrc
BASHALIAS = .bash_aliases
PROFILE = .profile
+GHCI = .ghci
+GDB = .gdbinit
+GITCONFIG = .gitconfig
CONFFILES = $(HOME)/$(ZSHRC) $(HOME)/$(VIMRC) $(HOME)/$(TMUXCONF) $(HOME)/$(BASHRC) \
- $(HOME)/$(BASHALIAS) $(HOME)/$(PROFILE)
+ $(HOME)/$(BASHALIAS) $(HOME)/$(PROFILE) $(HOME)/$(GHCI) $(HOME)/$(GDB) \
+ $(HOME)/$(GITCONFIG)
.PHONY: all
all: $(CONFFILES)
@@ -35,9 +39,34 @@ $(HOME)/$(PROFILE): $(DOTDIR)/$(PROFILE)
touch $@
echo "source $<" > $@
+$(HOME)/$(GHCI): $(DOTDIR)/$(GHCI)
+ touch $@
+ cat $< > $@
+
+$(HOME)/$(GDB): $(DOTDIR)/$(GDB)
+ touch $@
+ cat $< > $@
+
+$(HOME)/$(GITCONFIG): $(DOTDIR)/$(GITCONFIG)
+ touch $@
+ cat $< >> $@
+
.PHONY: clean
clean:
rm -f $(CONFFILES)
.PHONY: re
re: clean all
+
+# .PHONY: dependencies
+# dependencies:
+# @echo "Installing vim-plug (plugin manager)"
+# curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
+# https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
+# @echo "Installing vim plugins"
+# vim -c "PlugInstall" -c "qa"
+# @echo "Installing oh-my-zsh"
+ # sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
+ # @echo "Installing zsh-syntax-highlighting"
+ # git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
+ # ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting