Vim is a cool and powerful editor in Linux system.
It is also available for Windows via this download page: https://www.vim.org/download.php
Choose: gvim_9.2.0000_x64.exe (64bit installer) or any format of your choice.
After downloading and installing, the installer it will create two desktop icons; something similar to the image shown below.
Why there are two icons? As the name suggests "gVim Easy 9.2", gVim Easy is the filename suggests it's "easy", upon opening or clicking the icon it will open gVim in "insert" mode and start typing immediately.
While the other icon "gVim Read only 9.2", upon clicking or opening this icon. This will open gVim on "read only" as it names suggest. It's quite good if you only need to review or read the file.
However, it says "read only" it doesn't mean that you cannot edit, modify or add text to the file.
While inside "gVim Read only", press "insert" key or press "i" on the keyboard. This tells gVim that you want to insert or edit the file and the "insert" text will be displayed on the status bar or status line which is shown at the left bottom pane of the status bar.
It is also available for Windows via this download page: https://www.vim.org/download.php
Choose: gvim_9.2.0000_x64.exe (64bit installer) or any format of your choice.
After downloading and installing, the installer it will create two desktop icons; something similar to the image shown below.
Why there are two icons? As the name suggests "gVim Easy 9.2", gVim Easy is the filename suggests it's "easy", upon opening or clicking the icon it will open gVim in "insert" mode and start typing immediately.
While the other icon "gVim Read only 9.2", upon clicking or opening this icon. This will open gVim on "read only" as it names suggest. It's quite good if you only need to review or read the file.
However, it says "read only" it doesn't mean that you cannot edit, modify or add text to the file.
While inside "gVim Read only", press "insert" key or press "i" on the keyboard. This tells gVim that you want to insert or edit the file and the "insert" text will be displayed on the status bar or status line which is shown at the left bottom pane of the status bar.
gVim image in "Insert" mode:
In "Insert" mode which can be activated by pressing "i" key or "insert key" on the keyboard, once in insert mode then a file can be modified or a new file can be created.
To go back to "normal mode" just press "ESC" or escape key, then the "Insert" status line, will disappear. Which technically means, that gVim is in normal mode.
Basic scenarios when editing a file with any text editor or even Microsoft word, you either "save" the file, "save as" which give you an option to save the file give it another filename or change the location where the file will be saved, or simply do "save and exit".
How to do this in gVim?
To save a file or whatever work you've done in gVim, of course doing it via the GUI by clicking "File" then "save". To simulate or practice how it's done in Linux, is to activate command mode.
Doing or getting thru life, without calling or asking help from up above is a difficult way to live. It's written come to me all who are weary and burdened, and I will give you rest. Yes, ask God for strength to overcome whatever obstacle you have right now in your life. Trust is all you need.
In "Insert" mode which can be activated by pressing "i" key or "insert key" on the keyboard, once in insert mode then a file can be modified or a new file can be created.
To go back to "normal mode" just press "ESC" or escape key, then the "Insert" status line, will disappear. Which technically means, that gVim is in normal mode.
Basic scenarios when editing a file with any text editor or even Microsoft word, you either "save" the file, "save as" which give you an option to save the file give it another filename or change the location where the file will be saved, or simply do "save and exit".
How to do this in gVim?
To save a file or whatever work you've done in gVim, of course doing it via the GUI by clicking "File" then "save". To simulate or practice how it's done in Linux, is to activate command mode.
To activate command mode, make sure gVim is in "normal mode", press "ESC" key and the status bar should not display anything like "INSERT", "REPLACE", "VISUAL" or any other text.
While in "Normal mode", press the colon key on the keyboard or this symbol ":" which is just beside the "L" key on a US keyboard layout.
Once in command mode, type "w" key, it's a small "w" not the capital "W" key. w means write or save.
Image below shows how it should look like:
If "W" or the capital "W" is type, gVim will not recognize it and will show an error.
Yes, typing: ":w" key in gVim is the same command that can be used in Linux vim. Yay, a good way to practice in gVim Windows.
How to do "save as" in gVim?
It can be done via the GUI, "File" then "Save as". Using the command mode, it can be done like this:
While in "Normal mode", press the colon key on the keyboard or this symbol ":" which is just beside the "L" key on a US keyboard layout.
Once in command mode, type "w" key, it's a small "w" not the capital "W" key. w means write or save.
Image below shows how it should look like:
If "W" or the capital "W" is type, gVim will not recognize it and will show an error.
Yes, typing: ":w" key in gVim is the same command that can be used in Linux vim. Yay, a good way to practice in gVim Windows.
How to do "save as" in gVim?
It can be done via the GUI, "File" then "Save as". Using the command mode, it can be done like this:
:w newfilename.txt
Image below, shows how to do "save as" in gVim or vim.
To verify of course, is to open the file. However, gVim itself will show some updates on the status bar that the file has been written with the new filename as specified. Image below shows after gVim successfully written the file or after doing "save as".
How to do "save and exit" in gVim or vim?
In gVim it can be done via the GUI, click "File" and chose "save-exit". And it can also be done via the command mode, by just typing: :x or :wq
Image below, shows how to do "save as" in gVim or vim.
To verify of course, is to open the file. However, gVim itself will show some updates on the status bar that the file has been written with the new filename as specified. Image below shows after gVim successfully written the file or after doing "save as".
In gVim it can be done via the GUI, click "File" and chose "save-exit". And it can also be done via the command mode, by just typing: :x or :wq
:x - means save and exit
:wq - two letters which means write and quit vim
Of course, :x is a slay option, just one letter and does "save and exit".
Here's the image on how it's done, make sure gVim is in command mode when typing or :x or any commands.
:x will save the file and exit gvim.
To do "save as" and "exit" in gvim, can only be done via command mode, please check image below on how to do it.
That's it, when that command shown on the image gVim or vim will perform "save as" then "exit".
As some bonus tip, while in "insert mode" press "Ctrl Key and press x f" hold the control key while pressing x and f and gVim needs to be in insert mode.
This will show on gVim all the files on the current directory where files are saved and there will be a drop down, any filename selected will be shown in gVim.
vim commands in Linux can be used in gVim, yes, WSL Ubuntu Linux or a virtual machine with Linux box is the best way to learn Linux. Of course, correct practice makes perfect. So, doing it in gVim while in Windows is way to go also.
Here's the image on how it's done, make sure gVim is in command mode when typing or :x or any commands.
:x will save the file and exit gvim.
To do "save as" and "exit" in gvim, can only be done via command mode, please check image below on how to do it.
That's it, when that command shown on the image gVim or vim will perform "save as" then "exit".
As some bonus tip, while in "insert mode" press "Ctrl Key and press x f" hold the control key while pressing x and f and gVim needs to be in insert mode.
This will show on gVim all the files on the current directory where files are saved and there will be a drop down, any filename selected will be shown in gVim.
vim commands in Linux can be used in gVim, yes, WSL Ubuntu Linux or a virtual machine with Linux box is the best way to learn Linux. Of course, correct practice makes perfect. So, doing it in gVim while in Windows is way to go also.
Doing or getting thru life, without calling or asking help from up above is a difficult way to live. It's written come to me all who are weary and burdened, and I will give you rest. Yes, ask God for strength to overcome whatever obstacle you have right now in your life. Trust is all you need.
Comments
Post a Comment