About James Cherti

James Cherti is an experienced Infrastructure and Software engineer. He has written high-quality Python, Bash, C/C++, PHP, JavaScript source codes, administered Linux servers, and delivered several presentations in universities. He is also an active Open Source contributor.

A Vim plugin for persisting and restoring Vim editing sessions easily and effortlessly

The Vim plugin vim-easysession, written by James Cherti, offers a convenient and effortless way to persist and restore Vim editing sessions. It can significantly increase productivity and save a lot of time for users who frequently switch between different projects and those who frequently open and close the Vim editor.

In addition to its automatic session management capabilities, the Vim plugin Easysession also offers a variety of useful Vim commands that allow users to save, switch, list and delete sessions manually.

Easysession features

  • Save and restore the session “main”, which includes various settings such as the font, background, and color scheme (The &guifont, &background, and the color scheme are also part of the session file that is generated by Easysession)
  • Auto-complete the Vim commands :EasySessionLoad and :EasySessionRemove
  • Specify the directory where the session files are located:
    let g:easysession_dir = expand('~/.my_vim_sessions')
  • Save the session:
    :EasySessionSave
  • Switch to a different session:
    :EasySessionLoad SESSION_NAME
  • List the available sessions:
    :EasySessionList
  • Delete a session with:
    :EasySessionRemove SESSION_NAME

Please star vim-easysession on GitHub to support the project!

Installation

The Vim plugin Easysession can be installed with Vim’s built-in package manager (Vim 8 and higher):

mkdir -p ~/.vim/pack/jamescherti/start
cd ~/.vim/pack/jamescherti/start
git clone --depth 1 https://github.com/jamescherti/vim-easysession
vim -u NONE -c "helptags vim-easysession/doc" -c qCode language: JavaScript (javascript)

The plugin can also be installed with any third-party plugin manager such as Pathogen or Vundle.

Conclusion

The Vim plugin Easysession provides an easy and effortless way to persist and restore Vim editing sessions. Its automatic session management capabilities, manual commands, auto-complete feature, and its ability to specify the directory for saves session are all valuable features that make it easy to manage Vim editing sessions.

If you are looking for a way to manage and organize your Vim session more efficiently, the Easysession Vim plugin is an excellent option to consider.

Master the HJKL navigation with the Vim plugin Hjklmode, which can help breaking the habit of moving the right hand away from the home row

Vim’s popularity is largely due to its ability to increase productivity through efficient navigation and editing techniques. One such technique is HJKL navigation, which allows using the H, J, K, and L keys to move the cursor left, down, up, and right. This method of navigation may seem strange at first, but it is actually a very efficient way to navigate through text and can greatly increase productivity when using Vim.

In addition to that, the HJKL navigation can help reduce wrist strain, as it allows moving the cursor without having to reach for the arrow keys, which are located in a position that can cause wrist to bend and flex in an unnatural position.

However, HJKL navigation can be hard to learn at first, because it requires using unfamiliar key combinations to move the cursor. One way of making it easier to learn HJKL navigation is by using the Vim plugin Hjklmode, written by James Cherti. You can use the Vim plugin to force yourself to rely on HJKL navigation to move around the text.

If you are interested in trying the Hjklmode Vim plugin, you can download it from its Git repository: https://github.com/jamescherti/vim-hjklmode

Hjklmode Vim plugin features

One of the key features of the Vim plugin Hjklmode is its ability to disable certain keys that require moving the hand away from the Touch Typing position, which can disrupt typing flow. These keys include: Backspace, Insert, Delete, Home, End, Page Up and Page Down, Arrows.

In addition to disabling certain keys, the Vim plugin Hjklmode also adds key mappings for Alt+h, Alt+j, Alt+k, Alt+l to Insert Mode, Command Mode, and Terminal Mode, which allow moving the cursor even in those modes.

Overall, the Hjklmode Vim plugin is a great tool for those looking to learn the HJKL navigation to increase their efficiency and productivity. Whether you are a beginner or an experienced Vim user, the Hjklmode Vim plugin can help you break the habit of moving your hand away from the home row/Touch Typing position.

Do you like the Vim plugin Hjklmode? Please add a star to vim-hjklmode on GitHub.

Install the Vim plugin Hjklmode with Vim’s Built-in package manager (Vim 8 and above)

mkdir -p ~/.vim/pack/jamescherti/start
cd ~/.vim/pack/jamescherti/start
git clone --depth 1 https://github.com/jamescherti/vim-hjklmode
vim -u NONE -c "helptags vim-hjklmode/doc" -c qCode language: JavaScript (javascript)

(The plugin can also be installed with any third-party plugin manager such as Pathogen or Vundle)

What are the alternatives to pressing the Escape, Backspace, and Arrow keys?

Built-in Vim Key MappingEquivalent to
Ctrl-[Escape
Ctrl-hBackspace
Ctrl-fPage down
Ctrl-bPage up
hLeft
jDown
kUp
lRight
0 (zero)Home
$End

For more information:

  • :help motion.txt
  • :help search-commands

Configure XFCE 4 programmatically with the help of watch-xfce-xfconf

Configuring XFCE 4 programmatically is useful if you wish to have the same XFCE 4 settings on several computers.

The command-line tool jamescherti/watch-xfce-xfconf (previously named: monitor-xfconf-changes) will help you to create shell scripts that can configure XFCE 4 programmatically. It will display the xfconf-query commands of all the Xfconf settings that are being modified by XFCE 4 programs (like xfce4-settings-manager, thunar, ristretto, etc.).

Please star watch-xfce-xfconf on GitHub to support the project!

How to use the command-line tool monitor-xfconf-changes?

The watch-xfce-xfconf command-line tool can be installed locally, in ~/.local/bin/watch-xfce-xfconf, using pip:

pip install --user watch-xfce-xfconf

Run xfce4-settings-manager in the background:

xfce4-settings-manager &

Execute watch-xfce-xfconf:

~/.local/bin/watch-xfce-xfconfCode language: plaintext (plaintext)

The xfconf-query commands will be displayed by watch-xfce-xfconf on the terminal every time an XFCE 4 setting is changed (with xfce4-settings-manager, thunar, ristretto, etc.).

You can then use the xfconf-query commands to configure XFCE 4 programmatically.

Links related to watch-xfce-xfconf