puk
puk

Reputation: 16782

Can not yank in gVim

I have been moving my .vimrc file over to windows (see here). I now can not yank anything. For example none of the below do anything

Here are some other problems I am having with gVim under windows. I have included these in case anyone finds them useful

My .vimrc is as follows, in case it helps.

let mapleader = ","

" Swap ; and :  Convenient.
nnoremap ; :
nnoremap : ;

"Map jj to escape
inoremap jj <Esc>

" Create Blank Newlines and stay in Normal mode
nnoremap <silent> zj o<Esc>
nnoremap <silent> zk O<Esc>

"Make cursor move as expected with wrapped lines:
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk

"Map Shift+ J to previous buffer
noremap J :bp<CR>

"Map Shift + K to next buffer
noremap K :bn<CR>

"Turn on syntax
filetype plugin indent on
syntax on

" Fast saving
noremap <leader>w :w!<cr>

"Default for checking marks is 4 seconds, make it faster
set updatetime=100

"Persistent Undo
" set undodir=~/.vim/undodir
set undodir=c:\\Users\user\vim\undodir
set undofile
set undolevels=10000    "maximum number of changes that can be undone
set undoreload=10000 "maximum number lines to save for undo on a buffer reload

"Keep undo history when switching buffers
set hidden

"Use the smart version of backspace
set backspace=2

"Use spaces instead of tabs
set expandtab

"Line Numbers
set number

"Makes unnamed clipboard accesible to X window
set clipboard=unnamedplus

"Number of spaces to use for each step of (auto)indent.
set shiftwidth=4

"This shows what you are typing as a command
set showcmd

set smarttab

"Indent every time you press enter
set autoindent

"Cursor Always in middle
"NOTE This causes problems with word wrap of long lines as they are not
"displayed correctly
set scrolloff=999

"make word wrap wrap words, not character
set formatoptions=l
set lbr

"Use ... when word wrapping
set showbreak=...

"enable status line always
set laststatus=2

"
" statusline
" cf the default statusline: %<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
" format markers:
"   %< truncation point
"   %n buffer number
"   %f relative path to file
"   %m modified flag [+] (modified), [-] (unmodifiable) or nothing
"   %r readonly flag [RO]
"   %y filetype [ruby]
"   %= split point for left and right justification
"   %-35. width specification
"   %l current line number
"   %L number of lines in buffer
"   %c current column number
"   %V current virtual column number (-n), if different from %c
"   %P percentage through buffer
"   %) end of width specification
set statusline=%f%m%r%h%w[%n]\ [F=%{&ff}][T=%Y]\ %=[LINE=%l][%p%%]

"set it up to change the status line based on mode
if version >= 700
  au InsertEnter * hi StatusLine term=reverse ctermbg=4
  au InsertLeave * hi StatusLine term=reverse ctermbg=2
endif

"start searching as you type
set incsearch

"Highlight search strings
set hlsearch

" Set off the other paren
highlight MatchParen ctermbg=4

"Ignore case when searching
set ignorecase

"But remember case when capitals used
set smartcase

" Use english for spellchecking, but don't spellcheck by default
if version >= 700
   set spl=en spell
   set nospell
endif

"Show matching brackets when text indicator is over them
set showmatch

"How many tenths of a second to blink
"Does not seem to change anything
set mat=2

"Highlight current line
set cul

"adjust highlight color
hi CursorLine term=none cterm=none ctermbg=232

"enable 256 color
set t_Co=256

"Do not want spell checking in my commented blocks
let g:tex_comment_nospell= 1

if &t_Co == 256
    " colorscheme xoria256
    colorscheme desert
else
    colorscheme peachpuff
endif

" Font size
if has("gui_running")
  if has("gui_gtk2")
    set guifont=Inconsolata\ 12
  elseif has("gui_macvim")
    set guifont=Menlo\ Regular:h14
  elseif has("gui_win32")
    set guifont=Consolas:h14:cANSI
  endif
endif

Upvotes: 0

Views: 283

Answers (1)

Luc Hermitte
Luc Hermitte

Reputation: 32956

Hum... First thing that needs to be checked: .vimrc filename under windows for the native version of vim shall be _vimrc, and it shall be placed into your HOME directory.

Then, you don't seem to be using mswin.vim witch is a good thing for those among us that are used to vim. And I don't see anything suspect in your file.

If you can identify odd keybindings, you can play with :verbose imap jj (for instance) to see if everything works as expected.

PS: swapping : and ; is a bad idea: not all plugins are correctly written to use banged-mappings or :normal! in their functions. You'd best to get used to your keyboard, otherwise surprises and misbehaving plugins are to be expected.

Upvotes: 1

Related Questions