cygwin: git commit - vim Editor sempre na linha 5 mas não na edição de arquivo

1

Estou usando o cygwin no windows e git a partir do shell.

O VIM é configurado como meu editor de mensagens de confirmação padrão.

Quando estou editando minha mensagem de commit, ou seja,

$ git commit

meu cursor sempre reside na linha 5 quando o arquivo é aberto. Ao editar qualquer arquivo normal no cmdline com o vim, o cursor é colocado na linha onde eu editei o arquivo pela última vez.

Eu quero residir o cursor no git commit para estar na linha 1 - mas eu não encontrei nada que coloque o cursor na linha 5 do meu vimrc ou qualquer coisa.

Alguém tem uma ideia de onde procurar ou o que está acontecendo?

Este é o meu vimrc para quaisquer dicas:

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'

Atualização para comentário solicitando saída de 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
    
por Stefan 11.04.2016 / 11:28

1 resposta

0

Eu estava correndo na mesma coisa. Isso me ajudou:

link

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

Eu coloquei isso no meu ~/.vimrc e isso resolveu o meu problema. O artigo sugere algumas outras maneiras de fazer isso também.

    
por 30.03.2017 / 03:27

Tags