Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to disable the insert-mode \ unicode entry #20

Closed
HalosGhost opened this issue Jul 27, 2016 · 11 comments
Closed

Ability to disable the insert-mode \ unicode entry #20

HalosGhost opened this issue Jul 27, 2016 · 11 comments

Comments

@HalosGhost
Copy link

If this feature is already present, I have not found a way to disable it, but I am hoping to do some literate programming in agda (which uses latex). The result is that I will be typing regular old \ a lot and the unicode entry is incredibly bothersome for that.

I already have a very full XCompose set up and I would much prefer to use that. Is this feature already available? If so, how does one disable it? If not, any chance that you will see fit to add it?

@derekelkins
Copy link
Owner

There is no variable that controls this currently, but I can add it. It should only take a few minutes. You can also just comment out the runtime agda-utf8.vim line in ftplugin/agda.vim.

@derekelkins
Copy link
Owner

Okay, I just pushed 5bbc866 which add the variable g:agdavim_includeutf8_mappings which if you set it to 0 in your vimrc should cause the agda-utf8.vim file not to be loaded.

@HalosGhost
Copy link
Author

I attempted to comment out that runtime line as you suggested but it does not seem to have changed anything. Is there a chance something else is causing it to be loaded?

@derekelkins
Copy link
Owner

Not really in this project unless your bundling mechanism just loads every file in the root of the bundle. The string "agda-utf8.vim" only occurs on that line in the whole project. You can grep your .vim folder to see if something else is loading a version, if, for example, you followed the directions on the Agda vim editing wiki page at some point in the past. You could also just remove the agda-utf8.vim file and that would unambiguously make it clear whether that is where the mappings are coming from.

@HalosGhost
Copy link
Author

This is what confuses me. I have also tried deleting that file wholesale and the \ unicode escape still happens. But, this only happens for me in agda files, no where else. Do you know if the native vim agda syntax provides something like that?

@derekelkins
Copy link
Owner

So, are you sure the \ is leading into unicode? E.g. does \N produce a blackboard N? If not, it's just that the commands in the Agda mode use LocalLeader by default and that is \ by default (in fact, the Unicode mappings also use LocalLeader), so it may just be waiting for a command, e.g. \t to get types. You can write let maplocalleader = ',' in your vimrc, say, to change that (it just needs to run before the mappings are made and comma is just an example.)

@derekelkins
Copy link
Owner

derekelkins commented Jul 27, 2016

The "Typing Unicode Characters" section on this page, refers to the files and setup for the Unicode mappings. You can check for e.g. after/syntax/agda.vim or for unicode-keys to see if any of those being run.

@HalosGhost
Copy link
Author

Indeed, they do produce unicode characters, however, I just noticed something that may give the key to the problem. It seems if I start a new source file, this behavior does not happen in the new file. Does vim cache this kind of thing somewhere?

@HalosGhost
Copy link
Author

Ah hah! I figured it out. This was indeed not an issue with agda-vim (my apologies for the noise). It seems $HOME/.vim/view contains some cached information about files that have been opened with vim. Clearing the relevant files after having disabled the agda-utf8.vim runtime has solved this issue.

Thank you for the help!

@derekelkins
Copy link
Owner

I'd be surprised if it did that across vim sessions (i.e. closing and reopening vim entirely). Of course, it won't reload the mappings, which are buffer local, if the buffer remains open.

@HalosGhost
Copy link
Author

Actually, they did persist across closing and reopening vim entirely. I had to clear the relevant files from the view directory in order to get it to update. This may very well be due to some archaic setting I have in my rc that I had forgotten about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants