Skip to content

Vim plugin to change ASCII text to Turkish text, if you're not using a TR keyboard

Notifications You must be signed in to change notification settings

yigitsever/turkish-deasciifier.vim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

turkish-deasciifier.vim

demo.mp4

This plugin is a fork of joom/turkish-deasciifier.vim that introduces opfunc variants of the functions. The original plugin pipes visual selection into a Turkish deasciifier. This fork lets you use operator {motion}, just like any other operator of vim (c, y etc.) Turkish deasciifier is based on Deniz Yüret's turkish-mode.

There are three functions, one to deasciify over a motion using turkish-mode, one to brute force the deasciification (to fix what turkish-mode might have missed) and one to asciify Turkish characters.

You can create key mappings for it like this in your .vimrc file:

" brute force deasciify everything
nnoremap <expr> <Leader>tc TurkishDeasciifyForce()
xnoremap <expr> <Leader>tc TurkishDeasciifyForce()
nnoremap <expr> <Leader>tctc TurkishDeasciifyForce() .. '_'

" use turkish-mode to selectively deasciify
nnoremap <expr> <Leader>tr TurkishDeasciify()
xnoremap <expr> <Leader>tr TurkishDeasciify()
nnoremap <expr> <Leader>trtr TurkishDeasciify() .. '_'

" ascii everything
nnoremap <expr> <Leader>rt TurkishAsciify()
xnoremap <expr> <Leader>rt TurkishAsciify()
nnoremap <expr> <Leader>rtrt TurkishAsciify() .. '_'

Requirements

A Turkish deasciifier executable has to be installed alongside the plugin. There are several ports of it in different languages.

1) emres/turkish-deasciifier Turkish deasciifier in Python. If you are on Arch Linux, this is available on AUR.

paru turkish-deasciifier-git

2) f/deasciifier is the easier version to install if you have node and npm installed. This command would install the deasciifier:

npm install deasciifier -g

Then you have to include this line in your .vimrc file:

let g:turkish_deasciifier_path = 'deasciify'

3) joom/turkish-deasciifier.hs is another easy version to install if you have Haskell installed (cabal and ghc). This command would install the deasciifier:

cabal install turkish-deasciifier

Then you have to include this line in your .vimrc file:

let g:turkish_deasciifier_path = 'turkish-deasciifier'

Installation

Install it using your plugin installation method of choice.

Plug 'yigitsever/turkish-deasciifier.vim'

License

MIT

About

Vim plugin to change ASCII text to Turkish text, if you're not using a TR keyboard

Resources

Stars

Watchers

Forks

Languages

  • Vim Script 100.0%