Terminal setup.
authorMauro Scomparin <scompo@gmail.com>
Mon, 26 Oct 2020 23:13:08 +0000 (00:13 +0100)
committerMauro Scomparin <scompo@gmail.com>
Mon, 26 Oct 2020 23:13:08 +0000 (00:13 +0100)
content/posts/terminal-setup.md [new file with mode: 0644]
static/images/gnome-terminal-settings.png [new file with mode: 0644]

diff --git a/content/posts/terminal-setup.md b/content/posts/terminal-setup.md
new file mode 100644 (file)
index 0000000..d65f5cf
--- /dev/null
@@ -0,0 +1,176 @@
+---
+title: "Terminal Setup"
+date: 2020-10-26T21:13:37+01:00
+draft: false
+tags: [blog, configuration, terminal]
+---
+
+I can't quite remember things, so I wrote down some steps to install stuff I like for my terminal setup.
+
+Next time I do a fresh install it should be as annoying as today.
+
+# Colors
+
+Colors from the [Solarized][Solarized] color palette by [Ethan Schoonover][Ethan Schoonover].
+The `dark` color scheme is cool by default but i find the `light` one easier on the eyes when there's a lot of light.
+
+It's usually already present in most terminal emulators.
+I've tried it on:
+
+-      The [gnome-terminal][gnome-terminal]support looks good, you just have to set the following settings.
+    
+    ![Gnome terminal settings](/images/gnome-terminal-settings.png)
+
+-   Another at work that i can't remember. Something like QT terminal.
+    Solarized looked pretty good over there too.
+
+The `$TERM` environment variable should be set to something like `xterm-256color` for nice colors.
+
+This is usually the case, execute `echo $TERM` to just be sure.
+
+# Font
+
+I've chosen the [Hack][hack] font for my terminal.
+
+To install it I did this:
+
+       wget https://github.com/source-foundry/Hack/releases/download/v3.003/Hack-v3.003-ttf.zip
+       unzip Hack-v3.003-ttf.zip
+       cd ttf
+       sudo cp *.ttf /usr/local/share/fonts/
+       fc-cache -f -v
+
+A good size is 11 points.
+
+# Shell
+
+I use [bash] as my shell.
+
+# Editor
+
+I use [vim][vim] as my editor of choice.
+
+The environment variable `$EDITOR` should be set to `vim` otherwise it's annoying sometimes and it says `vi: comand not found`.
+
+Just add in the `~/.bash-profile` or `~/.bashrc` file the following line:
+
+    export $EDITOR="vim"
+
+## Color scheme
+
+There is a [Solarized][Solarized] `colorscheme` to use in vim and it's available [here][solarized-vim-repo].
+
+Just clone the [repository][solarized-vim-repo] and follow the instructions in the [readme][solarized-vim-manual-install] the instruction for the manual installation.
+
+Basically just:
+
+    git clone git://github.com/altercation/vim-colors-solarized.git
+    cd vim-colors-solarized
+    mkdir --parents ~/.vim/colors
+    cp colors/solarized.vim ~/.vim/colors/
+
+### Fixing spell check
+
+I've found a problem with the configuration with the built-in spell checker in [vim][vim], `spell`.
+
+I'm not quite sure why, but after running the command
+
+       set spell
+
+the spell checker run fine, but I could not see any highlighted wrong word.
+
+Searching on the web pointed me to [this issue][vim-colors-solarized-issue-195].
+
+I did the following changes in the `solarized.vim` file to restore the original behaviour:
+
+       diff --git a/vim-colors-solarized/colors/solarized.vim b/.vim/colors/solarized.vim
+       index 70f5223..8af1712 100644
+       --- a/home/scompo/programmi/vim-colors-solarized/colors/solarized.vim
+       +++ b/home/scompo/.vim/colors/solarized.vim
+       @@ -360,7 +360,8 @@ endif
+                let s:none            = "NONE"
+                let s:t_none          = "NONE"
+                let s:n               = "NONE"
+       -    let s:c               = ",undercurl"
+       +    let s:c               = ",underline"
+                let s:r               = ",reverse"
+                let s:s               = ",standout"
+                let s:ou              = ""
+       @@ -656,10 +657,10 @@ exe "hi! DiffText"       .s:fmt_none   .s:fg_blue   .s:bg_base02 .s:sp_blue
+        endif
+        exe "hi! SignColumn"     .s:fmt_none   .s:fg_base0
+        exe "hi! Conceal"        .s:fmt_none   .s:fg_blue   .s:bg_none
+       -exe "hi! SpellBad"       .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_red
+       -exe "hi! SpellCap"       .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_violet
+       -exe "hi! SpellRare"      .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_cyan
+       -exe "hi! SpellLocal"     .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_yellow
+       +"exe "hi! SpellBad"       .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_red
+       +"exe "hi! SpellCap"       .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_violet
+       +"exe "hi! SpellRare"      .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_cyan
+       +"exe "hi! SpellLocal"     .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_yellow
+        exe "hi! Pmenu"          .s:fmt_none   .s:fg_base0  .s:bg_base02  .s:fmt_revbb
+        exe "hi! PmenuSel"       .s:fmt_none   .s:fg_base01 .s:bg_base2   .s:fmt_revbb
+        exe "hi! PmenuSbar"      .s:fmt_none   .s:fg_base2  .s:bg_base0   .s:fmt_revbb
+
+I've opened an issue on the [repository][solarized-vim-repo] to tell them about the problem.
+[This one](https://github.com/altercation/vim-colors-solarized/issues/221).
+
+## Configuration file
+
+My `~/.vimrc` file consist of the following:
+
+       " Enable filetype plugins
+       filetype plugin on
+       filetype indent on
+
+       " When searching try to be smart about cases 
+       set smartcase
+
+       " Enable syntax highlighting
+       syntax enable 
+
+       " colors
+       set background=dark
+       colorscheme solarized
+
+       " Use Unix as the standard file type
+       set ffs=unix,dos,mac
+
+       set number
+       set relativenumber
+
+       " tab is 4 chars
+       set tabstop=4
+       " indent 4 chars
+       set shiftwidth=4
+       " auto indent
+       set autoindent
+       set smartindent
+
+It will probably change, but that's not really a problem right now.
+
+# Terminal multiplexer
+
+I use [tmux][tmux-wiki] as a terminal multiplexer.
+
+Install the last version from the distribution package manager and it's fine.
+
+The colors of vim are scaled down by default because tmux sets the `$TERM` variable to `screen`.
+
+To fix that follow what's suggested on the [tmux FAQ][tmux-faq] and add the following line to the `~/.tmux.conf` file:
+
+    set -g default-terminal "tmux-256color"
+
+The rest is pretty good by default, `CTRL-B` is fine for me.
+
+[Solarized]: https://ethanschoonover.com/solarized/
+[Ethan Schoonover]: https://ethanschoonover.com/
+[gnome-terminal]: https://wiki.gnome.org/Apps/Terminal
+[vim]: https://www.vim.org/
+[bash]: https://www.gnu.org/software/bash/
+[solarized-vim-repo]: https://github.com/altercation/vim-colors-solarized
+[solarized-vim-manual-install]: https://github.com/altercation/vim-colors-solarized#option-1-manual-installation
+[tmux-wiki]: https://github.com/tmux/tmux/wiki
+[tmux-faq]: https://github.com/tmux/tmux/wiki/FAQ
+[hack]: https://sourcefoundry.org/hack/
+[vim-colors-solarized-issue-195]: https://github.com/altercation/vim-colors-solarized/issues/195
diff --git a/static/images/gnome-terminal-settings.png b/static/images/gnome-terminal-settings.png
new file mode 100644 (file)
index 0000000..02fd4ab
Binary files /dev/null and b/static/images/gnome-terminal-settings.png differ