How do I add the tomorrow theme to Janus in MacVim?
https://github.com/chriskempson/tomorrow-theme
What are the steps?
You can copy the theme's vim folder into the ~/.janus folder, as explained in the Customization wiki page of Janus. It would be a good idea to give the vim folder a more descriptive name e.g. tomorrow-theme.
For example, assuming you've got your local copy (clone) of tomorrow-theme at <path_to_tomorrow_theme>, you could do
$ cd ~/.janus
$ mkdir tomorrow-theme
$ cp -R <path_to_tomorrow_theme>/vim/ tomorrow-theme
Note the slash / at the end of the path to the vim folder.
Start by reading the documentation. After that, copy the files from github/vim into ~/.vim directory.
I guess there's multiple ways of doing this.
I cd'ed into:
.vim/janus/vim/colors
I created tomorrow-theme folder and cd'ed into that:
.vim/janus/vim/colors/tomorrow-theme
In the tomorrow-theme folder I create colors directory
.vim/janus/vim/colors/tomorrow-theme/colors
And that's where I paste the downloaded .vim themes
Tomorrow-Night-Blue.vim Tomorrow-Night-Bright.vim Tomorrow-Night-Eighties.vim Tomorrow-Night.vim Tomorrow.vim
Related
I am beginner in linux and wondering about a shorter way to go a directory having same parent directory. Here I elaborate that.
dir1
- dir11
- dir12
- dir13
- dir14
Directory dir1 has sub-directories dir11,...,dir14. I am at directory dir13 and want to go to dir12. What is direct way to do this?
I can do
cd..
cd dir12/
But I am wondering whether I can do this in single step. Any ideas?
cd doesn't only take one directory to change to. You can provide a complete path to which you want to go.
You can simply type cd ../dir12
You can also go all nuts with cd ../dir12/../dir13/../dir14/..
Try also the following: type cd ..<press Tag twice>. This will list you all directories in the path you have given.
There are wildcards that cd can use. For example ~ is your home directory. cd ~ or just cd will change into your $HOME.
See man cd (in a terminal) for more.
I want to keep my custom vimrc settings in a file in my Dropbox called vimcustomvimrc.vim
I did some searching and found this http://blog.mojotech.com/a-veterans-vimrc/ line below to put in my .vimrc file so that it will load my custom settings but its not working. can you please help?
file .vimrc contens below
set runtimepath+=~/Dropbox/vim
source ~/Dropbox/vim/vimcustomvimrc.vim
You can maintain your ~/.vimrc under version control using git version control system, for example: I have a .dotfiles repo. In it I have zshrc bashrc and a subfolder called vim. So I made somthing like this...
ln -s ~/.dotfiles/vim ~/.vim
ln -s ~/.dotfiles/vim/vimrc ~/.vimrc
ln -sfvn ~/.dotfiles/zshrc ~/.zshrc
ln -sfvn ~/.dotfiles/bashrc ~/.bashrc
I think is a better solution because you can undo/redo some changes and can also add other good solutions shared on the internet easyly, things like this solution made by Steve Losh, or more specificlly Synchronizing plugins with git submodules and pathogen a great video made by Drew Neil on this matter.
The first line is not needed if you only want to source that specific file; the source line is enough.
The runtimepath option allows you to add or remove directories to the default list of directories where Vim expects to find other default directories and *.vim scripts. If you don't keep any plugin or whatnot in ~/Dropbox/vim/ there's no need to change runtimepath.
Also, there's a lot of bullshit in that article: if I were you I would take it with a grain of salt.
How would I change to the directory C:/Users/myname/project name in Git Bash?
cd /c/users/myname/project\ name
Beware that ls /, or typing cd / followed by Tab-completion, might not show the existence of this folder, but cd /c will still work. Also note that pwd (to print the current working directory) might show something like /bin, but this might not be the actual working folder for commands such as git clone, which might use the folder from which Git Bash was started.
If the you know how many levels up from your current working directory, you could use cd ../project/name to avoid writing the entire directory path.
The .. represents moving 1 directory up.
You will need to use quotes in your directory name, or the short version of the filename.
You can find the short version of the file name by issuing the command:
dir /x
If I remember correctly. I do not have a windows machine.
It is a version of bash shell though, so you should be able to simply quote it. (And the dir /x may or may not work.)
If you are at the a directory and wanna switch to sub directory use :
cd "project name"
If you wanna go to a different path use the whole path :
cd "C:/Users/myname/project name"
But you can avoid use white spaces in project files and folders and instead use underscore
An alternative that worked for me (Windows 10 x64) is putting the full address in quotes:
cd "D:\BWayne\Documents\- School\Developer\-- Backend\Test for GitBash"
I could then do like mkdir, touch, etc and it successfully put them in the Test for GitBash folder.
I installed rvm and a couple of rubies since i'm working with projects based on different ones. Then created .rvmrc files in project directories and they work perfectly when i 'cd' to projects' folders in my terminal:
~$ cd workspace/prox/
~/workspace/prox$ rvm current
ruby-1.9.3-p194#prox
~/workspace/prox$ cd ../cto/
~/workspace/cto$ rvm current
ruby-1.8.7-p358#openservice
~/workspace/cto$
And now i'm trying to use vim + NERDTree as my new ide to improve performance but i encountered a problem with .rvmrc:
When i cd in NERDTree to a project's folder and get confirmation that CWD has changed i end up with default ruby#gemset. Hance .rvmrc hasn't got processed.
Does anyone know if it is possible to make .rvmrc files work with vim NERDTree?
I'm not a rubyist and, therefore have no practical experience with RVM.
But I seem to remember that it works by setting a bunch of environment variables which are supposed to be picked up by Vim at startup. Am I right?
IMO the problem, here, is that changing a directory in Vim and changing a directory in your shell is not related at all. AFAIK, Vim doesn't care about your .rvmrc and won't notify your shell of any :cd.
See this sequence of commands:
$ cd
$ pwd
/home/username
$ vim
:pwd
/home/username
:cd Dropbox
:pwd
/home/username/Dropox
:q
$ pwd
/home/username
While you have changed to another directory while working in Vim you are back to square one when you quit. Because your shell didn't notice all your travels and Vim didn't pickup any new environment variables you are somehow at the same place with the same environment.
But I might be completely off.
This plugin by Tim Pope should help.
I have a project as follows:
/dir
dir1
dir2 -> symbolic-link to /otherdir
file1
tags *
I want vim to use THIS tags file which includes tags for files in dir1 and dir2.
When I edit file1, VIM cannot find the correct tags file.
I have the following setup in .vimrc:
set tags=tags;/
Is there a way to keep this file structure without explicitly telling VIM the absolute path to tags?
You can append to the same ctags other tags, so for example if you want to ctag everything inside dir1 you would execute:
ctags -R *
and if you want to add some other tags from dir two:
ctags -R -a ~/path/to/dir2/*
-a is for appending.
Now what I do to always have my ctags no matter where I open my vim, is to add this line in my .vimrc:
set tags+=./tags;$HOME
this will look for tags in the current directory and will go down recursively to your home folder, if you would like it to search until the root folder or less just change $HOME for / or /path/to/root/project/
With this line in my ~/.vimrc and a similar layout as yours, tags related features (:ts, <C-]>, etc.) use the same tags file situated at the root of dir, alongside dir1 and dir2.
set tags=./tags,tags;$HOME
The tags file is first searched in the current file's directory, then in the cwd, then upwards until it reaches $HOME.
What does :echo tagfiles() say when you are editing file1? Here it says ['/home/romainl/Desktop/dir0/tags'].
EDIT
Throwing a symlink doesn't seem to change anything.
ENDEDIT
I think it's just a question of being in the right directory. When you start working in this project, use :cd /dir to get into the directory with the tags file, and make sure the autochdir option is turned off. Then when you edit a file inside dir2, the working directory will still be dir, and it will still find the same tags file.
If, on the other end, you end up with dir/dir2 as your working directory, that will actually mean you're in /otherdir, so when Vim looks for the tags file from there, it can't find it in that directory or in / . I suspect that's what's happening to you now.
You can see what directory you're in at any time with the :pwd command, just like in the shell.