joom / latex-unicoder.vim Goto Github PK
View Code? Open in Web Editor NEWA plugin to type Unicode chars in Vim, using their LaTeX names.
A plugin to type Unicode chars in Vim, using their LaTeX names.
Strings that are in between two matches convert to the shorter match, but delete the extra characters. For example:
\p \pi \pit \pitchfork
becomes π π ⋔
(the \p is deleted)
Is it possible to invert the operation?
I would like to be able to select symbols and
convert them back into commands.
While \alpba \beta
converts to α β
, it's not the case that \alpha\beta
converts to αβ
.
Is there a way to fix this?
(1) While \alpha
correctly converts to α
, it's not the case that $\alpha$
converts to α
nor even $α$
.
(2) It would also be cool to go in the reverse direction too: that is to go from α
to $\alpha$
in the code (giving you a way to preview latex files within vim by going back and forth between
Overall fixing (1) would be much more useful (at least to me) than (2) :)
When I add latex-unicoder
to my init.vim
I lost my desired behaviour for <C-l>
shortcut. is there a way to avoid this?
I try adding:
" ========= latex unicoder ==========
let g:unicoder_cancel_normal = 1
let g:unicoder_cancel_insert = 1
let g:unicoder_cancel_visual = 1
nnoremap <F3> :call unicoder#start(0)<CR>
inoremap <F3> <Esc>:call unicoder#start(1)<CR>
vnoremap <F3> :<C-u>call unicoder#selection()<CR>
but not takes effect.
It would be great to be able to visually select an already written latex-symbol in the file and use ctrl-L to substitute the selection with the unicode symbol, instead of typing it out into the prompt again.
It would be nice if there was a variable one could set to disable either the insert or normal mode mapping.
For example:
\dot{a} \dota a\dot
\hat{o} \hato o\hat
converts into
ẋ{𝑎} ẋ𝑎 𝑎ẋ
x̂{𝑜} x̂𝑜 𝑜x̂
In Unicode diacritics are combining characters but in s:presymbols
they are listed as already combined with x
.
Whenever I use latex-unicoder to input a symbol, the cursor always ends up moving to the next line after the symbol gets inputted. Which is to say that this happens:
\lambda
The desired behaviour would of course be that the cursor just moves so that it's immediately after the symbol.
Pull request incoming to fix this issue. Involves mapping commands not to <C-l>
directly but to <Plug>Unicoder
, and then only setting <C-l>
to <Plug>Unicoder
if g:unicoder_no_map
isn't set. The the user's .vimrc
can then look like
" Unicoder stop clobbering my C-l
let g:unicoder_no_map = 1
map <C-g> <Plug>Unicoder
When adding symbols in normal mode, everything is perfect. But in edit mode an extra space is added before the inserted character.
The documentation says that the map would also work in insert mode, but it does not. Note that :map only works in normal, visual, select and operator-pending modes. One should either change the documentation or the :map call.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.