2

I am using cygwin on windows and git from the shell.

VIM is configured as my default commit message editor.

When I am editing my commit message, ie

$ git commit

my cursor always resides to line 5 when the file is opened. While editing any normal file on the cmdline with vim the cursor is placed on the line where I last edited that file.

I want to reside the cursor on git commit to be at line 1 - but I have not found anything that sets the cursor to line 5 on my vimrc or anything.

Does anybody have an idea where to look or what is happening?

This is my vimrc for any hints:

execute pathogen#infect()
filetype plugin indent on
set nocompatible              " be iMproved, required
set encoding=utf-8

"store lots of :cmdline history
set history=1000

set backspace=indent,eol,start

" Syntax Highlighting
syntax on

set background=dark
let g:solarized_termcolors=256
let g:solarized_termtrans=1
colorscheme solarized

" Zeilennummern anzeigen
set nu

set showcmd     "show incomplete cmds down the bottom
set showmode    "show current mode down the bottom

set incsearch   "find the next match as we type the search
set hlsearch    "hilight searches by default

set wrap        "dont wrap lines
set linebreak   "wrap lines at convenient points

"default indent settings
set shiftwidth=4
set softtabstop=4
set expandtab
set autoindent

"tell the term has 256 colors
set t_Co=256

" Statusline
set laststatus=2

if !exists('g:airline_symbols')
      let g:airline_symbols = {}
  endif

    if !exists('g:airline_symbols')
            let g:airline_symbols = {}
              endif


" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
set guifont=Inconsolata\ for\ Powerline
let g:Powerline_symbols="fancy"
let g:airline_powerline_fonts = 1
let g:airline_theme = 'powerlineish'

Update for comment asking for output of git config -l

credential.helper=manager
credential.validate=true
push.default=simple
user.name=Stefan
user.email=xxSomeEmailxx
core.editor=vim
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
remote.origin.url=xxREMOVEDxx
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
  • check git config -l. – matzeri Apr 21 '16 at 16:05
  • @matzeri I updated the question with the output but I did not see any hint in the output for that problem. – Stefan Apr 22 '16 at 7:08
0

I was running into the same thing. This helped me:

http://vim.wikia.com/wiki/Always_start_on_first_line_of_git_commit_message

autocmd FileType gitcommit call setpos('.', [0, 1, 1, 0])

I put that in my ~/.vimrc and it solved my problem. The article suggests a few other ways to do it as well.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.