How can I show hidden files (starting with period) in NERDTree? - windows

How can I make NERDTree show files that begin with an . (period)?
I have a file named .hgignore in a project directory. If I browse to that directory using NERDTree, the file is not displayed within the tree.
I am using gvim on Windows.

Press I (Shift+i) to toggle hidden files in the NERDTree explorer window.
To enable this behavior by default, add this line to your .vimrc file:
let NERDTreeShowHidden=1
For more detail, access the NERDTree help file :help NERD_tree.txt and search for "hidden".

If you are using Neovim on Linux, the configs are in the file :
home/[user]/.config/nvim/init.vim

Related

Open hyperlink file from iterm2 by Pycharm on MacOS

I would like to set up my iterm2 to open hyperlink file to pycharm on my mac. With default setting of iterm2, file is open by Xcode App and do some research online from this post open-file-on-intellij-from-iterm-2 and set up my iterm2 from Preferences/Profiles/Advanced/Semantic History -> Run command -> /usr/local/bin/charm \1 --line \2 or /Applications/PyCharm.app/Contents/MacOS/pycharm \1 --line \2. Neither of them works. How I can open file in Pycharm with a command + click in iterm2?
I was looking for the same thing in RubyMine. Turns out I just needed to associate .rb files with RubyMine in the Finder. No changes to iTerm config were needed.
Pick any .py file in Finder, and do Get Info (cmd-i) on the file. Under 'Open with:' pick PyCharm. You might have to first select 'Other...' and then you can pick PyCharm. Under that dropdown menu is a button that says 'Change All...', use that to associate all .py files, not just the one you initially selected.
Works like a charm (no pun intended) in RubyMine. The particular file I tried to open was already contained in a project that RM had opened, so it focused that project window, and opened that file.

How do I change the default save location in Vim?

Currently it's C:\Windows\System32 which is pretty impractical. I know that you can change the current directory with :cd [directory], but is there any way to change the default save location for new files without having to change directories all the time?
I am not at Windows so I cannot find the exact menu names and such, but if I recall correctly the easiest way to go about it is:
Find your gVim application
Right click it
Choose Properties,
Change the startup location in one of the tabs. The usual place to set it to would be your home directory.
You can change Vim's current working directory with the :cd command.
See
:help :cd
.
If you want Vim to always start in a particular directory, you can
put the :cd command in your ~/_vimrc file.
If you want Vim to use
the parent directory of the file you are editing as its current
working directory, you can put this setting in your ~/_vimrc file:
.
set autochdir
See
:help 'autochdir'

View this file in Explorer (while open in notepad++)

I have file.txt opened in notepad++.exe
This works with all filetypes (.xlsx .txt .tab .csv .pages .scrivener you get it) on OS X:
I right click the file name using the app I'm in. (On notepad++ on windows, this would be right clicking on my file.txt file.)
A menu pops up, showing me the path to that file. For example /dropbox/work/projectA/subfolderB/file.txt
I choose a certain folder, for example the folder /projectA
That folder opens up in finder.
I want to do this on windows 7. Extra important to do it in notepad++ with .txt-files, since those are part of my GTD-system.
The question is not at all clear about what you want.
Having installed Notepad++ via the normal installer, you should be able to right-click on a file in Windows Explorer (or File Explorer) and select "Edit with Notepad++". That allows any file to be viewed with Notepad++.
The Notepad++ Run menu should contain an entry for Open containing folder that opens Windows Explorer at the folder containing the current file. This command shoul dbe in the file c:\Users\{UserName}\AppData\Roaming\Notepad++\shortcuts.xml. The shortcuts file on My Windows 7 computer contains the line
<Command name="Open containing folder" Ctrl="no" Alt="no" Shift="no" Key="0">explorer $(CURRENT_DIRECTORY)</Command>
If you need to alter the shortcuts file then do not use Notepad++, use another editor.

Vim opens a new folder instead of an existing file with `set enc=utf-8` enabled

When I open a file with vim or gvim from console on windows that is located in a sub directory (e.g. gvim subdir/file), it creates a new file at subdir\subdir\file saying "subdir\file" [New DIRECTORY] instead of simply opening the existing file at subdir\file.
This happens since I added the following line to my vimrc:
set enc=utf-8
Is there a possibility to open and create files in UTF-8 mode on Windows without this issue?
You may also look at my vimrc file.
Thank you for any help.
Change the order of the autochdir and encoding options in your vimrc. First set the encoding then autochdir
set enc=utf-8
set autochdir
An explanation can be found here

Vim: Change start up directory?

When I start GVim and start writing my little program I'd like to save the file to the Desktop but it seems that Vim is starting the command line in:
C:\Windows\System32
How would I go about changing that to:
C:\Users\Casey
so then I could just:
:w Desktop\my_program.py
Assuming you're starting gvim from an icon/shortcut in Windows (from the kind of paths you supply), you can change the starting directory (completely independent from the fact that it IS gvim: it would be the same from any other app!) by editing the "starting directory" property of that Windows icon/shortcut.
Within vim, you can change the current directory with the :cd command:
:cd c:\users\casey
I found this way to be better:
Open gVim
:cd $vim
:e _gvimrc
Add the following line:
:cd c:\users\user\desktop\
I found that :Ex is slow on large directories like c:\windows\system32\ (where gVim usually starts).
Also, here is my full _gvimrc in case anyone is interested. I prefer Consolas for coding. The tabstop setting helps when coding especially in Python, and Ctrl+Tab/Ctrl+Shift+Tab is great for switching between buffers:
set guifont=Consolas:h12:cANSI
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab
map <C-Tab> :bnext<cr>
map <C-S-Tab> :bprevious<cr>
:cd c:\users\user\desktop\
How about changing your starting position?
vim icon -> right click -> property -> shortcut -> Start in -> your path you want to change.
but it works perfectly.
I think :cd yourpath also works. but it will change when you don't want to change.
Use :cd c:\users\casey,
after that save into session (in gVim there is button up and down in red, click on it and save as mySessionProject.vim). Next time you need to go to that directory, open that session (you can also use :source mySessionProject.vim)
for command line:
:mksession! yourdir/yourVimConfName.vim
to load
:source yourDir/yourVimConfName.vim
I found the following to be very useful. I am on Windows 7 and vim 7.3.46, and am using gVim.
I edited startup settings, which wound up altering the _vimrc in c:\Users\me\.
I also tried using :version and editing the _vimrc files I found at $VIM, as well as the _vimrc I found at c:\windows\system32.
Editing those files to include :cd c:\Users\me did not result in my default startup directory changing after starting vim. I wanted my default directory to be c:\Users\me\, and editing c:\Users\me\_vimrc achieved that. That is I entered
:e $MYVIMRC
and added
cd c:\Users\cnorton.Arlington1\
to that file.
Just to to put this up incase anyone needs it:
vimrc accepts enironmental parameters. you can put cd $USERPROFILE in your vimrc
Use this mapping in your .vimrc file
:cd $USERPROFILE\Desktop<cr>
or the same shorter
cd ~\Desktop<cr>
A mapping that also displays afterwards the path instead of the command
nmap <leader>d :cd ~\Desktop<cr>:pwd<cr>
Inside init.vim, I use:
lcd $HOME/Projects

Resources