linux下编辑文件时如何定位光标到文件末尾

linux下编辑文件时如何定位光标到文件末尾,第1张

linux下编辑文件定位光标的方法:

1、一般编辑文件都是用vi 或者vim命令。

2、使用G 使光标跳到最后一行,然后用向右的箭头移动光标到末尾。

3、gg可以使光标回到首行,nG可以移动光标到第n行

第一步,首先点击左侧面板上面的程序,设置,然后找到系统设置。

第二步,接着在系统设置里面点击工作空间主题。

第三步,然后点击左侧面板光标主题。

第四步,之后系统会列出内置的光标主题,选择一个后点击应用即可生效。

用C语言在Linux下获取鼠标光标的相对位置代码分享:

#include <stdio.h>

#include <stdlib.h>

#include <linux/input.h>

#include <fcntl.h>

#include <sys/time.h>

#include <sys/types.h>

#include <sys/stat.h>

#include <unistd.h>

int main(int argc,char **argv)

{

int fd, retval

char buf[6]

fd_set readfds

struct timeval tv

//fd = open("/dev/input/mice", O_RDONLY)

if(( fd = open("/dev/input/mice", O_RDONLY))<0)

{

printf("Failed to open \"/dev/input/mice\".\n")

exit(1)

}

else

{

printf("open \"/dev/input/mice\" successfuly.\n")

}

while(1)

{

tv.tv_sec = 5

tv.tv_usec = 0

FD_ZERO(&readfds)

FD_SET(fd, &readfds)


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/8333941.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-15
下一篇2023-04-15

发表评论

登录后才能评论

评论列表(0条)

    保存