Coder Social home page Coder Social logo

xo's Introduction

xo: the text editor without frills

You might be looking for help, but this is all I can do:

usage: xo [-h] path

exofrills: your text has been edited...but you are still hungry.

positional arguments:
  path        path to file, may include colon separated line and col numbers,
              eg 'path/to/xo.py:10:42'

optional arguments:
  -h, --help  show this help message and exit

Someone else made a video tutorial and posted it on YouTube within an hour of the 0.1 release.

get xo

Install from the cheeese shop with pip or easy_install:

$ pip install exofrills
$ easy_install exofrills

Fork xo from github:

$ git clone https://github.com/scopatz/xo.git

key commands

esc:get help
ctrl + o:save file (write-out)
ctrl + x:exit (does not save)
meta + s:select pygments style
ctrl + f:insert file at current position
ctrl + y:go to line & column (yalla, let's bounce)
ctrl + n:name completion with Jedi (if installed)
ctrl + k:cuts the current line to the clipboard
ctrl + u:pastes the clipboard to the current line
ctrl + t:clears the clipboard (these spell K-U-T)
ctrl + w:set regular expression and jump to first match
meta + w:jump to next match of current regular expression
ctrl + r:set substitution for regular expression and replace first match
meta + r:replace next match of current regular expression

xo's People

Contributors

asmeurer avatar catb0t avatar corranwebster avatar ivanov avatar rovitotv avatar scopatz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

xo's Issues

Text show up as white even if background is white.

Forcing the background color is probably the easiest fix.

This is very low priority, as I'm unlikely to actually use exofrills. I may howver steal large parts code for use in an editor/IDE, because I do want more frills. :-)

Files grow by extra newline

To replicate:

  • load a file (like xo.py itself)
  • save
  • quit

The file will have grown an extra newline at the end even if it has a newline at the end. This is probably a bug in the code that is supposed to ensure that a file always ends with a newline.

Takes a long time to start

I did a test, when I open a file, and then close it as quickly as I can using CTRL-X, and measure how long it takes (closing is immediate, the startup time is long):

certik@redhawk:~/repos/xo(master)$ time xx/bin/xo xo.py 
real    0m1.895s
user    0m1.044s
sys 0m0.048s
certik@redhawk:~/repos/xo(master)$ time xx/bin/xo xo.py 

real    0m1.359s
user    0m1.040s
sys 0m0.036s
certik@redhawk:~/repos/xo(master)$ time xx/bin/xo xo.py 

real    0m1.426s
user    0m1.056s
sys 0m0.040s
certik@redhawk:~/repos/xo(master)$ time xx/bin/xo xo.py 

real    0m1.418s
user    0m1.020s
sys 0m0.052s
certik@redhawk:~/repos/xo(master)$ time xx/bin/xo xo.py 

real    0m1.408s
user    0m1.044s
sys 0m0.036s
certik@redhawk:~/repos/xo(master)$ time xx/bin/xo xo.py 

real    0m1.421s
user    0m1.048s
sys 0m0.028s
certik@redhawk:~/repos/xo(master)$ time xx/bin/xo xo.py 

real    0m1.281s
user    0m1.068s
sys 0m0.040s
certik@redhawk:~/repos/xo(master)$ time xx/bin/xo xo.py 

real    0m1.362s
user    0m1.036s
sys 0m0.040s
certik@redhawk:~/repos/xo(master)$ time xx/bin/xo xo.py 

real    0m1.442s
user    0m1.036s
sys 0m0.068s

The best time is 1.281s. Compare to Vim:

certik@redhawk:~/repos/xo(master)$ time vim xo.py 

real    0m0.386s
user    0m0.088s
sys 0m0.008s
certik@redhawk:~/repos/xo(master)$ time vim xo.py 

real    0m0.282s
user    0m0.084s
sys 0m0.008s
certik@redhawk:~/repos/xo(master)$ time vim xo.py 

real    0m0.354s
user    0m0.068s
sys 0m0.012s
certik@redhawk:~/repos/xo(master)$ time vim xo.py 

real    0m0.328s
user    0m0.092s
sys 0m0.004s

Best time 0.282s, and I have to press ZZ, which is slower than CTRL+X.

Conclusion: xo takes 1s more to start than vim on my machine. Vim is immediate (the 0.2s is the time it takes me to pres ZZ), while xo literally takes a second to start.

Missing rc.json

Hello.
Tried to open rc.json right after installing and it wasn't successful:

> xo --rc
Traceback (most recent call last):
  File "/home/delameter/.local/bin/xo", line 1122, in <module>
    main()
  File "/home/delameter/.local/bin/xo", line 1109, in main
    with open(RC_PATH) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/delameter/.config/xo/rc.json'

Installed with pip install exofrills (i.e. user installation)

> mkdir /home/delameter/.config/xo
> touch /home/delameter/.config/xo/rc.json
> xo --rc-edit
Warning: rc file not valid JSON.
(empty file)

Maybe something like writing default config if current is empty should be implemeneted?

Using xo xontrib freezes everything

Recently when I've tried using the xo xontrib in xonsh, it has started just freezing - it doesn't load anything, it just sits there on the line after the command to run xo until I hit ctrl+c to try and close out and try again/something else. Event then hitting ctrl+c doesn't always exit the call to xo and I have to restart xonsh.

I'm not entirely sure what may have caused this, though I suspect it may be something related to upgrading xo from 0.1.11 to 0.1.13

Tested using xonsh 5.2 and 5.3, Ubuntu 14.04, python 3.4, xonsh and xo/exofrills installed using pip (for python 3.4).

I also tried unloading the xo xontrib and running the stand-alone xo command and that works just fine.
Only other xontrib loaded in xonsh is apt_tabcomplete which seems to work just fine as well.

not working properly

I tried installing it on my mac with pip3. It successfully finished installing but when tried to run I got dependency errors:

Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import deque, Mapping, Sequence

and

Traceback (most recent call last):
File "/usr/local/bin/xo", line 34, in
import urwid
ModuleNotFoundError: No module named 'urwid'

and

Traceback (most recent call last):
File "/usr/local/bin/xo", line 36, in
import pygments_cache
ModuleNotFoundError: No module named 'pygments_cache'

The last two I could solve by pip install urwid and pygments_cache. But the first one I don't know how to solve.

Change color scheme

Hi

how can I change xo's color scheme? On the default Ubuntu terminal (black on white background) I cannot see anything in xo. Second question: which is the meta key? Gnome intercepts the "windows" key.

Best
Stefan

Newlines are stripped while chosing a style

Steps to reproduce

  • go to end of file
  • press alt-s to chose style
  • press backspace

Result:

  • New lines are removed from the editor

Expected result:

  • Nothing should happen as the style selection input has the focus

Not saving

I've tried this a few ways, both with pypi and github version - saving doesn't seem to happen:

b8e8561349da:tmp$ mktmpenv -p /usr/local/bin/python3

...Cleaning up...

This is a temporary environment. It will be deleted when you run 'deactivate'.
(9c5c68941227cfc8)b8e8561349da:9c5c68941227cfc8$ pip install -e git+https://github.com/scopatz/xo.git#egg=xo

...

Successfully installed xo Pygments urwid

(9c5c68941227cfc8)b8e8561349da:9c5c68941227cfc8$ xo foo.py

# wrote hello world, then ^o then ^x

(9c5c68941227cfc8)b8e8561349da:9c5c68941227cfc8$ more foo.py 

# nothing?

Ctrl+Right won't jump to the end of a line

But Ctrl+Left to go left 1 word does go left 1 word like it should. Not sure I can fix this but I can try.

xo/xo.py

Lines 856 to 862 in febf634

elif k == "ctrl right" or k == "meta right":
w, ypos = self.walker.get_focus()
xpos = w.edit_pos
re_word = RE_WORD if k == "meta right" else RE_NOT_WORD
m = re_word.search(w.edit_text or "", xpos)
word_pos = xpos if m is None else m.end()
w.set_edit_pos(word_pos)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.