Improve .gitignore to ignore all levels of nimcache
Fix type declaration order in historyitem.nim
Merge changes and update gitignore for *.swp files