Initial dev config of cmder and git
Git
A version control, which anybody should be familiar with (at least when one is a developer 😀).
The configuration is simple two steps - ssh keys generation, and .gitconfig
generating ssh keys
Covered in Cmder minimal section
.gitconfig
Basic config with aliases, additional tools….
[core]
editor = \"C:/tools/GitExtensions/GitExtensions.exe\" fileeditor
# editor = vim
autocrlf = true
# commentChar = ";" # in case hash is not desired comment char in the commit message files
[user]
email = ...
name = ...
[alias]
co = checkout
ci = commit
st = status
br = branch
[pull]
rebase = false
[fetch]
prune = false
[rebase]
autoStash = false
.gitattributes
Normalizes end-of-line covnetion. Needed to be added at the init of a repository.
If you add it to the existing repo, run git add --renormalize .
and commit the changes.
.gitattributes contents:
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
more readings:
- https://stackoverflow.com/questions/1967370/git-replacing-lf-with-crlf
- https://stackoverflow.com/questions/7156694/git-how-to-renormalize-line-endings-in-all-files-in-all-revisions
Cmder…
…is one of a nice applications, which bnrings you more closer to linux terminal look-and-feel. It is kind of obligatory software for me, wne I do setup new instance of a system, especially for developing.
Besides being great, its behavior can be improved a little bit - which I will divide into several sections:
ssh config for git
It depends if you have installed cmder minimal, or cmder full (with git).
cmder minimal
open C:\tools\cmder\config\user_profile.cmd
and “uncomment this to have the ssh agent load when cmder starts”:
:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd" /k exit
Then, generate ssh key and add it to ssh-agent ssh key using usial methods
cmder full (with git)
You do not have to do anything, unless you have keys specified in standard file format, which are:
(specified in <cmder main directory>\vendor\git-for-windows\mingw64\share\git-gui\lib\sshkey.tcl
)
~/.ssh/id_dsa.pub
~/.ssh/id_ecdsa.pub
~/.ssh/id_ed25519.pub
~/.ssh/id_rsa.pub
~/.ssh/identity.pub
clink config for bash-like history under up/down arrow
A must-have feature, for which I had to search a lot. Fortunately, it is possible with some additional configuration (not sure why it is not a default).
To start with, execute clink info
to find paths, where clink is looking for its configuration:
In my case, I’ve chosen c:\Users\Lukasz\.inputrc
(as it is distinguished by “(exists)”).
The contents is as folows:
set history-point-at-end-of-anchored-search on
"\e[A": history-search-backward # arrow up
"\e[B": history-search-forward # arrow down
Those two urls makes more clear what are these lines about:
- https://github.com/cmderdev/cmder/issues/2184#issuecomment-888051243
- https://tiswww.cwru.edu/php/chet/readline/readline.html#SEC15
cmder default startup directory
The easiest is to use settings:
The config file (cmder\vendor\conemu-maximus5\ConEmu.xml
) can work it out too, but it is xml, so I did not bother…