Closed chamindra closed 5 years ago
Also:
Can I give any more info about my installation or .vimrc file that might help?
Yes please. I am currently testing this on a Mac OS X El Caiptan on VIM version 7.4.258
I did some basic testing and unfortunately I could not replicate the issue. The menu macros->find worked as it should and the mv7 files were not empty. Can you possibly share a few more details and a sequence of steps (sample macro) that causes the issue so I can recreate the issue.
:source $HOME/marvim.vim
"Macro" dropdown appears at top of window
qa
i test macro thing <Esc>
q
from dropdown, click --macro --store macro
Enter Macro Save Name -> testmarvim
from dropdown, click --macro --find
Macro Search -> testmarvim
Macro Search -> testmarvim
Nothing changes on the screen
Comparing this to see if the macro runs 'normally':
@a
"test macro thing" appears on screen
.vimrc file follows:
"_______ Basic stuff __________
syntax on
set autoindent "Check if this is good
set nobackup
set tabstop=4
set shell=bash\ -i
:let mapleader = "-"
"Automatically cd into the directory that the file is in
set autochdir
"______ VIMRC manipulation
" Recover: simple command to open .vimrc in half window
:nnoremap -ev :vsplit $MYVIMRC<cr>
" Automate refresh .vimrc when it changes
augroup reload_vimrc " {
autocmd!
autocmd BufWritePost $MYVIMRC source $MYVIMRC
augroup END " }
"______ Startup, Saving and loading sessions ________
"save without leaving
"{{{Auto Commands
" Automatically cd into the directory that the file is in
"autocmd BufEnter * execute "chdir ".escape(expand("%:p:h"), ' ')
" Remove any trailing whitespace that is in the file
autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif
" Restore cursor position to where it was before
augroup JumpCursorOnEdit
au!
autocmd BufReadPost *
\ if expand("<afile>:p:h") !=? $TEMP |
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ let JumpCursorOnEdit_foo = line("'\"") |
\ let b:doopenfold = 1 |
\ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
\ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
\ let b:doopenfold = 2 |
\ endif |
\ exe JumpCursorOnEdit_foo |
\ endif |
\ endif
" Need to postpone using "zv" until after reading the modelines.
autocmd BufWinEnter *
\ if exists("b:doopenfold") |
\ exe "normal zv" |
\ if(b:doopenfold > 1) |
\ exe "+".1 |
\ endif |
\ unlet b:doopenfold |
\ endif
augroup END
"}}}
"Creates a 'session' which saves the current layout of files in MacVim: type "mksession sessionname"
function! MakeSession()
let b:sessiondir = $HOME . "/.vim/sessions" . getcwd()
if (filewritable(b:sessiondir) != 2)
exe 'silent !mkdir -p ' b:sessiondir
redraw!
endif
let b:filename = b:sessiondir . '/session.vim'
exe "mksession! " . b:filename
endfunction
" to load a particular session back up -- ":source mysession.vim
"Loads the last session that was up when you quit
"function! LoadSession()
" let b:sessiondir = $HOME . "/.vim/sessions" . getcwd()
" let b:sessionfile = b:sessiondir . "/session.vim"
" if (filereadable(b:sessionfile))
" exe 'source ' b:sessionfile
" else
" echo "No session loaded."
" endif
"endfunction
" au VimEnter * nested :call LoadSession()
" au VimLeave * :call MakeSession()
"__________________________________
"
"Marvim for macros
let marvim_store_key = 'ms' " change store key from <F3> to 'ms'
let marvim_register = 'c' " change used register from 'q' to 'c'
let marvim_prefix = 0 " disable default syntax based prefix
"_____DIR and file manipulation ______
"Copies the file name to buffer
:nmap cp :let @" = expand("%")
:nmap Cp :let @* = expand("%")
"Recover -- same for file dir
:nmap cd :let @" = expand("%:p")
:nmap Cp :let @* = expand("%:p")
"______ Formatting, line breaks, tabs etc ______
"------ Indents and tabs ------
set autoindent " set the cursor at same indent as line above
set smartindent " try to be smart about indenting (C-style)
set expandtab " expand <Tab>s with spaces; death to tabs!
set shiftwidth=4 " spaces for each step of (auto)indent
set softtabstop=4 " set virtual tab stop (compat for 8-wide tabs)
set tabstop=8 " for proper display of files with tabs
set shiftround " always round indents to multiple of shiftwidth
set copyindent " use existing indents for new indents
set preserveindent " save as much indent structure as possible
filetype plugin indent on " load filetype plugins and indent settings
:set invnumber
"______Simple moving and editing ________
"Inserts a line below or above, or a space, without leaving standard mode
:nmap <S-Enter> O<Esc>j
:nmap <CR> o<Esc>k
:nnoremap <space> i<space><esc>
:nnoremap <S-space> ^i//<esc>A//
:nnoremap <S-.> ^i//<esc>A//
"i\/\/<Esc>A\/\/
:nmap £ >
" In normal mode, I remap : to ; so I don't have to hold down shift to
" enter a command like ':e' or ':sort'. Does not affect insert mode.
:noremap ; :
" Got backspace?
"
"
set backspace=2
"Redo: quick command (jjj) to get out of insert mode
inoremap jjj <Esc>
inoremap ;; <Esc>
"*** Searching
"Ignore case (in searches, unless using multiple cases)
set ignorecase
set smartcase
" Highlight things that we find with the search
set hlsearch
"Move Line (of text) to End of file
:nnoremap -mle yyGp<C-o>dd
"Copy
:nnoremap -cle yyGp<C-o>
"Copy text under cursor to end of file
:nnoremap -ce yGp<C-o>
"_____Commands and macros for text replacing etc ______
"redo: strip all but file headings and margin notes from tex file
"Define some abbreviations to draw comments.
:ab £b /********************************************************
:ab £e \*******************************************************/
:ab £l /*------------------------------------------------------*/
:ab £u ____________________
:ab £= ====================
:ab ,,1 #
:ab ,,2 ##
:ab ,,3 ###
"_____Latex stuff________
The default register is 'q'. So you should type qq or if you want to change the default register to 'a' put the following in your vimrc file
let marvim_register = 'a'
If that does not work try with the g: prefix on the variable
let g:marvim_register = 'a'
Let me know what option works if it does..
This worked, thank you.
let g:marvim_register = 'a' Sorry I didn't read the docs closely enough -- hadn't remembered that marvim only stores macros from a single register.
On Mon, Oct 12, 2015 at 4:22 AM, Chamindra de Silva < notifications@github.com> wrote:
let g:marvim_register = 'a'
Closing the issue, since the user got the wanted answer.
Dear Chamindra,
I've installed Marvim (I think) for my MacVim installation.
It all seems to be working except when I 'run' the saved macro by going to the dropdown -macro -find, then scrolling through to the saved macro and hitting enter... nothing happens.
The macro, which runs fine as a normal saved macro, doesn't run when executed in this way.
Any ideas?
Thanks!