Skip to content

beamiter/vimrc

Repository files navigation

My Vim & Emacs Configs

Vimrc README -*- mode: org -*-

Install vim to support python2/3

Install vim-gtk or vim-gnome first to support compiling with gui.

sudo apt-get build-dep vim-gnome

./configure --with-features=huge \
            --enable-multibyte \
            --enable-gui=auto \
            --with-x \
            --enable-rubyinterp=yes \
            --enable-python3interp=yes \
            --enable-perlinterp=yes \
            --enable-fontset \
            --enable-cscope \
            --enable-gtk2-check \
            --enable-gnome-check \
            --prefix=/usr \
            --enable-luainterp=yes \
            --enable-fail-if-missing \

or

./configure --with-features=huge \
            --enable-multibyte \
            --enable-gui=auto \
            --with-x \
            --enable-python3interp=yes \
            --enable-fontset \
            --enable-cscope \
            --enable-gtk2-check \
            --enable-gnome-check \
            --prefix=/usr \
            --enable-luainterp=yes \
            --enable-fail-if-missing \

make

sudo make install
#with-python3-config-dir is deprecated
            #--with-python3-config-dir=/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu \

Install python related package

pip3 install --user flake8 autoflake isort coverage yapf autopep8 pylint
conda install flake8 autoflake isort coverage yapf autopep8 pylint
pip3 install python-language-server

Install rust lsp

Install rust-analyzer from github release.

rustup component add rls rust-analysis rust-src

Some helpful tips

  1. Install bat to support highlight color in fzf preview.
  2. Install latest clangd version to have better experience.
  3. Popular wm: i3, herbstluft, awesome, spectrwm, bspwm, qtile, xmonad, leftwm.
  4. Helpful toolkits: dmenu, feh, scrot, flameshot, shutter.
  5. Set git proxy:
    git clone -c http.proxy=http://127.0.0.1:7890
        
  6. Set terminal proxy:
    export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
        
  7. Setup bspwm:
    cp /usr/share/doc/oc/bspwm/examples/bspwmrc $HOME/.config/bspwm/
    cp /usr/share/doc/bspwm/examples/sxhkdrc $HOME/.config/sxhkd/
    
    #Edit $HOME/.xsessionrc
    sxhkd &
    exec bspwm
        
  8. Fix issues:
    #icecc - icecream seems to have invoked itself recursively
    export PATH=/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    export CCACHE_PREFIX=icecc
        
  9. Plantuml is great, emacs org-mode is great.
  10. VPN address: https://gsou.buzz/ and so on.
  11. config coc clangd semanticHighlighting.
{
    "clangd.semanticHighlighting": true
}
  1. Volumn control in terminal: alsamixer
  2. Add dwm.desktop in /usr/share/xsessions/dwm.desktop
    i.e. dwm.desktop
    [Desktop Entry]
    Encoding=UTF-8
    Name=Dwm
    Comment=Dynamic window manager
    Exec=dwm
    Icon=dwm
    Type=XSession
        

More tips

  1. use xrandr to swap monitor position
    xrandr --output eDP-1 --right-of HDMI-1
    xrandr --auto && xrandr --output eDP-1 --off
    xrandr --output HDMI-1 --rotate normal --left-of eDP-1 --auto &
        
  2. bluetooth tools: blueman/blueman-manager in ubuntu
  3. xrandr monitor setting
    xrandr --output HDMI-1 --primary --mode 1920x1080 --rotate normal --output eDP-1 --mode 1920x1080 --pos 1920x0 --rotate normal
    hc set_monitors 1920x1080+0+0 1920x1080+1920+0
    xsetroot -cursor_name left_ptr
        

    god use arandr (another xrandr gui)

  4. set 256 color
    export TERM=xterm-256color
        
  5. sudo cp etc/nixos/configuration.nix ~/vimrc/dotfiles/nixos
  6. old julia lsp set
    julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")'
        
  7. npm: mkdir ~/.npm-global, npm config set prefix ‘~/.npm-global’, export PATH=~/.npm-global/bin:$PATH
  8. pip3 install -U pip
    pip3 install -U setuptools
    pip3 install --no-cache-dir cairocffi
        
  9. run appimage in docker:
    ~/.local/bin/nvim.appimage --appimage-extract-and-run
    alias nvim="~/.local/bin/nvim.appimage --appimage-extract-and-run"
        
  10. julia install:
    sudo ln -s /opt/julia-1.6.6/bin/julia /usr/local/bin/julia
        
  11. jill for julia version management
  12. bob for neovim version management:
    cargo install bob-nvim
        
  13. git config --global user.name "beamiter"
    git config --global user.email "beamiter@163.com"
    git config --global credential.helper store
    
    cmake -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_SHARED_LIBS=ON ..
    sudo update-alternatives --config python3
    docker run --rm -ti --net=host -e DISPLAY=$DISPLAY
        
  14. https://www.lazyvim.org/installation
  15. for ocaml developing, use “opam user-setup install” frequently
  16. fix vim compile error:
    CC=clang CXX=clang++ LD=clang LDFLAGS=-fno-lto ./configure ....
        

    https://stackoverflow.com/questions/53165474/ncurses-library-is-unusable-during-a-vim-build

  17. use PackageCompiler.jl to compile a sysimage of LanguageServer.jl.
    :CocCommand julia.CompileLanguageServerSysimg
        
  18. open notebook in remote machine and open browser in host:
    jupyter notebook --no-browser --port=8889
    jupyter lab --no-browser --port=8889
        
  19. how to run pluto in docker:
    docker run -it -p 8090:8090 julia /bin/bash
    using Pluto; Pluto.run(host="0.0.0.0", port=8090)
        
  20. Use juliaup to manage julia versions
    cargo install juliaup
        
  21. Edit julia startup.jl, default in ~/.julia/config/startup.jl
cargo install juliaup
ENV["JULIA_PKG_SERVER"] = "https://mirrors.ustc.edu.cn/julia"
ENV["JULIA_PKG_SERVER"] = "https://mirrors.cernet.edu.cn/julia"
ENV["JULIA_DEPOT_PATH"] = "~/.julia"