ctrlp searches my home directory.
Is there a line I can put in my vimrc so that ctrlp only searches my ~/Documents directory by default?
This in my vimrc did the trick:
" set cwd so Ctrl-P starts searches from Documents when Vim opens
cd /home/user_name/Documents/
Related
I have installed my sublime text editor in d drive some days ago and i have customized it. and then i have create .bashrc file in users/my-name directory. then i added:
alias subl = 'the directory i have copied from the app-properties'
but it doesn't work..
when i type
subl .
it shows me,
$ subl .
bash: $: command not found
How can I open sublime text editor in git bash.
enter image description here
Let's say you installed sublime in folder d:\Sublime Text 3.
In this way you need set correct path for alias in .bashrc located in directory users/my-name. Please, take note that folder's name can have backspaces.
alias subl="/d/Sublime\ Text\ 3/sublime_text.exe"
To apply changes run commands in git bash:
cd ~
source .bashrc
Then you can run sublime with command:
subl .
I followed the steps outlined here https://laravel.io/forum/02-24-2014-a-neat-way-integrate-cmder-and-sublime-text-seamlessly, which are:
Create a new folder called 'Sublime Text 3' in the '/cmder/vendor/' location. You should also see the folders /clink, /conemu-maximus5, and /mysgit.
Download a portable version of Sublime Text 3 from their website and unzip the content into the newly created Sublime Text 3 folder.
Then, in the aliases file under /cmder/config/aliases, add: subl="%CMDER_ROOT%\vendor\Sublime Text 3\sublime_text.exe" $1 -new_console:s75V
Now I can use the subl command in a normal cmd window, but when I switch to a bash shell I get the same error, 'bash: subl: command not found'
On Windows, if you want to run some command directly in the console, you have to add the directory where it resides to the system PATH variable. There is no need to follow the instruction given in the link you provided.
solution
Find the directory where subl.exe resides and add that directory to system PATH.
see this post on how to set the path.
I am using cygwin and I am trying to set up an .ssh/config file. Cygwin's folder is in my C: drive. My Home directory is C:\Users\USER. I have noticed that when I edit C:\Users\USER.ssh\config, cygwin does not even notice it (even though it notices the other files I have in my USER folder, i.e. .bashrc). But it does notice the config file if I put it in C:\cygwin64\home\USER.ssh\config.
Is there a way to get cygwin to read the .ssh folder in my USER home directory instead?
Make sure your home directory setup in /etc/passwd matches /home/ Often it is not set at all (second to last field in the ':' delimited line. Then you'll need to restart your cygwin session (exit the terminal, and restart)
That should fix your problem.
This isn't the greatest solution but it works:
ln -s /cygdrive/c/Users/username/.ssh /home/username/.ssh
If /home/username/.ssh already exists, perhaps rename it to .ssh_original or move the files into the other .ssh folder.
Is there a way to find the name of the bash configuration file that is currently on use. I searched for the .profile or .bashrc but did not find them. However still I can print some of the env variables i.e
$HOME, $PATH
If you are using one of these sudo su -, bash --login, ssh user#host,
these are considered as login shell,
then you might want to try
/etc/profile
~/.bash_profile
~/.bash_login
~/.profile
Environment variables are stored in the each process itself.$HOME and $PATH is stored in the bash process itself.
So,First you have to find process id of your bash process.You can use ps command to get the process id of the process.
Then,
cat /proc/your_bash_process_id/environ
I hope this will helps you.
As some people said, those files are in the home directory.
(Screenshot from Wiki article.)
I'll tell you here how to find it (the explanation here is for Windows 10 only), which is my system.
You can quickly find and open some of those locations with the following commands (using bash console):
cd ~ ← It will take you to your home directory.
ls -a ← It will display files and folders, both visible and hidden.
explorer . ← It will open the home folder in Windows Explorer, which can be really useful. Look for the file/folder you need. Move to it using:
cd folder-name or open the file in the text editor using notepad file-name. For your case, you should find and open notepad .bashrc
Those files are in the user's home directory.
$HOME/.profile
$HOME/.bashrc
I downloaded color sample pack from http://vim.sourceforge.net/scripts/script.php?script_id=625
it says i should unzip and place it into ~/.vim but where is this folder? I tried unzip it to my usr/share/.vim folder but it is not working, I don't see themes added to gvim Edit>color scheme menu, and i tried "colorscheme sometheme", "color sometheme" in my gvimrc. Both not working for new themes
Isn't the ~/.vim should be the .vim folder in use/share? or I should create a new folder under home?
Note:there is a folder vim73 in my .vim, I guess this doesn't affect anything
thanks for any help!
First of all, open vim, and get help from :help colorscheme
:colo[rscheme] {name} Load color scheme {name}. This searches 'runtimepath'
for the file "colors/{name}.vim. The first one that
is found is loaded.
After reading the manual above.
Take the following steps maybe help you:
find runtimepath
:set runtimepath?
It will print out run-time paths:
runtimepath=~/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim71,/usr/share/vim/vimfiles/after,~/.vim/after
create directory called colors under one of them if not exist(for example: ~/.vim)
$ ls ~/.vim
ls: cannot access /root/.vim: No such file or directory <== we need create it!!!
$ mkdir -p ~/.vim/colors
copy your color.vim to your colors directory
$ cp /path/to/your/color.vim ~/.vim/colors
restart vim to use new colorscheme
:colorscheme color
(optional) put command above to ~/.vimrc file to make it permanent
In UNIX parlance, ~ represents your home folder which is /Users/<username> in Mac OS X.
You are supposed to put all your custom scripts/colorschemes/whatever in a .vim folder situated in your home folder. In Terminal.app, type each line (without the $) then hit Enter:
$ cd
to be sure you are in your home folder
$ mkdir .vim
here you'll have an error message if ~/.vim already exists; if you don't receive a message it means that the folder is created
$ cd .vim
to move into it
$ open .
to open a Finder window here. At this point you should follow specific indications.