Skip to content

WalterRan/Jide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

146 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Key mapping

Remap Caps-Lock key to Ctrl.

CentOS

setxkbmap -option ctrl:nocaps

Windows

  • Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout
  • Create new entry with type Binary value named: Scancode Map
  • Fill these into it
00,00,00,00,00,00,00,00,
02,00,00,00,1d,00,3a,00,
00,00,00,00
  • Restart computer

Emacs

Tips

In Emacs 29+, set the user-emacs-directory with the flag –init-directory.

When working under Windows OS, Maple Mono NF CN will be used as the default font if avalible, which can be get from here. Segoe UI Symbol is for all unicode characters and it is installed as default.

When working under Linux system, JetBrains Mono will be the default font.

Shortcuts

NameKeybindingDescription
er/expand-regionC-=Increase selected region by semantic units
org-ctrl-c-ctrl-cC-c C-cSet tags in headline, or update according to changed information at point.
org-insert-linkC-c C-lInsert a link
org-insert-structure-templateC-c C-,Insert a block structure of the type #+begin_foo/#+end_foo.
org-metadownM-<down>Move subtree down or move table row down.
org-metaleftM-<left>Promote heading, list item at point or move table column left.
org-metarightM-<right>Demote heading, list item at point or move table column right.
org-metaupM-<up>Move subtree up or move table row up.
org-toggle-inline-imagesC-c C-x C-vToggle the display of inline images.
pop-global-markC-x C-@Pop off global mark ring and jump to the top location.
recenter-top-bottomC-lScroll the window so that current line is in the middle of the window.

Export to html with readtheorg format

  • Create directory readtheorg in org repo
  • Download these files from org-html-themes
    src/lib/js/bootstrap.min.js
    src/lib/js/jquery.min.js
    src/lib/js/jquery.stickytableheaders.min.js
    src/readtheorg_theme/css/htmlize.css
    src/readtheorg_theme/css/readtheorg.css
    src/readtheorg_theme/js/readtheorg.js
        
  • Add these to the org file that want to export
    #+OPTIONS: num:nil \n:t
    #+OPTIONS: html-style:nil
    #+HTML_HEAD: <link rel="stylesheet" type="text/css" href=".\readtheorg\htmlize.css"/>
    #+HTML_HEAD: <link rel="stylesheet" type="text/css" href=".\readtheorg\readtheorg.css"/>
    #+HTML_HEAD: <script type="text/javascript" src=".\readtheorg\jquery.min.js"></script>
    #+HTML_HEAD: <script type="text/javascript" src=".\readtheorg\bootstrap.min.js"></script>
    #+HTML_HEAD: <script type="text/javascript" src=".\readtheorg\jquery.stickytableheaders.min.js"></script>
    #+HTML_HEAD: <script type="text/javascript" src=".\readtheorg\readtheorg.js"></script>
        

Emacs doom-modeline

This package requires the fonts included with all-the-icons to be installed. Run M-x all-the-icons-install-fonts to do so.

Emacs starting daemon with systemd

Copy emacs/emacs.service to /usr/lib/systemd/system/emacs.service

Refrence

VIM

ZSH

Tmux

Additional Configurations

Write these config into ~/.tmux.conf to

set -g display-panes-time 5000

bind -n M-Left select-pan -L
bind -n M-Right select-pan -R
bind -n M-Up select-pan -U
bind -n M-Down select-pan -D

Tmux Plugin Manager

TPM (Tmux Plugin Manager)是tmux的插件管理工具 https://github.com/tmux-plugins/tpm

work_work

This is a regular layout configuration, I call it work_work

PWD=`pwd`
SESSION_NAME=`basename $PWD | sed 's/\./\_/g'`
tmux has-session -t=$SESSION_NAME 2>/dev/null

if [ $? != 0 ]; then
    tmux -2 new-session -s $SESSION_NAME \; \
         send-keys '<command>' C-m \; \
         split-window -v -p 90\; \
         send-keys '$ZSH_VERSION && zsh' C-m \; \
         send-keys '<command>' C-m \; \
         split-window -v \; \
         split-window -h \; \
         send-keys '<command>' C-m \; \
         split-window -v\; \
         select-pane -t 1
else
    tmux -2 a -t $SESSION_NAME
fi

Manual install

yum install libevent ncurses libevent-devel ncurses-devel gcc make bison pkg-config automake -y
git clone https://github.com/tmux/tmux.git
cd tmux && sh autogen.sh
./configure &&  make && make install

Node-tmux theme

# REF: https://www.nordtheme.com/docs/ports/tmux/installation
yum install tmux -y
mkdir -p ~/.tmux/themes/
git clone https://github.com/arcticicestudio/nord-tmux.git ~/.tmux/themes/nord.tmux
echo "run-shell \"~/.tmux/themes/nord-tmux/nord.tmux\"" > ~/.tmux.conf
tmux source-file ~/.tmux.conf

Another configuration from Zhihu

https://zhuanlan.zhihu.com/p/58668651

curl -fsSL “https://raw.githubusercontent.com/peterzililuo/tmuxconfig/master/install.sh” | /bin/sh

Gdb

Gdb dashboard

https://github.com/cyrus-and/gdb-dashboard

https://github.com/cyrus-and/gdb-dashboard/wiki/Support-older-GDB-versions

GDB dashboard requires at least GDB 7.7 compiled with Python 2.7 in order to work properly.
If it is really impossible to use an up-to-date version, the following script will patch the dashboard and add the missing pieces (some features may suffer from this):

mkdir -p ~/.gdbinit.d/
wget 'https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=gdb/python/lib/gdb/FrameDecorator.py;hb=4bd8fc3a1362970d9800a263987af8093798338b' -O ~/.gdbinit.d/FrameDecorator.py
sed -i '1s/^/python gdb.COMPLETE_EXPRESSION = gdb.COMPLETE_SYMBOL\n/' .gdbinit
sed -i "s/gdb_breakpoint.temporary/None/g" .gdbinit
cat >>~/.gdbinit <<EOF
python
import imp
gdb.FrameDecorator = imp.new_module('FrameDecorator')
gdb.FrameDecorator.FrameDecorator = FrameDecorator
end
EOF

Git

Check trailing whitespaces when committing

Save this script as .git/hooks/pre-commit

#!/bin/bash

# Get `Git commit` file list
git diff --cached --name-only --diff-filter=ACM | while read file; do
    if [ -f "$file" ]; then
        file_type=$(file -b "$file")
        if echo "$file_type" | grep -q "text"; then
            has_trailing_whitespace=$(grep -n -E '[[:space:]]+$' "$file")
            # Exit and print line if there's trailing whitespace
            if [ -n "$has_trailing_whitespace" ]; then
                echo "Warning: $file has lines with trailing whitespace."
                echo $has_trailing_whitespace
                exit 1
            fi
        else
            continue
        fi
    fi
done

Ps. Although there are some defects, it can be used for the time being without any major issues. I tried to add it to the project using the ‘-f’ option in ‘git add’ but it didn’t succeed. However, manually adding it to the project seems to be fine as well. And it has only been tested in Git Bash on Windows.

About

Jide

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors