To register a new account on this wiki, contact us

Setting up vim-gpg plugin: Difference between revisions

From FSCI Wiki
Jump to navigation Jump to search
mention graphically editing ~/.vimrc
use gitg to clone the vim gpg plugin
Line 1: Line 1:
vim-gpg plugin allows transparent editing for files encrypted using GPG .Those who are new to GPG can follow this [https://www.madboa.com/geek/gpg-quickstart/ guide].
vim-gpg plugin allows transparent editing for files encrypted using GPG .Those who are new to GPG can follow this [https://www.madboa.com/geek/gpg-quickstart/ guide].


1) Install vim using your package manager (Those who prefer the GUI way of doing things can use vim-gtk3). Search "Gvim" in Software app (if you are using GNOME) and install.
1) Search "Gvim" in Software app (if you are using GNOME) and install. This is the easiest option.
 
OR
 
Install vim using your package manager (Those who prefer the GUI way of doing things can use vim-gtk3).  
   sudo apt install vim  
   sudo apt install vim  
OR
OR
   sudo apt install vim-gtk3
   sudo apt install vim-gtk3


2) Install vim-gpg plugin .There are 2 ways you can do this:-
2) Install vim-gpg plugin .There are 3 ways you can do this:-
:2a) If you are on a debian based distro. There is a package called `vim-scripts` that already has this plugin. So installing this package would make things a lot easier
 
2a) Install gitg from GNOME Software and start gitg from activities. Click on "Clone" option in gitg.  Add https://github.com/jamessan/vim-gnupg.git as URL and select ~/.vim/pack/bundle/start/vim-gnupg as "Local Folder". In "Local Folder" drop down, choose "Other" at the bottom, click on "Home" on the left bar, choose Create Folder icon on top right, and enter .vim and then each sub folders. The click Clone on the top right.
:2b) If you are on a debian based distro. There is a package called `vim-scripts` that already has this plugin. So installing this package would make things a lot easier
   sudo apt install vim-scripts
   sudo apt install vim-scripts


Line 15: Line 21:
::That's it ! Now you can open your gpg encrypted file using vim and it will ask for your passphrase.
::That's it ! Now you can open your gpg encrypted file using vim and it will ask for your passphrase.
:OR
:OR
:2b) You can use Vim's [https://vimhelp.org/repeat.txt.html#packages package] support to contain the plugin in its own directory.
:2c) You can use Vim's [https://vimhelp.org/repeat.txt.html#packages package] support to contain the plugin in its own directory.
   mkdir -p ~/.vim/pack/bundle/start
   mkdir -p ~/.vim/pack/bundle/start
   cd ~/.vim/pack/bundle/start
   cd ~/.vim/pack/bundle/start

Revision as of 21:53, 27 September 2025

vim-gpg plugin allows transparent editing for files encrypted using GPG .Those who are new to GPG can follow this guide.

1) Search "Gvim" in Software app (if you are using GNOME) and install. This is the easiest option.

OR

Install vim using your package manager (Those who prefer the GUI way of doing things can use vim-gtk3).

  sudo apt install vim 

OR

  sudo apt install vim-gtk3

2) Install vim-gpg plugin .There are 3 ways you can do this:-

2a) Install gitg from GNOME Software and start gitg from activities. Click on "Clone" option in gitg. Add https://github.com/jamessan/vim-gnupg.git as URL and select ~/.vim/pack/bundle/start/vim-gnupg as "Local Folder". In "Local Folder" drop down, choose "Other" at the bottom, click on "Home" on the left bar, choose Create Folder icon on top right, and enter .vim and then each sub folders. The click Clone on the top right.

2b) If you are on a debian based distro. There is a package called `vim-scripts` that already has this plugin. So installing this package would make things a lot easier
  sudo apt install vim-scripts
Now add the line "packadd! gnupg" to your ~/.vimrc. You can use a graphical text editor like GNOME Text Editor or GVim to open ~/.vimrc file and add this line to the end of the file (if it has some contents already or just add it to the start if the file is empty).
  echo "packadd! gnupg" >> ~/.vimrc
That's it ! Now you can open your gpg encrypted file using vim and it will ask for your passphrase.
OR
2c) You can use Vim's package support to contain the plugin in its own directory.
  mkdir -p ~/.vim/pack/bundle/start
  cd ~/.vim/pack/bundle/start
  git clone git@github.com:jamessan/vim-gnupg.git
Vim will find and load everything on its own, without mixing the files with others.