From 900c97b3fa7592a9cc4b018c2883dbdac0caba09 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 30 Aug 2019 18:50:32 +0200 Subject: changed vim commenter due to weird behavior in c files, github alias, various little change in vimrc --- .pluggins.vim | 3 ++- .vimrc | 16 +++++++++++++--- .zshrc | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.pluggins.vim b/.pluggins.vim index 518a631..2a36b18 100644 --- a/.pluggins.vim +++ b/.pluggins.vim @@ -32,7 +32,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 ffb7194..cc68548 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,11 @@ imap jj " remove visual mode keybinding map Q + +" 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 diff --git a/.zshrc b/.zshrc index 26fdd5d..ab2a7b9 100644 --- a/.zshrc +++ b/.zshrc @@ -27,6 +27,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" -- cgit From 35651b9d0ef722ec5ab63aa96bd03b3eede92d51 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 3 Sep 2019 13:05:45 +0200 Subject: vim better incsearch with pluggin, zsh extended glob --- .pluggins.vim | 1 + .vimrc | 5 +++++ .zshrc | 1 + 3 files changed, 7 insertions(+) diff --git a/.pluggins.vim b/.pluggins.vim index 2a36b18..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 diff --git a/.vimrc b/.vimrc index cc68548..d6261af 100644 --- a/.vimrc +++ b/.vimrc @@ -129,3 +129,8 @@ map Q set encoding=utf-8 set textwidth=89 " when line wrap occurs + +" incsearch mapping +map / (incsearch-forward) +map ? (incsearch-backward) +map g/ (incsearch-stay) diff --git a/.zshrc b/.zshrc index ab2a7b9..ffe90cc 100644 --- a/.zshrc +++ b/.zshrc @@ -14,6 +14,7 @@ bindkey -v setopt auto_cd setopt pushd_ignore_dups setopt list_rows_first +set extendedglob # alias expansion bindkey "^ " _expand_alias # ctrl+space to expand -- cgit From c02b5d1c427b4a203eef65e2f05d1e3faa066fbb Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 6 Sep 2019 15:09:46 +0200 Subject: added ghci and gdb config files --- .gdbinit | 1 + .ghci | 1 + .zshrc | 2 +- Makefile | 12 +++++++++++- 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .gdbinit create mode 100644 .ghci 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/.zshrc b/.zshrc index ffe90cc..a102960 100644 --- a/.zshrc +++ b/.zshrc @@ -14,7 +14,7 @@ bindkey -v setopt auto_cd setopt pushd_ignore_dups setopt list_rows_first -set extendedglob +setopt extendedglob # alias expansion bindkey "^ " _expand_alias # ctrl+space to expand diff --git a/Makefile b/Makefile index 1550bc4..2dfe73d 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,10 @@ TMUXCONF = .tmux.conf BASHRC = .bashrc BASHALIAS = .bash_aliases PROFILE = .profile +GHCI = .ghci +GDB = .gdbinit CONFFILES = $(HOME)/$(ZSHRC) $(HOME)/$(VIMRC) $(HOME)/$(TMUXCONF) $(HOME)/$(BASHRC) \ - $(HOME)/$(BASHALIAS) $(HOME)/$(PROFILE) + $(HOME)/$(BASHALIAS) $(HOME)/$(PROFILE) $(HOME)/$(GHCI) $(HOME)/$(GDB) .PHONY: all all: $(CONFFILES) @@ -35,6 +37,14 @@ $(HOME)/$(PROFILE): $(DOTDIR)/$(PROFILE) touch $@ echo "source $<" > $@ +$(HOME)/$(GHCI): $(DOTDIR)/$(GHCI) + touch $@ + cat $< > $@ + +$(HOME)/$(GDB): $(DOTDIR)/$(GDB) + touch $@ + cat $< > $@ + .PHONY: clean clean: rm -f $(CONFFILES) -- cgit From 4df35c81432f4ec94f63b0c86de58aec4259006a Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 21 Sep 2019 21:37:30 +0200 Subject: Dependencies install, zsh syntax highlight - dependencies Makefile rule to install vim-plug, vim pluggins, oh-my-zsh, zsh-syntax-highlighting. - vim keys to move in tab menu completion - shorter bashrc --- .bashrc | 32 -------------------------------- .zshrc | 12 ++++++++++-- Makefile | 13 +++++++++++++ 3 files changed, 23 insertions(+), 34 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/.zshrc b/.zshrc index a102960..54925c4 100644 --- a/.zshrc +++ b/.zshrc @@ -5,11 +5,11 @@ 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 @@ -49,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) @@ -65,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 2dfe73d..5d218e3 100644 --- a/Makefile +++ b/Makefile @@ -51,3 +51,16 @@ clean: .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 -- cgit From 466c8a6b31a98a461b250743718084d79f67f640 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 9 Oct 2019 19:39:45 +0200 Subject: Added git config --- .gitconfig | 8 ++++++++ Makefile | 32 +++++++++++++++++++------------- 2 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 .gitconfig 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/Makefile b/Makefile index 5d218e3..6a759c0 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,10 @@ 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)/$(GHCI) $(HOME)/$(GDB) + $(HOME)/$(BASHALIAS) $(HOME)/$(PROFILE) $(HOME)/$(GHCI) $(HOME)/$(GDB) \ + $(HOME)/$(GITCONFIG) .PHONY: all all: $(CONFFILES) @@ -45,6 +47,10 @@ $(HOME)/$(GDB): $(DOTDIR)/$(GDB) touch $@ cat $< > $@ +$(HOME)/$(GITCONFIG): $(DOTDIR)/$(GITCONFIG) + touch $@ + cat $< >> $@ + .PHONY: clean clean: rm -f $(CONFFILES) @@ -52,15 +58,15 @@ clean: .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 +# .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 -- cgit