How to create vimrc file or customize vim - vim

I have been learning basic vim and I found out that you can customize it. I have spent the last hour and a half trying to find out how. I am on windows 10. Apparently, I have to create the vimrc file and add everything myself but I don't even know where to put the file or what kind of file it should be. No tutorial or explanation yet has mentioned where to put the file; they all just say create the file. Some say I should already have the file but I don't. Others give me a command to put into the command prompt but none of those work. Please help, I have no idea why I could not find a solution to such a basic question.

Related

How do you properly use a .desktop icon to launch a python3.8 Tkinter GUI on Ubuntu 18.04?

Premise: I coded a Tkinter GUI for a python script. It works. I can launch it from terminal. I created an icon and the icon will show up in my GUI just fine. I've been looking for tutorial on .desktop launchers and none of the examples I've found work. After a few hours of wading through SEO spam in SERPs trying to find a tutorial on the subject or a forum question that has been correctly answered. Finally I decided to join a forum ask a question. I've found a lot of code snippets on this site in the past. Figured I would try here.
I've tried about 20 different examples none of which have worked but I think I at least know the questions to ask. Here's an example of a .desktop file: It's not an example that works but it's one on found on this site so I figure I will start there.
[Desktop Entry]
Type=Application
Terminal=false
Icon=/path/to/icon/icon.ico
Name=ApplicationName
Exec=python3 /path/to/application.py
Categories=Application;
Note the example in the other post shows a red highlight over Categories=Utility; and when I try to change it in /usr/share/applications/ it makes gnome-terminal insert an A when hit the up key to get my last BASH entry and change a bunch of keys on my keyboard into hotkeys rather than being able to type it pops open print dialogs and things like that that which is wicked annoying.
Does anyone want to discuss what each entry line in a .desktop file is supposed to look like. Also does the application, icon, and everything have to be in /usr/share/applications? What file locations are ok to use in this type of file?
Something else I thought of; is it possible that my Exec line is not correct. Does exec have to be a single argument? Do I need to create a bash script that can be called by Exec that is just something like ./script.sh or should I create a command alias that is a single argument? Or does it actually matter?
I also have a Linux question: What package handles .desktop icons? Who maintains said package? And where can I find actual documentation on the subject?

Setting vimwiki defaults

The situation: I was using vimwiki, I stopped for a brief flirtation with emacs/org-mode, and then ran screaming back to vim. I figured it was a good time to clean up my kludgy setup, and so I started with a fresh ~/.vim directory, installed pathogen, and I've been adding packages that way.
What's very strange is, when I go to start a new vimwiki index file, I get the message:
Vimwiki: Make new directory: /home/thomas/Dropbox/wiki/wiki
despite my .vimrc containing instead
let g:vimwiki_list = [{'path':'~/cerebra/wiki', 'path_html':'~/cerebra/export/html/'}]
That is to say, it's trying to save the wiki in a place almost, but not quite, like my previous vimwiki installation, and ignoring the new setting I've given it.
I bet if I understood how to use find with grep I could find where this setting is so that I could delete it. I examined each file in ~/.vim/bundle/vimwiki, and found no instance of the word "Dropbox" there, and it's nowhere in my vimrc.
from the comments, it turns out, your $HOME/cerebra is a softlink to /home/thomas/Dropbox/wiki.
So vimwiki works just fine.
small suggestion:
You could consider to create a link in dropbox, not the other way round. dropbox supports it.

Lost colorscheme after recovering swap file

I've searched for some time now and nobody seems to have the problem I do. I've got vim set up to use the colorscheme I like and it was all working perfectly until I opened a file that had a swap. I got the usual message asking if I wanted to delete it, read only or recover it. I selected recover and after doing so I've been unable to get that one file to display the colors I want.
I've tried the usual syntax:on, reloaded .vimrc and just about every normal step required to get the highlights. The strange thing is that the problem is only present for this one file when it's in the directory I recovered the swap from. Any other file I open has the colors working as usual, and if I rename the troublesome file or put it in another directory it loads the colors fine.
I figure vim must be storing its path somewhere but I have no idea where. I tried deleting .viminfo but that did nothing. Any input is greatly appreciated.
Sorry, I'm new to Stackoverflow. I think this is more useful as an answer to my own question than a comment:
:colo outputs "torte" and se ft? outputs "filetype=" I tried the same commands on other files and se ft? outputs "filetype=cpp". I searched for how to set the filetype and set filetype=cpp fixed the issue. Thanks Balthamos for pointing me in the right direction!

Using diff3 on a mercurial merge via command line

I'm sitting at a screen split in 3 in Putty showing my files. I can't figure out what I need to Google in order to find documentation on how to navigate the command line UI for KDIFF3. I'm trying to figure out how to go line by line or conflict by conflict or take a whole file altogether. Can you guys help me find a manual or tell me how I can navigate this GUI?
Thanks
What do you mean the "command line UI for kdiff3". Kdiff3 is a GUI application with an easily found usermanual. Are you sure you're not looking at vimdiff or something else?

A few vim questions

So I was hoping that some old school Vim'ers could help me out. These are all separate questions and normally I would put them up each on their own but I'm not sure if that qualifies as question whoring here.
Plus I think if you know enough to be asking any of these questions they will all be coming up in the near future:
I have a library I'm writing and a series of applications that use that library. There doesn't seem to be an easy way(from what I can tell) to build a ctags file for the library and build one for each of my applications and make sure one references the other when I'm in vim.
Using gf to open files from command mode is awesome, but a lot of my include files
don't contain the full path. They refer to an include directory I set in the IDE. How can I set this directory as another point for Vim to start looking for files?
Is there a way to compile a file inside Vim and send the output to a buffer? I'm currently using MSVS 2k3 but I'll be porting over to Linux in a few weeks so if this is possible on either system I'd appreciate it.
Re 3)
If you put a makefile in your root dir, you can simply write
:make
This will run make and (iirc) put any errors into a seperate buffer, and make vim goto the first compile error. From there you can navigate all erroring lines using :next-error
Also, see this page
http://wiki.beyondunreal.com/Legacy:Vim
and
http://linux.byexamples.com/archives/287/perform-grep-and-make-in-vim/
for details on how to show the result in a seperate console.
1- tags files are independent, and can be used together. See :h 'tags'
I can't tell what is the easy way to build tags files. I have one that consists in using two plugins of mine:
one (draft) plugin that knows how to update C++ tags files (it should be easy to adapt it to other filetypes),
and another (local_vimrc) that helps me define directories-local .vimrc. Thus for any files within a given directory hierarchy, I can adapt the &tags options to use the relevant tag files, and the current tag file that will be rebuilt automatically (or when a keybinding is triggered). (Plugins like project should do the trick as well)
2- :h 'path'
3- :h :make
HTH.
2)
:cd {path}
For help:
:he cd
A few others like :lcd might be better suited. Just scroll down that help page.
This is rather off topic, but might still be useful: if you're using Visual Studio a lot and like Vim, you might want to look at ViEmu. It's the best Vim-emulation for any IDE I've yet seen, and the cost is really low. :) And no, I'm not getting a commission. :P
It's not obvious, but if you open a directory instead of a file, it's nicely browseable.
e.g.
:e . (colon-e-dot)
:e .. (colon-e-dot-dot)
will let you browse from your current directory or its parent.
(understanding that you were probably hoping for a capability to have vim accept e.g.
:e abc.txt
and have it look in several directories, which I don't know how to do.)

Resources