Feb 01, 2018 I am a new vim text editor user. I usually load /.vimrc using:vs /.vimrc for configuration. Once edited my.vimrc file I need to reload it without having to quit Vim session. How do I edit my.vimrc file and reload it without having to restart Vim on Linux or Unix-like system? Vim is free and open source text editor that is upwards.
OK so this is a Monday question, for a long time I’ve just wanted Emoji’s inside Vim, so what are the considerations to make this work:
Why you want everything in UTF-8
First of all just to demystify, an emoji to a computer is just another Unicode character. Unicode is a huge character set that is designed to include basically every character every invented by people.
I can remember distinctly, someone, was it Brian, I’ve forgotten his name, barging into my office explaining how important it was to move from Code Pages where Windows would switch from one character set to another to just have a 32-bit Unicode number and no switching. Before Unicode, you had to know the Code page and the encoding (think of it like segmented memory), but with Unicode, you could just have one character set that was of course huge. The trick is to use variable encoding called UTF-8 so that characters that are frequently used only need 1 byte. Pretty clever as long as you have a fast computer.
Having a font that displays all Unicode characters
That’s a long way of saying that you definitely want to use UTF-8 in your website and every thing. So for instance, if your browser is UTF-8, you can see me say “Thank You” in English and Chinese 谢谢 without any problems.
Now of course, we have a new set of characters call Emojis and the solution is to give them their own Unicode points, so now I can say thank you in Emoji too! ?? And I can even change the color of the hands because they are new Unicode as well (which is appropriate on MLK day!) ??.
The good news is that most modern fonts support this so for instance the FiraCode Nerd Font Mono that I use with iTerm2 works perfectly as does this default Mac font, San Francisco.
Entering Emojis, the Gitmoji and the real EmojiUpdate Vim Mac Os
Of course as a programming it is pretty inconvenient to have representations like this because you have to either know the Unicode number to enter something or you have to enter the Emoji data entry mode. Instead, there’s a simple GitHub Short codes so the idea is that if you enter
?❤️??
Then it should automatically translate into the equivalent Emojis. On a Mac, you turn on Emoji Viewer and then scroll up to reveal the Search box and type these in.
So how to enter on a Mac?
Well to enter things into Vi, you need a font (as discussed that displays then) and then an easier way then opening up the Emoji Viewer and use the shortcut Ctrl-Command-Space or with all the emoji power (which includes the strange Mac characters for Option and Command).
The way you can set all this with the Keyboard System Preferences which lets you enable it with System Preferences. Note that this will get you the Character Viewer and then you hit expand on the upper right which turns it from an Emoji viewer to a complete character set viewer.
So for instance to display the Command key in MacOS and then you have to enable Technical Symbols to see them (whew!). So after you click on that tiny symbol on the upper left, there is another nearly invisible gear icon on the upper right (it is greyed and very small, click on it and a huge number of additional lists are opened up. You want Technical Symbols, although when I was there I turned on Windows Dingbats for sentimental reasons.
So it turns out that the Command key is actually a Place of Interest sign ⌘ and the Option key which I have no idea what it means ⌥
In addition, you have to know the Unicode points, but there are actually these things as actually keys. These are hard to get to, but you can just copy them from websites like this one now:
Entering in Vim as markdown or Unicode
Now with Vim, you can use the native Mac entry system, but of course there are plugins to help you. The first let’s you quick direct entry of Emojis with
vim-emoji-complete where you use <C-X><C-E> to to the eXtra Enter. Or with my new found love of Unicode, you could write this as ⌃X and ⌃E.
The second is vim-emoji which lets you type
:boom: and has autocomplete as well that you get with <C-X><C-U> so just type the : and then you can select the proper GitHub Markdown Emoji. This Markdown is used in lots of other places like Slack for instance.
All configuration options for vim are stored in the user’s home directory in a file named .vimrc
The script code is below but there are somethings you’ll want to do before setting it up.
You’ll need to create directories for the following: backups, colors, swaps and undo.
Execute this command to set up the directories in the terminal ( The ~ character will set the path to your home directory. ex: /Users/username/ ):
$ cd ~/.vim ; mkdir backups ; mkdir colors ; mkdir swaps; mkdir undo;
This will keep all your backups, swaps and undos in your .vim user directory. Also the colors directory is for installing themes.
![]()
Visit vimninjas.com if you would like to download a color scheme. Once you find a color scheme you like, just download it and copy and paste the code into the relevant scheme file and place the file in ~/.vim/colors/
For example if you download the Candy theme, you would name the file candy.vim and place it in the relevant directory described above. Then in your .vimrc config file you would set the theme like so:
I've created a github repo with the .vimrc configuration. Please take a look at the repo and download from here.
Mac Vim Commands
Checkout or download the git zip and setup the .vimrc file by using the cp command.
![]() Update Vim On Mac
$ cd ~/Downloads/MacOSVimConfig-master
$ cp vimrc-example ~/.vimrc
Otherwise you can create your .vimrc file by copying the Raw text from github and pasting the text below. NOTE: While in vim before you paste try doing this command.
:set paste
Gvim Windows 10
This should paste the text with the best result. Sims 3 mac sale. Once the .vimrc file is configured open a new terminal windows and open a file to test out the setup.
$ vim ~/.vimrc
Latest Macbook Software Update
------------ .vimrc example configuration ------------------
Then paste in these configuration options:
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |